Mathematics/Lessons/Numerical Methods/Modelling with Numerical Methods
Pure · Numerical Methods · Year 2

Modelling with Numerical Methods

Real situations rarely hand you a solvable equation — locate a root, choose a method, and refine your way to the answer instead.

11 min read 3 worked examples

Why modelling produces equations you can't solve directly

Real models rarely stay tidy. Mix a linear term with an exponential, or a polynomial with a trig function, and you get an equation with no algebraic method for isolating $x$ — no amount of rearranging, factorising or use of the quadratic formula will do it. Even equations that could in principle be solved exactly, like an awkward cubic, are often faster to handle numerically once they're embedded in a real context with a domain, units, and a specific accuracy required. This is exactly where the three numerical techniques from this topic — locating roots by sign change, iteration, and Newton–Raphson — earn their keep.

Choosing a method

A typical modelling question doesn't tell you which method to use — that's part of what's being tested. Each method has a different job:

Sign change, iteration, or Newton–Raphson?

Change of sign is the safest way to confirm a root exists in an interval and to get a rough starting estimate, but repeated bisection to refine it is slow and rarely used for high accuracy on its own.

Fixed-point iteration ($x_{n+1}=g(x_n)$) is simple to set up once you have a rearrangement, but convergence depends entirely on $|g'(x)|<1$ near the root — the wrong rearrangement, or one where $|g'(x)|$ is close to $1$, converges slowly or not at all.

Newton–Raphson converges fastest of the three when it works, but needs $f'(x)$ to be found and evaluated, and fails or behaves badly if the starting value is near a turning point.

In practice, modelling questions often combine two of these: use a sign change to locate a root and choose a sensible starting value, then use iteration or Newton–Raphson to refine it to the accuracy the context demands.

Interpreting the answer in context

A model's equation often has more roots than the situation actually allows. Once you've found a root numerically, check it against the model's domain (a negative time, length or population is rarely valid) and round it to a precision that suits the context — money to the nearest penny, time to a sensible number of decimal places, and so on. A mathematically valid root that falls outside the model's domain isn't a valid answer to the question.

Worked example 1

Locating a root, then refining it by iteration
A start-up's monthly profit, in £ thousands, from producing $x$ thousand units is modelled by $P(x)=-x^3+9x^2-15x-2$ for $0\le x\le8$. The company wants the largest production level at which it breaks even, i.e. the largest root of $P(x)=0$. (a) Show this root lies between $x=6$ and $x=7$. (b) Show $P(x)=0$ rearranges to $x=\sqrt[3]{9x^2-15x-2}$. (c) Using $x_0=6$, find $x_1$, $x_2$ and $x_3$ to 4 decimal places.
MethodSign change to locate, then iterate to refine
1
$P(6)=-216+324-90-2=16$ and $P(7)=-343+441-105-2=-9$.
Evaluate P(x) at both ends of the interval.
2
$P(6)>0$ and $P(7)<0$ — a sign change, so (since $P$ is continuous) a root lies in $(6,7)$.
A sign change over a continuous function guarantees a root in between.
3
$P(x)=0 \Rightarrow -x^3+9x^2-15x-2=0 \Rightarrow x^3=9x^2-15x-2 \Rightarrow x=\sqrt[3]{9x^2-15x-2}$.
Multiply by −1, isolate x³, then take the cube root of both sides.
4
$x_1=\sqrt[3]{9(6)^2-15(6)-2}=\sqrt[3]{244}=6.2628$.
Substitute x₀ = 6 into the iteration g(x) = ³√(9x² − 15x − 2).
5
$x_2=\sqrt[3]{9(6.2628)^2-15(6.2628)-2}=\sqrt[3]{257.79}=6.3583$.
Substitute x₁ into g. (Working shown to fewer d.p. than stored.)
6
$x_3=\sqrt[3]{9(6.3583)^2-15(6.3583)-2}\approx6.4351$.
Substitute x₂ into g.
▪ solved
Slow but sure

The sequence $6, 6.2628, 6.3583, 6.4351,\dots$ is genuinely converging toward the breakeven point near $x\approx6.73$, but slowly — this rearrangement has $g'(x)\approx0.78$ near the root, close enough to $1$ that many more iterations would be needed to pin the answer down to 3 s.f. Fixed-point iteration is reliable here, just not fast.

Worked example 2

Refining a root with Newton–Raphson instead
A buoy bobs on the sea's surface; its height above mean sea level, in metres, $t$ seconds after release, is modelled by $s(t)=4\cos t-t+2$ for $0\le t\le5$. Find, correct to 3 decimal places, the first time after release at which the buoy passes back through mean sea level ($s(t)=0$), using the Newton–Raphson method with $t_0=2$.
MethodApply Newton–Raphson to s(t) = 0
1
$s'(t)=-4\sin t-1$.
Differentiate s(t).
2
$s(2)=4\cos(2)-2+2=-1.6646$. $s'(2)=-4\sin(2)-1=-4.6372$.
Evaluate s and s' at t₀ = 2 (radians).
3
$t_1=2-\dfrac{-1.6646}{-4.6372}=2-0.3590=1.6410$.
Apply the Newton–Raphson formula.
4
$s(1.6410)=0.0782$. $s'(1.6410)=-4.9901$.
Evaluate s and s' at t₁.
5
$t_2=1.6410-\dfrac{0.0782}{-4.9901}=1.6410+0.0157=1.6567$.
Apply the formula again.
6
A further iteration confirms convergence to $t\approx1.657$ (3 d.p.), well inside the domain $0\le t\le5$.
Successive iterates are stabilising to the required accuracy.
▪ solved
Why start at t = 2?

A quick check shows $s(1)\approx3.16>0$ and $s(2)\approx-1.66<0$, so a sign change locates the root between $t=1$ and $t=2$ before Newton–Raphson is even applied — exactly the "locate, then refine" strategy described earlier. Starting from $t_0=2$, close to the root and away from any turning point of $s$, is what makes the iteration converge in only two steps.

Worked example 3

Multiple roots and discarding invalid solutions
Challenge
A sheet of card measuring 20 cm by 12 cm is made into an open box by cutting squares of side $x$ cm from each corner and folding up the sides, where $0<x<6$. (a) Show the volume is $V(x)=x(20-2x)(12-2x)$ cm³, and that $V(x)=200$ rearranges to $4x^3-64x^2+240x-200=0$. (b) Show this equation has a root between $x=1$ and $x=2$. (c) Using $x_0=1$, apply Newton–Raphson twice to find this root correct to 3 decimal places.
MethodSet up, locate, then apply Newton–Raphson
1
Removing a square of side $x$ from each corner leaves a base $(20-2x)$ by $(12-2x)$, folded up to height $x$: $V(x)=x(20-2x)(12-2x)$.
Volume = length × width × height of the folded box.
2
Expanding: $V(x)=4x^3-64x^2+240x$. Setting $V(x)=200$: $4x^3-64x^2+240x-200=0$.
Expand the product, then set equal to the target volume and rearrange to = 0.
3
Let $f(x)=4x^3-64x^2+240x-200$. $f(1)=4-64+240-200=-20$, $f(2)=32-256+480-200=56$.
Evaluate f at the endpoints of the interval.
4
$f(1)<0$ and $f(2)>0$ — a sign change, so a root lies in $(1,2)$.
Continuity plus a sign change guarantees a root in between.
5
$f'(x)=12x^2-128x+240$. $f'(1)=124$. $x_1=1-\dfrac{-20}{124}=1.1613$.
Differentiate, then apply Newton–Raphson from x₀ = 1.
6
$f(1.1613)=-1.336$, $f'(1.1613)=107.54$. $x_2=1.1613-\dfrac{-1.336}{107.54}=1.1737$.
Apply the formula again. Root ≈ 1.174 (3 d.p.).
▪ solved
There's a second valid root — and it matters which one Newton–Raphson finds

The cubic $f(x)=0$ actually has three real roots: $x\approx1.174$, $x\approx3.898$, and $x\approx10.93$. The last is immediately discarded — it's outside the box's valid domain $0<x<6$ entirely. But $x\approx1.174$ and $x\approx3.898$ are both genuine solutions: two differently-proportioned boxes, cut from the same sheet, both hold exactly $200\text{ cm}^3$. Starting Newton–Raphson at $x_0=1$ (close to the smaller root) converges to $x\approx1.174$; starting instead at $x_0=4$ converges to $x\approx3.898$. The starting value doesn't just affect how fast the method converges — here it decides which valid answer you get, so a modelling question like this one usually needs you to state or justify which root is being reported.

Common mistake

Reporting a numerically correct root without checking it against the model's domain or physical meaning — for instance, keeping a negative length, a time before the process starts, or a root that lies outside the interval the model was actually built for. Always translate the numerical answer back into the language of the original problem before giving a final answer.

Check yourself

A firm's weekly revenue, in £ thousands, from selling $x$ thousand items is modelled by $R(x)=x^3-7x^2+4x+6$ for $0\le x\le7$. Show that $R(x)=0$ has a root between $x=1$ and $x=1.5$, then use Newton–Raphson with $x_0=1.4$ to find $x_1$ and $x_2$, correct to 3 decimal places.
(Hint: find R'(x) first, then apply the formula twice.)

Method
1
$R(1)=1-7+4+6=4$. $R(1.5)=3.375-15.75+6+6=-0.375$.
Evaluate R at the endpoints of the interval.
2
$R(1)>0$ and $R(1.5)<0$ — a sign change confirms a root in $(1,1.5)$.
Continuity plus a sign change guarantees a root in between.
3
$R'(x)=3x^2-14x+4$. $R(1.4)=0.624$, $R'(1.4)=-9.72$.
Differentiate, then evaluate R and R' at x₀ = 1.4.
4
$x_1=1.4-\dfrac{0.624}{-9.72}=1.4+0.0642=1.464$.
Apply the Newton–Raphson formula.
5
$R(1.464)\approx-0.078$, $R'(1.464)\approx-9.556$. $x_2=1.464-\dfrac{-0.078}{-9.556}=1.463$.
Apply the formula again. Root ≈ 1.463 (3 d.p.).
▪ solved