How unit 3 is examined
Numerical solution of ODEs (Taylor, Euler, modified Euler, Runge-Kutta, Milne, Adams) and finite-difference solution of Laplace, Poisson, heat and wave equations; modified Euler, Runge-Kutta and Taylor carry the marks.
Ordinary differential equations: Taylor’s series
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. To solve $y'=f(x,y)$, $y(x_0)=y_0$, Taylor’s method expands $y(x)$ about $x_0$ as a power series whose coefficients are the successive derivatives of $y$ at $x_0$.
Formula. $$y(x)=y_0+(x-x_0)y_0'+\frac{(x-x_0)^2}{2!}y_0''+\frac{(x-x_0)^3}{3!}y_0'''+\cdots$$
Key points.
- Differentiate the given equation repeatedly to get $y'', y''', y^{(4)}$ in terms of $x$, $y$ and lower derivatives.
- Put $x=x_0$, $y=y_0$ in each derivative to get the numerical coefficients.
- Substitute them in the series and evaluate at the required $x$.
- The method is accurate only near $x_0$, so for a distant point it is applied step by step, restarting from each new point.
- Its error is the first neglected term, so more terms give more accuracy.
- It needs $f$ to be differentiable many times, which is its main drawback.
Example. $y'=x+y$, $y(0)=1$, find $y(0.1)$.
| Derivative | Expression | Value at (0, 1) |
|---|---|---|
| $y'$ | $x+y$ | 1 |
| $y''$ | $1+y'$ | 2 |
| $y'''$ | $y''$ | 2 |
| $y^{(4)}$ | $y'''$ | 2 |
$y=1+x+x^2+\frac{x^3}{3}+\frac{x^4}{12}$, so at $x=0.1$: $1+0.1+0.01+0.000333+0.0000083$
$y(0.1)\approx1.1103$
For $y'=1-2xy$, $y(0)=0$: $y'_0=1$, $y''_0=0$, $y'''_0=-4$, $y^{(4)}_0=0$, $y^{(5)}_0=32$, so $y=x-\frac{2x^3}{3}+\frac{4x^5}{15}-\cdots$
Answer frame. Open with "Taylor’s series about $x_0$ is ..."; write the series; tabulate the derivatives and their values at $x_0$; substitute; close with the boxed value of $y$.
==Taylor’s method finds successive derivatives at $x_0$ and substitutes them in $y=y_0+(x-x_0)y_0'+\frac{(x-x_0)^2}{2!}y_0''+\cdots$.==
Asked: [7 marks] (Jun 2023, Dec 2025) Use Taylor series method to obtain the value of $y$ at $x=0.1$ for $\frac{dy}{dx}=x+y$, $y(0)=1$. Solve $\frac{dy}{dx}=1-2xy$, $y(0)=0$, by Taylor’s method.
Euler method
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Euler’s method advances the solution of $y'=f(x,y)$ by the tangent line at each step: $y_{n+1}=y_n+hf(x_n,y_n)$, with $x_{n+1}=x_n+h$.
Key points.
- It is the simplest single-step method and needs only $f$, not its derivatives.
- Geometrically the curve is replaced by short tangent segments.
- The local error is of order $h^2$ and the global error of order $h$, so it is not very accurate.
- It is used mainly as the predictor for the modified Euler method.
modified Euler’s method
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">High weight</span>
Definition. Modified Euler’s (Heun’s) method is a predictor-corrector improvement of Euler’s method that uses the average of the slopes at both ends of the step instead of the slope at the start.
Formula. $$y_{n+1}^{(0)}=y_n+hf(x_n,y_n)\quad\text{(predictor, Euler)}$$ $$y_{n+1}^{(k+1)}=y_n+\frac{h}{2}\left[f(x_n,y_n)+f(x_{n+1},y_{n+1}^{(k)})\right]\quad\text{(corrector)}$$
Key points.
- The predictor gives a first estimate $y_{n+1}^{(0)}$ by ordinary Euler.
- The corrector applies the trapezoidal rule, using the mean of the slopes at $(x_n,y_n)$ and $(x_{n+1},y_{n+1}^{(k)})$.
- The corrector is repeated, each time feeding the latest value back, until two successive values agree to the required decimals.
- The value $f(x_n,y_n)$ is computed once per step and reused in every iteration.
- The local error is of order $h^3$, so it is more accurate than Euler’s method for the same $h$.
- Each accepted $y_{n+1}$ becomes the starting value of the next step.
Example. $y'=x+\sin y$, $y(0)=1$, $h=0.2$; find $y(0.2)$, $y(0.4)$.
Step 1: $f(0,1)=\sin1=0.84147$; predictor $y_1^{(0)}=1+0.2(0.84147)=1.1683$.
Corrector ($y_1=1+0.1[0.84147+f(0.2,y_1^{(k)})]$):
| Iteration | $y_1^{(k)}$ used | $f(0.2,y)$ | New $y_1$ |
|---|---|---|---|
| 1 | 1.1683 | 1.1201 | 1.1962 |
| 2 | 1.1962 | 1.1306 | 1.1972 |
| 3 | 1.1972 | 1.1310 | 1.1972 |
So $y(0.2)=1.1972$. Next step: $f(0.2,1.1972)=1.1310$, predictor $y_2^{(0)}=1.1972+0.2(1.1310)=1.4234$; corrector $1.1972+0.1[1.1310+f(0.4,1.4234)]$ gives $1.4493$, then $1.4496$, $1.4496$.
$y(0.2)\approx1.1972,\; y(0.4)\approx1.4496$
Other papers, same method: $y'=\log_{10}(x+y)$, $y(0)=1$, $h=0.2$ gives $y(0.2)=1.0082$; $y'=1-y$, $y(0)=0$, $h=0.1$ gives $y(0.1)=0.0952$, $y(0.2)=0.1814$, $y(0.3)=0.2594$.
Answer frame. Open with the predictor and corrector formulas; write $f$, $x_0$, $y_0$, $h$; do the predictor, then tabulate corrector iterations until the value repeats; repeat for the next step; close with a boxed table of $x$ and $y$.
<mark>Modified Euler’s method predicts with $y_n+hf(x_n,y_n)$ and corrects with $y_n+\frac h2[f(x_n,y_n)+f(x_{n+1},y_{n+1})]$ until the value stabilises.</mark>
Pitfall: Recomputing the corrector with the old value instead of the newly obtained $y_{n+1}$, or stopping after one correction, loses accuracy marks.
Asked: [14 marks] (Nov 2022, Jun 2023, Jun 2025) Given $\frac{dy}{dx}=x+\sin y$, $y(0)=1$, compute $y(0.2)$ and $y(0.4)$ with $h=0.2$ using Euler’s modified method. Find $y(0.2)$ by Euler’s modified method, $\frac{dy}{dx}=\log_{10}(x+y)$, $y(0)=1$. Solve $\frac{dy}{dx}=1-y$, $y(0)=0$, by Euler’s modified method and tabulate at $x=0.1,0.2,0.3$.
Runge-Kutta method of fourth order for solving first and second-order equations
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Medium weight</span>
Definition. The fourth-order Runge-Kutta (RK4) method finds $y_{n+1}$ from $y_n$ using a weighted average of four slope estimates in the step, giving Taylor accuracy up to $h^4$ without any derivatives of $f$.
Formula. $$k_1=hf(x_0,y_0),\quad k_2=hf\left(x_0+\tfrac h2,\,y_0+\tfrac{k_1}{2}\right)$$ $$k_3=hf\left(x_0+\tfrac h2,\,y_0+\tfrac{k_2}{2}\right),\quad k_4=hf(x_0+h,\,y_0+k_3)$$ $$y_1=y_0+\tfrac16(k_1+2k_2+2k_3+k_4)$$
Key points.
- $k_1$ is the slope at the start, $k_2$ and $k_3$ are slopes at the midpoint, and $k_4$ is the slope at the end.
- The midpoint slopes carry weight 2 each, so the weights are $1,2,2,1$ over $6$.
- It is a single-step method, so it needs only $y_0$ to start and is self-starting.
- The error per step is of order $h^5$, which is why it is the most used method.
- For a second-order equation $y''=f(x,y,z)$, put $z=y'$ and solve the pair $y'=z$, $z'=f$ together: $k_1=hz_0$, $l_1=hf(x_0,y_0,z_0)$; $k_2=h(z_0+\frac{l_1}2)$, $l_2=hf(x_0+\frac h2,y_0+\frac{k_1}2,z_0+\frac{l_1}2)$; and so on, with $y_1=y_0+\frac16(k_1+2k_2+2k_3+k_4)$, $z_1=z_0+\frac16(l_1+2l_2+2l_3+l_4)$.
Example. $y'=xy$, $y(1)=2$, $h=0.2$: $k_1=0.4$, $k_2=0.2(1.1)(2.2)=0.484$, $k_3=0.2(1.1)(2.242)=0.49324$, $k_4=0.2(1.2)(2.49324)=0.59838$.
$y(1.2)=2+\frac16(0.4+0.968+0.98648+0.59838)=2+0.49214$
$y(1.2)\approx2.4921$
Other papers: $10y'=x^2+y^2$, $y(0)=1$, $h=0.1$ ($f=0.1(x^2+y^2)$): $k_1=0.01$, $k_2=0.010125$, $k_3=0.010127$, $k_4=0.010304$, so $y(0.1)\approx1.0101$. For $y'=x+y$, $y(0)=1$, $h=0.1$:
| Step | $k_1$ | $k_2$ | $k_3$ | $k_4$ | $y$ |
|---|---|---|---|---|---|
| $x=0.1$ | 0.1 | 0.11 | 0.1105 | 0.12105 | 1.1103 |
| $x=0.2$ | 0.12103 | 0.13209 | 0.13264 | 0.14430 | 1.2428 |
Answer frame. Open with "RK4 formulas are ..."; write $f$, $x_0$, $y_0$, $h$; compute $k_1$ to $k_4$ in order (a table for two steps); substitute in $y_1$; close with the boxed $y$. For second order, first convert to two first-order equations.
==Runge-Kutta fourth order: $y_1=y_0+\frac16(k_1+2k_2+2k_3+k_4)$ with $k_1=hf(x_0,y_0)$ and $k_2,k_3$ the midpoint slopes and $k_4$ the end slope.==
Asked: [7 marks] (Nov 2022) Using Runge-Kutta method of fourth order solve $y'=xy$, $y(1)=2$ at $x=1.2$ with $h=0.2$. Asked: [7 marks] (Jun 2023) Apply Runge-Kutta method of fourth order to solve $10\frac{dy}{dx}=x^2+y^2$, $y(0)=1$ for $x=0.1$. Asked: [7 marks] (Dec 2025) Solve $\frac{dy}{dx}=x+y$, $y(0)=1$ by Runge-Kutta method from $x=0$ to $x=0.2$ with $h=0.1$.
Milne’s predictor-corrector method
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Low weight</span>
Definition. Milne’s method is a multistep predictor-corrector method that needs four known values $y_0,y_1,y_2,y_3$ to find $y_4$.
Formula. $$y_{4}^{p}=y_0+\frac{4h}{3}(2f_1-f_2+2f_3),\qquad y_{4}^{c}=y_2+\frac h3(f_2+4f_3+f_4)$$
Key points.
- The starting values $y_1,y_2,y_3$ come from Taylor, Picard or Runge-Kutta.
- Compute $f_i=f(x_i,y_i)$, predict $y_4$, find $f_4$ from it, then correct; repeat the corrector until it stops changing.
- For $y'=x-y^2$, $y(0)=0$, $h=0.2$ (RK starts $y_1=0.0200$, $y_2=0.0795$, $y_3=0.1762$): $y_4^p=0.3049$, $y_4^c=0.3046$.
Asked: [7 marks] (Jun 2023) Use Milne’s method to find the solution of $\frac{dy}{dx}=x-y^2$, $y=0$ when $x=0$, for $0<x<1$.
Adam’s predictor-corrector method
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. The Adams-Bashforth (predictor) and Adams-Moulton (corrector) pair is a multistep method using the four previous values $y_n,\dots,y_{n-3}$.
Formula. $$y_{n+1}^{p}=y_n+\frac{h}{24}(55f_n-59f_{n-1}+37f_{n-2}-9f_{n-3})$$ $$y_{n+1}^{c}=y_n+\frac{h}{24}(9f_{n+1}+19f_n-5f_{n-1}+f_{n-2})$$
Key points.
- Starting values $y_1,y_2,y_3$ are found by Runge-Kutta or Taylor.
- The corrector uses $f_{n+1}$ computed from the predicted value and is repeated until it converges.
- Both formulas have error of order $h^5$.
Finite difference solution of two-dimensional Laplace equation
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Laplace’s equation $u_{xx}+u_{yy}=0$ is solved on a square mesh of side $h$ by replacing the derivatives with central differences.
Formula. $$u_{i,j}=\frac14\left(u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}\right)$$
Key points.
- This is the standard five-point formula: each interior value is the mean of its four neighbours.
- Boundary values are given, and the interior values form a set of linear equations.
- They are solved by Gauss-Seidel iteration or by Liebmann’s method.
- If the mesh is diagonal, the diagonal formula uses the mean of the four diagonal neighbours.
Finite difference solution of two-dimensional Poisson equation
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. Poisson’s equation $u_{xx}+u_{yy}=f(x,y)$ is Laplace’s equation with a non-zero right-hand side, solved on the same square mesh.
Formula. $$u_{i,j}=\frac14\left(u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-h^2f(x_i,y_j)\right)$$
Key points.
- The only change from Laplace is the extra term $-h^2f_{i,j}$.
- Boundary values are known, and the interior equations are solved by iteration.
- When $f=0$ it reduces to Laplace’s formula.
Implicit and explicit methods for one-dimensional heat equation (Bender-Schmidt method)
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. For the heat equation $u_t=c^2u_{xx}$ with mesh sizes $h$ (in $x$) and $k$ (in $t$), put $r=\frac{c^2k}{h^2}$; the explicit method finds each new time level directly from the previous one.
Formula. $$u_{i,j+1}=ru_{i-1,j}+(1-2r)u_{i,j}+ru_{i+1,j}$$
Key points.
- The explicit scheme is stable only when $r\le\frac12$.
- Bender-Schmidt takes $r=\frac12$, giving $u_{i,j+1}=\frac12(u_{i-1,j}+u_{i+1,j})$.
- Implicit methods use unknowns at the new level and need a linear system solved at every step, but are stable for all $r$.
Crank-Nicholson method
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. The Crank-Nicolson method is an implicit scheme for the heat equation that averages the difference formula at levels $j$ and $j+1$.
Formula. $$-ru_{i-1,j+1}+2(1+r)u_{i,j+1}-ru_{i+1,j+1}=ru_{i-1,j}+2(1-r)u_{i,j}+ru_{i+1,j}$$
Key points.
- It is stable for every value of $r$.
- For $r=1$ it becomes $-u_{i-1,j+1}+4u_{i,j+1}-u_{i+1,j+1}=u_{i-1,j}+u_{i+1,j}$.
- Each time level needs a tridiagonal system in the unknowns $u_{i,j+1}$.
Finite difference explicit method for wave equation
<span style="display:inline-block;padding:.16em .6em;border:1.5px solid currentColor;border-radius:999px;font-size:.68em;font-weight:700;letter-spacing:.06em;text-transform:uppercase;opacity:.75">Not asked since 2022</span>
Definition. For the wave equation $u_{tt}=c^2u_{xx}$, with $r=\frac{ck}{h}$, the explicit scheme finds level $j+1$ from levels $j$ and $j-1$.
Formula. $$u_{i,j+1}=2(1-r^2)u_{i,j}+r^2(u_{i+1,j}+u_{i-1,j})-u_{i,j-1}$$
Key points.
- It is stable for $r\le1$.
- For $r=1$: $u_{i,j+1}=u_{i+1,j}+u_{i-1,j}-u_{i,j-1}$.
- The first row comes from the initial displacement, and the second row from the initial velocity; if it is zero, $u_{i,1}=\frac12(u_{i+1,0}+u_{i-1,0})$ for $r=1$.
Last-minute revision
- Taylor: $y=y_0+(x-x_0)y_0'+\frac{(x-x_0)^2}{2!}y_0''+\cdots$; for $y'=x+y$, $y(0)=1$: $y(0.1)=1.1103$.
- Euler: $y_{n+1}=y_n+hf(x_n,y_n)$.
- Modified Euler predictor: $y_n+hf_n$; corrector: $y_n+\frac h2[f_n+f_{n+1}]$, iterated to convergence.
- $y'=x+\sin y$, $h=0.2$: $y(0.2)=1.1972$, $y(0.4)=1.4496$.
- RK4: $y_1=y_0+\frac16(k_1+2k_2+2k_3+k_4)$; $y'=xy$ gives $y(1.2)=2.4921$.
- $y'=x+y$, RK4, $h=0.1$: $y(0.1)=1.1103$, $y(0.2)=1.2428$.
- Milne predictor: $y_0+\frac{4h}3(2f_1-f_2+2f_3)$; corrector: $y_2+\frac h3(f_2+4f_3+f_4)$.
- Adams predictor uses $55,-59,37,-9$ over $24$; corrector $9,19,-5,1$ over $24$.
- Laplace: $u_{i,j}$ is the mean of four neighbours; Poisson subtracts $h^2f$ inside the bracket.
- Heat: $r=\frac{c^2k}{h^2}$, explicit stable for $r\le\frac12$; Crank-Nicolson stable for all $r$; wave: $r=\frac{ck}h\le1$.
Memory hooks
- Modified Euler: predict with a tangent, correct with the average slope, repeat.
- RK4 weights: 1-2-2-1 over 6, like Simpson’s rule.
- Milne: 4h/3 predictor, h/3 corrector (Simpson’s in the corrector).
- Adams numbers: 55, 59, 37, 9 and 9, 19, 5, 1.
- Heat needs $r\le\frac12$ (Bender-Schmidt is exactly $\frac12$); wave needs $r\le1$.
Coverage checklist
- Ordinary differential equations: Taylor’s series: Q Taylor $y(0.1)$ for $x+y$ and $1-2xy$.
- Euler method: no past question.
- modified Euler’s method: Q $x+\sin y$, $\log_{10}(x+y)$, $1-y$.
- Runge-Kutta method of fourth order for solving first and second-order equations: Q $xy$, $10y'=x^2+y^2$, $x+y$.
- Milne’s predictor-corrector method: Q $x-y^2$.
- Adam’s predictor-corrector method: no past question.
- Finite difference solution of two-dimensional Laplace equation: no past question.
- Finite difference solution of two-dimensional Poisson equation: no past question.
- Implicit and explicit methods for one-dimensional heat equation (Bender-Schmidt method): no past question.
- Crank-Nicholson method: no past question.
- Finite difference explicit method for wave equation: no past question.