How unit 3 is examined
This unit solves ordinary differential equations step by step (Taylor, Euler, Runge-Kutta, Milne, Adams) and partial differential equations by finite differences; the marks sit in modified Euler, Runge-Kutta, Taylor and Milne, with one paper each on Poisson and Crank-Nicholson.
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. For $y'=f(x,y)$, $y(x_0)=y_0$, Taylor's series method expands the solution about $x_0$ and evaluates it at $x_0+h$.
Formula. $$y(x_0+h)=y_0+hy_0'+\frac{h^2}{2!}y_0''+\frac{h^3}{3!}y_0'''+\cdots$$
Key points.
- The derivatives $y'',y''',\dots$ are found by differentiating $y'=f(x,y)$ repeatedly and substituting $x_0,y_0$.
- Each term is smaller than the last because $h$ is small, so the series is cut when the next term no longer changes the required decimal place.
- The method needs $f$ to be easily differentiable, which is why it is used only for simple equations.
- Picard's method instead iterates $y_{n+1}=y_0+\int_{x_0}^{x}f(x,y_n)\,dx$ starting from $y_1=y_0+\int f(x,y_0)dx$.
Example. $y'=x^2y-1$, $y(0)=1$, find $y(0.1)$. Then $y''=2xy+x^2y'$, $y'''=2y+4xy'+x^2y''$, $y^{iv}=6y'+6xy''+x^2y'''$.
| Derivative at $x=0$ | $y'$ | $y''$ | $y'''$ | $y^{iv}$ |
|---|---|---|---|---|
| Value | $-1$ | $0$ | $2$ | $-6$ |
$y(0.1)=1-0.1+0+\frac{2(0.1)^3}{6}-\frac{6(0.1)^4}{24}=$ 0.90031.
Example. $xy'=x-y$, $y(2)=2$, $y(2.1)$: $y'=(x-y)/x=0$; $xy''=1-2y'$ gives $y''=0.5$; $xy'''=-3y''$ gives $y'''=-0.75$; $xy^{iv}=-4y'''$ gives $y^{iv}=1.5$. So $y(2.1)=2+0+\frac{0.01}{2}(0.5)-\frac{0.001}{6}(0.75)+\frac{0.0001}{24}(1.5)=$ 2.00238.
Example. Picard, $y'=1+xy$, $y(0)=1$: $y_1=1+x+\frac{x^2}{2}$, $y_2=1+x+\frac{x^2}{2}+\frac{x^3}{3}+\frac{x^4}{8}$, $y_3=y_2+\frac{x^5}{15}+\frac{x^6}{48}$. This gives $y(0.1)=$ 1.105, $y(0.2)=$ 1.223, $y(0.3)=$ 1.355.
<mark>Taylor's method writes $y(x_0+h)$ as a power series in $h$ whose coefficients are the successive derivatives of $y$ at $(x_0,y_0)$.</mark>
Answer frame. Open with the series formula; find $y',y'',y'''$ at the starting point in a small table; substitute $h$ term by term; close with the value rounded as asked. For Picard write the iteration, integrate twice or thrice, then substitute each $x$.
Asked: [7 marks] (Dec 2020, Jun 2022) Find $y(0.1)$ for $\frac{dy}{dx}=x^2y-1$, $y(0)=1$ using Taylor's series method. Asked: [7 marks] (Dec 2020) Using Taylor's series solve $xy'=x-y$, $y(2)=2$ at $x=2.1$, correct to five decimal places. Asked: [7 marks] (May 2019) Use Picard's method to approximate $y$ at $x=0.1,0.2,0.3$, given $y=1$ at $x=0$ and $\frac{dy}{dx}=1+xy$, correct to three decimal places.
Euler and modified Euler's methods
<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. Euler's method advances the solution of $y'=f(x,y)$ by moving along the tangent at each point for one step $h$; the modified method corrects that step with the average of the slopes at both ends.
Formula. $$y_{n+1}=y_n+hf(x_n,y_n)\quad\text{(Euler)}$$ $$y_{n+1}^{(0)}=y_n+hf(x_n,y_n),\qquad y_{n+1}^{(k)}=y_n+\frac h2\left[f(x_n,y_n)+f(x_{n+1},y_{n+1}^{(k-1)})\right]$$
Key points.
- Euler's method is a first-order method, so its error per step is of order $h^2$ and it needs a very small $h$ for good accuracy.
- It uses the slope only at the left end of each interval, so the error builds up as the tangent leaves the true curve.
- Modified Euler first predicts $y_{n+1}^{(0)}$ by Euler's formula and then corrects it using the trapezoidal average of two slopes.
- The corrector is repeated until two successive values agree to the required decimals, and only then is the next step begun.
- Modified Euler is second order (error per step of order $h^3$), so it is far more accurate than Euler for the same $h$.
- Every step needs $f(x_n,y_n)$ with the latest $y_n$, so the steps cannot be skipped.
Example. $y'=x+y$, $y(0)=1$, $h=0.1$, find $y(0.3)$ by modified Euler.
| $x_{n+1}$ | Predictor | Corrector iterates | $y_{n+1}$ |
|---|---|---|---|
| 0.1 | $1+0.1(1)=1.1$ | 1.11, 1.1105, 1.11052 | 1.1105 |
| 0.2 | $1.1105+0.1(1.2105)=1.23155$ | 1.24260, 1.24316, 1.24321 | 1.2432 |
| 0.3 | $1.2432+0.1(1.4432)=1.38752$ | 1.39974, 1.40035, 1.40039 | 1.4004 |
Answers of the other papers (same method):
| Question | Steps | Result |
|---|---|---|
| $y'=x+y$, $h=0.2$ to $x=1$ | 1.24444, 1.58765, 2.05158, 2.66304 | $y(1)=$ 3.4548 |
| $y'=\frac{2-y}{4x}$, $y(4)=1$, $h=0.1$ | $y(4.1)=1.00616$ | $y(4.2)=$ 1.01213 |
| $y'=x+\sqrt y$, $y(2)=4$, $h=0.2$ | $y(2.2)=4.84$ | $y(2.4)=$ 5.76 |
Example (plain Euler). $y'=\frac{y^2-x}{y^2+x}$, $y(0)=1$, $h=0.1$: $f(0,1)=1$ so $y(0.1)=1+0.1(1)=$ 1.1; $f(0.1,1.1)=\frac{1.11}{1.31}=0.84733$ so $y(0.2)=1.1+0.084733=$ 1.18473. For $y'=y^2-x^2$, $y(0)=1$: $y(0.1)=1+0.1(1)=$ 1.1.
==Modified Euler predicts with $y^{(0)}_{n+1}=y_n+hf(x_n,y_n)$ and corrects with $y_{n+1}=y_n+\frac h2[f(x_n,y_n)+f(x_{n+1},y_{n+1}^{(k-1)})]$ until two iterates agree.==
Pitfall: Stopping after one correction, or restarting the predictor from the old $y_n$ instead of the converged value, gives a wrong last decimal.
Answer frame. Open with both formulas and $f(x,y)$, $h$, $x_0$, $y_0$; tabulate predictor and corrector iterates for each step; give the converged value at each $x$; close with a bold answer line. For plain Euler write one line per step: $x_n$, $y_n$, $f$, $y_{n+1}$.
Asked: [7 marks] (May 2019, Jun 2020, Jun 2023) Using modified Euler's method find $y$ at $x=0.3$ given $\frac{dy}{dx}=x+y$, $y(0)=1$; also $h=0.2$, compute $y(1)$. Asked: [7 marks] (Jun 2020) Solve $\frac{dy}{dx}=x+y$ at $x=0.3$ with modified Euler's method, $y(0)=1$, $h=0.1$. Asked: [7 marks] (Nov 2022) Find $y(4.2)$ by Euler's modified method with $h=0.1$ from $\frac{dy}{dx}=\frac{2-y}{4x}$, $y=1$ at $x=4$. Asked: [7 marks] (Nov 2022) Use Euler's method for $\frac{dy}{dx}=\frac{y^2-x}{y^2+x}$, $x=0$, $y=1$; compute $y(0.1)$, $y(0.2)$. Asked: [7 marks] (Nov 2022) Use Euler's modified method for $\frac{dy}{dx}=x+\sqrt y$, $y(2)=4$, $h=0.2$; compute $y(2.4)$. Asked: [7 marks] (Jun 2023) Use Euler's method to compute the solution of $\frac{dy}{dx}=y^2-x^2$, $y(0)=1$ at $x=0.1$.
Runge-Kutta method of fourth order
<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. The Runge-Kutta method of fourth order (RK4) finds $y_{n+1}$ from $y_n$ using a weighted average of four slope estimates taken inside the step, without any derivatives of $f$.
Formula. $$k_1=hf(x_n,y_n),\quad k_2=hf\left(x_n+\tfrac h2,y_n+\tfrac{k_1}2\right)$$ $$k_3=hf\left(x_n+\tfrac h2,y_n+\tfrac{k_2}2\right),\quad k_4=hf(x_n+h,y_n+k_3)$$ $$y_{n+1}=y_n+\tfrac16(k_1+2k_2+2k_3+k_4)$$
Key points.
- RK4 agrees with the Taylor series up to $h^4$, so its error per step is of order $h^5$.
- $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 of the step.
- The two midpoint slopes get weight 2 each, as in Simpson's rule, which gives the $\frac16$ average.
- It is self-starting, needing only $y_0$, and it is used to supply starting values for Milne and Adams methods.
- It needs four evaluations of $f$ per step, which is its cost.
- For $y''=g(x,y,z)$ put $z=y'$ and step $y$ and $z$ together with $k_i$ and $l_i$ as below.
Second order equation. $k_1=hz_n$, $l_1=hg(x_n,y_n,z_n)$; $k_2=h(z_n+\frac{l_1}2)$, $l_2=hg(x_n+\frac h2,y_n+\frac{k_1}2,z_n+\frac{l_1}2)$; $k_3=h(z_n+\frac{l_2}2)$, $l_3=hg(x_n+\frac h2,y_n+\frac{k_2}2,z_n+\frac{l_2}2)$; $k_4=h(z_n+l_3)$, $l_4=hg(x_n+h,y_n+k_3,z_n+l_3)$; then $y_{n+1}=y_n+\frac16(k_1+2k_2+2k_3+k_4)$, $z_{n+1}=z_n+\frac16(l_1+2l_2+2l_3+l_4)$.
Example. $y'=x+y$, $y(0)=1$, $h=0.1$, find $y(0.1)$, $y(0.2)$.
| Step | $k_1$ | $k_2$ | $k_3$ | $k_4$ | $y_{n+1}$ |
|---|---|---|---|---|---|
| $x_0=0,\ y_0=1$ | 0.1 | 0.11 | 0.1105 | 0.12105 | 1.11034 |
| $x_1=0.1,\ y_1=1.11034$ | 0.121034 | 0.132086 | 0.132638 | 0.144298 | 1.24281 |
Results: $y(0.1)=$ 1.1103, $y(0.2)=$ 1.2428.
Other papers ($h$ as stated, one step unless shown):
| Equation | Result |
|---|---|
| $y'=x^2-y$, $y(0)=1$, $h=0.1$ | $y(0.1)=$ 0.90516, $y(0.2)=$ 0.82127 |
| $10y'=x^2+y^2$, $y(0)=1$, $h=0.1$ | $k_i=0.01,\,0.010125,\,0.010127,\,0.010304$; $y(0.1)=$ 1.01014 |
| $y'=x^2+y^2$, $y(1)=1.2$, $h=0.05$ | $y(1.05)=$ 1.33256 |
| $y'=x^2+y$, $y(0)=-1$, $h=0.1$ | $y(0.1)=$ -1.10483 |
Second order paper. $xy''+y'+xy=0$ is Bessel's equation of order zero. Put $y=\sum a_nx^n$: the $x^0$ term gives $a_1=0$, and $a_n=-a_{n-2}/n^2$, so with $y(0)=1$ the series is $y=1-\frac{x^2}{4}+\frac{x^4}{64}-\frac{x^6}{2304}+\cdots$. It gives $y(0.5)=0.93847$, $y(1)=0.76520$, $y(1.5)=0.51183$.
Pitfall: As printed, $y'(0)=1$ is impossible for this equation, because $x=0$ forces $y'(0)=0$; state this and use $y'(0)=0$, since RK4 also cannot start at the singular point $x=0$.
==$y_{n+1}=y_n+\frac16(k_1+2k_2+2k_3+k_4)$, where $k_1,k_2,k_3,k_4$ are $h$ times the slope at the start, twice at the midpoint, and at the end.==
Answer frame. Open with $f(x,y)$, $x_0$, $y_0$, $h$ and the four $k$ formulas; compute $k_1$ to $k_4$ in a table; average and add to $y_0$; restart from the new $(x,y)$ for the next step; close with a bold answer line. For a second order equation write $z=y'$ first.
Asked: [7 marks] (Dec 2020, Jun 2020, Jun 2022, Nov 2022, Jun 2026) Use the Runge-Kutta method to approximate $y$ at $x=0.1$ and $0.2$ given $y=1$ at $x=0$ and $\frac{dy}{dx}=x+y$; also $y(1.05)$ from $\frac{dy}{dx}=x^2+y^2$, $y(1)=1.2$, $h=0.05$; also $y(0.1)$ from $\frac{dy}{dx}=x^2+y$, $y(0)=-1$. Asked: [7 marks] (Dec 2020) Solve $y'=x^2-y$, $y(0)=1$ at $x=0.1,0.2$ by fourth-order Runge-Kutta. Asked: [7 marks] (Jun 2020) Apply Runge-Kutta to $10\frac{dy}{dx}=x^2+y^2$, $y(0)=1$ for $x=0.1$. Asked: [7 marks] (Jun 2022) Solve $xy''+y'+xy=0$, $y(0)=1$, $y'(0)=1$, for $x=0$ to $x=1.5$.
Milne's predictor-corrector methods
<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. Milne's method is a multistep predictor-corrector method that predicts $y_{n+1}$ from four earlier points and corrects it with Simpson's rule.
Formula. $$y_{n+1}^{p}=y_{n-3}+\frac{4h}{3}\left(2f_{n-2}-f_{n-1}+2f_n\right)$$ $$y_{n+1}^{c}=y_{n-1}+\frac h3\left(f_{n-1}+4f_n+f_{n+1}\right)$$
Key points.
- The predictor is an open formula and the corrector is Simpson's rule, and the corrector is repeated until $y^c_{n+1}$ stops changing.
- Four starting values $y_{n-3},\dots,y_n$ are required, found by Taylor, Picard or Runge-Kutta.
- Only one new value of $f$ is needed per correction, so it is cheaper than RK4 per step.
- It is not self-starting, and it can become unstable for some equations.
Example. $y'=x+y$, $y(0)=1$, $h=0.1$, find $y(0.3)$. RK4 starting values: $y(-0.1)=0.909675$, $y(0)=1$, $y(0.1)=1.110342$, $y(0.2)=1.242805$, so $f=0.809675,\ 1,\ 1.210342,\ 1.442805$.
Predictor: $y^p(0.3)=0.909675+\frac{0.4}{3}(2(1)-1.210342+2(1.442805))=$ 1.39971. Corrector: $f(0.3,1.39971)=1.69971$, so $y^c=1.110342+\frac{0.1}3(1.210342+4(1.442805)+1.69971)=$ 1.39972, unchanged on repeating: $y(0.3)=$ 1.3997.
==Milne's predictor $y_{n+1}=y_{n-3}+\frac{4h}3(2f_{n-2}-f_{n-1}+2f_n)$ is corrected by Simpson's rule $y_{n+1}=y_{n-1}+\frac h3(f_{n-1}+4f_n+f_{n+1})$.==
Answer frame. Open with both formulas; list the four starting values and their $f$ in a table; compute the predictor, then the corrector until it repeats; close with the bold value.
Asked: [7 marks] (Jun 2022, Jun 2026) Use Milne's method to solve $\frac{dy}{dx}=x+y$, $y(0)=1$, from $x=0.20$ to $x=0.30$.
Adams' predictor-corrector methods
<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 are multistep formulas that use four earlier slopes.
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.
- Four starting values are needed, taken from Runge-Kutta.
- The corrector is repeated until it converges.
- Both formulas are of fourth order, error of order $h^5$.
Partial differential equations: finite difference solution of the 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 by replacing the derivatives with central differences on a square grid of side $h$.
Formula. $$u_{i,j}=\tfrac14\left(u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}\right)$$
<figure class="ds-fig" style="margin:1.4rem 0;overflow-x:auto"><svg xmlns="http://www.w3.org/2000/svg" id="dsfig-u3-01" viewBox="0 0 252 252" width="252" height="252" role="img" aria-label="Five-point stencil, centre C is the average of N, S, E, W"><style>#dsfig-u3-01 .e{stroke:#454C5A;stroke-width:1.4;fill:none}#dsfig-u3-01 .e.hi{stroke:#2340B8;stroke-width:2.6}#dsfig-u3-01 .n{fill:#FFFFFF;stroke:#16181D;stroke-width:1.4}#dsfig-u3-01 .n.hi{fill:#E3E9FC;stroke:#2340B8;stroke-width:2.2}#dsfig-u3-01 .n.rb-b{fill:#16181D;stroke:#16181D}#dsfig-u3-01 .n.rb-r{fill:#BD3227;stroke:#BD3227}#dsfig-u3-01 text{font-family:"JetBrains Mono",ui-monospace,Menlo,Consolas,monospace;font-size:13px}#dsfig-u3-01 .t{fill:#16181D;font-weight:500}#dsfig-u3-01 .t.inv{fill:#FFFFFF;font-weight:700}#dsfig-u3-01 .kd{stroke:#16181D;stroke-width:1.2}#dsfig-u3-01 .dot{fill:#16181D}#dsfig-u3-01 .ann{fill:#2340B8;font-size:11px;font-weight:700}#dsfig-u3-01 .lbl{fill:#6F7787;font-family:system-ui,-apple-system,sans-serif;font-size:12px;font-weight:700}#dsfig-u3-01 .ptr{fill:#2340B8;font-size:12px;font-weight:700}#dsfig-u3-01 .ah{fill:#454C5A}#dsfig-u3-01 .ah.hi{fill:#2340B8}#dsfig-u3-01 .wl rect{fill:#FFFFFF;stroke:#DCE0E7}#dsfig-u3-01 .wl .t{font-size:12px;font-weight:700}#dsfig-u3-01 .wl.hi rect{fill:#2340B8;stroke:#2340B8}#dsfig-u3-01 .wl.hi .t{fill:#FFFFFF}html.dark #dsfig-u3-01 .e{stroke:#B1B7C3}html.dark #dsfig-u3-01 .e.hi{stroke:#8FA3FF}html.dark #dsfig-u3-01 .n{fill:#161920;stroke:#E6E8ED}html.dark #dsfig-u3-01 .n.hi{fill:#1E2748;stroke:#8FA3FF}html.dark #dsfig-u3-01 .n.rb-b{fill:#E6E8ED;stroke:#E6E8ED}html.dark #dsfig-u3-01 .n.rb-r{fill:#FF7E71;stroke:#FF7E71}html.dark #dsfig-u3-01 .t{fill:#E6E8ED}html.dark #dsfig-u3-01 .t.inv{fill:#0F1115}html.dark #dsfig-u3-01 .kd{stroke:#E6E8ED}html.dark #dsfig-u3-01 .dot{fill:#E6E8ED}html.dark #dsfig-u3-01 .ann{fill:#8FA3FF}html.dark #dsfig-u3-01 .lbl{fill:#858D9C}html.dark #dsfig-u3-01 .ptr{fill:#8FA3FF}html.dark #dsfig-u3-01 .ah{fill:#B1B7C3}html.dark #dsfig-u3-01 .ah.hi{fill:#8FA3FF}html.dark #dsfig-u3-01 .wl rect{fill:#161920;stroke:#2A2E37}html.dark #dsfig-u3-01 .wl.hi rect{fill:#8FA3FF;stroke:#8FA3FF}html.dark #dsfig-u3-01 .wl.hi .t{fill:#0F1115}</style><defs><marker id="ah1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah" d="M0,1 L9,5 L0,9 z"/></marker><marker id="ahh1" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse"><path class="ah hi" d="M0,1 L9,5 L0,9 z"/></marker></defs><path class="e" d="M126,107 L126,59"/><path class="e" d="M126,145 L126,193"/><path class="e" d="M145,126 L193,126"/><path class="e" d="M107,126 L59,126"/><circle class="n" cx="126" cy="126" r="18"/><text class="t" x="126" y="126" dy=".35em" text-anchor="middle">C</text><circle class="n" cx="126" cy="40" r="18"/><text class="t" x="126" y="40" dy=".35em" text-anchor="middle">N</text><circle class="n" cx="126" cy="212" r="18"/><text class="t" x="126" y="212" dy=".35em" text-anchor="middle">S</text><circle class="n" cx="212" cy="126" r="18"/><text class="t" x="212" y="126" dy=".35em" text-anchor="middle">E</text><circle class="n" cx="40" cy="126" r="18"/><text class="t" x="40" y="126" dy=".35em" text-anchor="middle">W</text></svg><figcaption style="font-size:.82em;opacity:.72;margin-top:.45rem">Five-point stencil, centre C is the average of N, S, E, W</figcaption></figure>
Key points.
- Each interior value is the average of its four neighbours, and boundary values are given.
- The unknowns are found by solving the linear system, or by Liebmann's iteration starting from a guess.
- The diagonal formula $u=\frac14(\text{four diagonal neighbours})$ gives a first guess.
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">Low weight</span>
Definition. Poisson's equation $\nabla^2u=f(x,y)$ is Laplace's equation with a source term, with the same five-point formula.
Formula. $$u_{i+1,j}+u_{i-1,j}+u_{i,j+1}+u_{i,j-1}-4u_{i,j}=h^2f(x_i,y_j)$$
Key points.
- The right side is $h^2f$ at the node, so the mesh needs $f$ at every interior point.
- Each interior node gives one linear equation, and boundary values move to the right side.
- For $h=\frac13$ there are four interior nodes $u_1,u_2$ (bottom, $y=\frac13$) and $u_3,u_4$ (top, $y=\frac23$).
Example. $\nabla^2u=-81xy$, $h=\frac13$, so $h^2f=-9xy$, with $u=0$ on $x=0,y=0$ and $u=100$ on $x=1,y=1$.
| Node | Equation |
|---|---|
| $u_1$ at $(\frac13,\frac13)$ | $4u_1-u_2-u_3=1$ |
| $u_2$ at $(\frac23,\frac13)$ | $4u_2-u_1-u_4=102$ |
| $u_3$ at $(\frac13,\frac23)$ | $4u_3-u_1-u_4=102$ |
| $u_4$ at $(\frac23,\frac23)$ | $4u_4-u_2-u_3=204$ |
By symmetry $u_2=u_3$, so $u_1=25.79$, $u_2=u_3=51.08$, $u_4=76.54$: $u_1=25.79,\ u_2=u_3=51.08,\ u_4=76.54$.
Asked: [7 marks] (Jun 2026) Solve $\nabla^2u=-81xy$, $0<x,y<1$, $h=\frac13$, with $u(0,y)=u(x,0)=0$, $u(1,y)=u(x,1)=100$.
Implicit and explicit methods for the one dimensional heat equation (Bender-Schmidt and Crank-Nicholson)
<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 heat equation $u_t=c^2u_{xx}$ is solved on a grid with step $h$ in $x$ and $k$ in $t$, with $\lambda=\frac{c^2k}{h^2}$.
Formula. $$u_{i,j+1}=\lambda u_{i-1,j}+(1-2\lambda)u_{i,j}+\lambda u_{i+1,j}\quad\text{(explicit)}$$
Key points.
- The explicit method is stable only for $\lambda\le\frac12$, and Bender-Schmidt takes $\lambda=\frac12$: $u_{i,j+1}=\frac12(u_{i-1,j}+u_{i+1,j})$.
- The implicit Crank-Nicholson method is stable for every $\lambda$ but needs a linear system at each time level.
- The explicit method gives each new value directly, so it is simpler.
Crank-Nicholson methods
<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. Crank-Nicholson averages the space differences at levels $j$ and $j+1$, giving a tridiagonal system for each new time level.
Formula. $$-\lambda u_{i-1,j+1}+2(1+\lambda)u_{i,j+1}-\lambda u_{i+1,j+1}=\lambda u_{i-1,j}+2(1-\lambda)u_{i,j}+\lambda u_{i+1,j}$$
Key points.
- It is of second order in $h$ and $k$ and is stable for all $\lambda$.
- The paper gives $h=1$ but no $k$, so choose $\lambda=1$ ($k=1$), which turns the formula into $-u_{i-1,j+1}+4u_{i,j+1}-u_{i+1,j+1}=u_{i-1,j}+u_{i+1,j}$.
- Boundary values are added to the right side of the first and last equations at both levels.
Example. $u_t=u_{xx}$, $h=1$, $u(x,0)=20$, $u(0,t)=0$, $u(5,t)=100$, nodes $x=1,2,3,4$. Level 1: $4u_1-u_2=20$, $-u_1+4u_2-u_3=40$, $-u_2+4u_3-u_4=40$, $-u_3+4u_4=220$, giving $u=(10.05,\ 20.19,\ 30.72,\ 62.68)$. Level 2 uses these as the right side: $u=(11.03,\ 23.91,\ 43.86,\ 68.64)$.
Asked: [7 marks] (Jun 2026) Solve $\frac{\partial u}{\partial t}=\frac{\partial^2u}{\partial x^2}$ in $0<x<5$ by Crank-Nicholson, $u(x,0)=20$, $u(0,t)=0$, $u(5,t)=100$, $h=1$.
Finite difference explicit method for the 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. The wave equation $u_{tt}=c^2u_{xx}$ is solved by central differences in both $x$ and $t$, with $r=\frac{ck}{h}$.
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.
- The scheme is stable for $r\le1$, and $r=1$ reduces it to $u_{i,j+1}=u_{i+1,j}+u_{i-1,j}-u_{i,j-1}$.
- The first level comes from $u_t(x,0)=0$: $u_{i,1}=\frac12(u_{i+1,0}+u_{i-1,0})$ when $r=1$.
Last-minute revision
- Euler: $y_{n+1}=y_n+hf(x_n,y_n)$; modified Euler corrects with $\frac h2[f_n+f_{n+1}]$ until convergence.
- $y'=x+y$, $y(0)=1$: modified Euler $y(0.3)=1.4004$ ($h=0.1$), $y(1)=3.4548$ ($h=0.2$).
- RK4: $y_{n+1}=y_n+\frac16(k_1+2k_2+2k_3+k_4)$; $y'=x+y$ gives $y(0.1)=1.1103$, $y(0.2)=1.2428$.
- Taylor: $y(x_0+h)=y_0+hy_0'+\frac{h^2}2y_0''+\cdots$; $y'=x^2y-1$ gives $y(0.1)=0.90031$.
- Picard: $y_{n+1}=y_0+\int f(x,y_n)dx$; $y'=1+xy$ gives 1.105, 1.223, 1.355.
- Milne predictor $y_{n-3}+\frac{4h}3(2f_{n-2}-f_{n-1}+2f_n)$, corrector is Simpson; $y'=x+y$ gives $y(0.3)=1.3997$.
- Adams predictor uses $55,-59,37,-9$ over 24; corrector $9,19,-5,1$ over 24.
- Laplace: $u_{i,j}$ is the average of four neighbours; Poisson: neighbours $-4u=h^2f$.
- Poisson paper: $u_1=25.79$, $u_2=u_3=51.08$, $u_4=76.54$.
- Heat explicit stable for $\lambda\le\frac12$; Crank-Nicholson stable for all $\lambda$, tridiagonal system.
- Wave explicit stable for $r=\frac{ck}h\le1$.
Memory hooks
- Euler = tangent step; modified Euler = tangent, then average the two slopes.
- RK4 weights $1,2,2,1$ over 6, like Simpson's rule.
- Milne: 4 old points, Simpson corrects; Adams: 55, 59, 37, 9 then 9, 19, 5, 1.
- Poisson is Laplace with a source: $h^2f$ on the right.
- Explicit needs $\lambda\le\frac12$, Crank-Nicholson has no limit.
Coverage checklist
- Ordinary differential equations: Taylor's series: Dec 2020 and Jun 2022 ($y'=x^2y-1$), Dec 2020 ($xy'=x-y$), Picard May 2019.
- Euler and modified Euler's methods: modified Euler ($x+y$, $\frac{2-y}{4x}$, $x+\sqrt y$), Euler ($\frac{y^2-x}{y^2+x}$, $y^2-x^2$).
- Runge-Kutta method of fourth order for solving first and second order equations: five first-order papers and $xy''+y'+xy=0$.
- Milne's predicator-corrector methods: Jun 2022, Jun 2026.
- Adam's predicator-corrector methods: formulas only, unasked.
- Partial differential equations: Finite difference solution two dimensional Laplace equation: formula only, unasked.
- Poission equation: Jun 2026.
- Implicit and explicit methods for one dimensional heat equation (Bender-Schmidt and Crank-Nicholson methods): formulas only, unasked.
- Crank-Nicholson methods: Jun 2026.
- Finite difference explicit method for wave equation: formula only, unasked.