The Newton-Raphson method is the most powerful root-finder in the course. It uses calculus: near a root, a curve looks almost like its tangent, and a tangent is a straight line whose $x$-intercept is easy to find. So we replace the curve by its tangent, see where the tangent crosses the axis, and repeat.
Show that the tangent to $y = \mathrm{f}(x)$ at $x = x_n$ meets the $x$-axis at $x_n - \dfrac{\mathrm{f}(x_n)}{\mathrm{f}'(x_n)}$.
Ans, e.g. for $\mathrm{f}(x) = x^3 - 2x - 5$:Ans β (AnsΒ³ β 2Ans β 5) Γ· (3AnsΒ² β 2) and press = repeatedly.
$\mathrm{f}(x) = x^3 - 2x - 5$. Taking $x_0 = 2$, use the Newton-Raphson method to find the root to $5$ decimal places.
Use the Newton-Raphson method on $\mathrm{f}(x) = x^2 - 2$ with $x_0 = 1$ to approximate $\sqrt2$.
The equation $\mathrm{e}^x = 3x$ has two roots. Use the Newton-Raphson method to find each to $4$ d.p., using $x_0 = 0$ and $x_0 = 1.5$.
Use the Newton-Raphson method with $x_0 = 1.5$ to solve $\ln x + x = 2$, giving the root to $4$ d.p., and verify your answer.
The formula divides by $\mathrm{f}'(x_n)$. Trouble comes whenever that gradient is zero or small β that is, when $x_n$ is at or near a stationary point.
| Problem | What happens |
|---|---|
| $\mathrm{f}'(x_0) = 0$ | The tangent is horizontal and never meets the $x$-axis. The formula needs division by zero. |
| $\mathrm{f}'(x_0)$ close to $0$ | The tangent is nearly flat, so $x_1$ is thrown a long way off β perhaps to a different root, or outside the domain. |
| Bad starting value | The iterates can oscillate in a cycle or diverge. |
| Domain issues | An iterate may land where $\mathrm{f}$ is undefined, e.g. a negative number in $\ln x$. |
$\mathrm{f}(x) = x^3 - 3x + 1$ has roots near $-1.88$, $0.35$ and $1.53$. Explain what happens when the Newton-Raphson method is used with (a) $x_0 = 1$ (b) $x_0 = 0.95$.
Apply the Newton-Raphson method to $\mathrm{f}(x) = x^3 - 2x + 2$ with $x_0 = 0$.
Formula
$x_{n+1} = x_n - \dfrac{\mathrm{f}(x_n)}{\mathrm{f}'(x_n)}$
Geometry
$x_{n+1}$ is where the tangent at $x_n$ meets the $x$-axis.
Set up
Write $\mathrm{f}(x) = 0$, differentiate, then substitute.
Speed
Correct digits roughly double each step near the root.
$\mathrm{f}'(x_0) = 0$
Horizontal tangent β the method fails.
$\mathrm{f}'(x_0) \approx 0$
$x_1$ is thrown far away, maybe to another root.
Radians
Essential when $\mathrm{f}$ involves trigonometry.
Confirm
Check the final answer with a change of sign.
Use the Newton-Raphson method on $\mathrm{f}(x) = x^2 - 7$ with $x_0 = 3$ to find $x_1$ and $x_2$, and compare with $\sqrt7$.
βΆ Show solution
$\mathrm{f}'(x) = 2x$. $x_1 = 3 - \dfrac{2}{6} = 2.6667$ (4 d.p.).
$x_2 = 2.6667 - \dfrac{2.6667^2 - 7}{2 \times 2.6667} = 2.6458$ (4 d.p.; exactly $\tfrac{127}{48}$).
$\sqrt7 = 2.64575\ldots$, so $x_2$ is correct to $3$ d.p. already.
$\mathrm{f}(x) = x^3 - 5x + 1$. Use the Newton-Raphson method with $x_0 = 2$ to find the root near $2$ correct to $4$ decimal places.
βΆ Show solution
$\mathrm{f}'(x) = 3x^2 - 5$.
$x_1 = 2 - \dfrac{-1}{7} = 2.142857\ldots$
$x_2 = 2.128571\ldots$, $x_3 = 2.128419\ldots$, $x_4 = 2.128419\ldots$
Root $= 2.1284$ to $4$ d.p.
Solve $x = \cos x$ using the Newton-Raphson method with $x_0 = 1$, giving the root to $3$ decimal places.
βΆ Show solution
$\mathrm{f}(x) = x - \cos x$, $\mathrm{f}'(x) = 1 + \sin x$ (radians).
$x_1 = 1 - \dfrac{1 - \cos 1}{1 + \sin 1} = 0.75036\ldots$
$x_2 = 0.73911\ldots$, $x_3 = 0.73909\ldots$
Root $= 0.739$ to $3$ d.p. (Check: $\mathrm{f}(0.7385) = -0.00098 < 0$, $\mathrm{f}(0.7395) = 0.00069 > 0$.)
Compare Question 5 on the Iteration page: $x_{n+1} = \cos x_n$ needs more than ten steps for the same accuracy.
Show that applying the Newton-Raphson method to $\mathrm{f}(x) = x^2 - a$ (with $a > 0$) gives $x_{n+1} = \dfrac12\left(x_n + \dfrac{a}{x_n}\right)$. Use it with $a = 10$ and $x_0 = 3$ to find $x_2$.
βΆ Show solution
$x_{n+1} = x_n - \dfrac{x_n^2 - a}{2x_n} = \dfrac{2x_n^2 - x_n^2 + a}{2x_n} = \dfrac{x_n^2 + a}{2x_n} = \dfrac12\left(x_n + \dfrac{a}{x_n}\right)$.
$x_1 = \tfrac12(3 + \tfrac{10}{3}) = 3.16667$, $x_2 = \tfrac12(3.16667 + \tfrac{10}{3.16667}) = 3.16228$.
($\sqrt{10} = 3.162277\ldots$)
Use the Newton-Raphson method with $x_0 = 0$ to find the smaller root of $\mathrm{e}^x = 3x$ to $3$ d.p.
βΆ Show solution
$\mathrm{f}(x) = \mathrm{e}^x - 3x$, $\mathrm{f}'(x) = \mathrm{e}^x - 3$.
$x_1 = 0.5$, $x_2 = 0.6101$, $x_3 = 0.6190$, $x_4 = 0.6191$.
Root $= 0.619$ to $3$ d.p.
$\mathrm{f}(x) = \ln x + x - 3$. (a) Use the Newton-Raphson method with $x_0 = 2$ to find $x_1$ and $x_2$. (b) Show that the root is $2.208$ to $3$ d.p.
βΆ Show solution
(a) $\mathrm{f}'(x) = \dfrac1x + 1$. $x_1 = 2 - \dfrac{\ln 2 - 1}{1.5} = 2.20457\ldots$, $x_2 = 2.20794\ldots$
(b) $\mathrm{f}(2.2075) = -0.000639\ldots < 0$ and $\mathrm{f}(2.2085) = 0.000814\ldots > 0$. Change of sign, $\mathrm{f}$ continuous for $x > 0$, so the root is $2.208$ to $3$ d.p.
Explain why the Newton-Raphson method cannot be used to solve $x^3 - 3x + 1 = 0$ with starting value $x_0 = -1$.
βΆ Show solution
$\mathrm{f}'(x) = 3x^2 - 3$, so $\mathrm{f}'(-1) = 0$. There is a stationary point (a maximum) at $x = -1$, the tangent there is horizontal and never meets the $x$-axis, and the formula would require division by zero.
Show that the Newton-Raphson method applied to $\mathrm{f}(x) = x^3 - 2x + 2$ with $x_0 = 1$ produces a repeating sequence, and suggest a better starting value.
βΆ Show solution
$\mathrm{f}'(x) = 3x^2 - 2$. $x_1 = 1 - \dfrac{1}{1} = 0$, then $x_2 = 0 - \dfrac{2}{-2} = 1$, and so on: $1, 0, 1, 0, \ldots$
$\mathrm{f}(-2) = -2$ and $\mathrm{f}(-1) = 3$, so there is a root with $-2 < x < -1$; starting at $x_0 = -2$ gives $-1.8,\ -1.7699,\ -1.7693, \ldots$ which converges.
By drawing a sketch, explain why the Newton-Raphson method applied to $\mathrm{f}(x) = x^3 - 3x + 1$ with $x_0 = 0.95$ does not converge to the root near $0.35$.
βΆ Show solution
The curve has a minimum at $x = 1$, so at $x = 0.95$ the gradient is small: $\mathrm{f}'(0.95) = -0.2925$.
The tangent there is almost horizontal and meets the $x$-axis far away, at $x_1 = -2.44$. From there the iterations converge to the root near $-1.88$ (see the diagram in Section 4). Starting at $x_0 = 0.5$ instead gives $0.3333,\ 0.3472,\ 0.3473$, the root required.
An open box is made from a $20$ cm by $20$ cm square of card by cutting a square of side $x$ cm from each corner and folding up the sides. The volume must be $500$ cm$^3$.
(a) Show that $x^3 - 20x^2 + 100x - 125 = 0$.
(b) Verify that $x = 5$ is a root.
(c) Use the Newton-Raphson method with $x_0 = 1.5$ to find the other possible value of $x$ to $3$ d.p.
(d) Explain why $x_0 = \tfrac{10}{3}$ would be a bad starting value, and interpret $x = \tfrac{10}{3}$ in context.
βΆ Show solution
(a) The base is $(20 - 2x)$ by $(20 - 2x)$ and the height $x$: $V = x(20 - 2x)^2 = 4x^3 - 80x^2 + 400x$. Setting $V = 500$ and dividing by $4$: $x^3 - 20x^2 + 100x - 125 = 0$.
(b) $125 - 500 + 500 - 125 = 0$ β
(c) $\mathrm{f}'(x) = 3x^2 - 40x + 100$.
$x_1 = 1.5 - \dfrac{\mathrm{f}(1.5)}{\mathrm{f}'(1.5)} = 1.5 - \dfrac{-16.625}{46.75} = 1.85561\ldots$
$x_2 = 1.90866\ldots$, $x_3 = 1.90983\ldots$, $x_4 = 1.90983\ldots$
$x = 1.910$ cm to $3$ d.p. (In fact $x = \tfrac{15 - 5\sqrt5}{2}$ exactly, from the quadratic factor $x^2 - 15x + 25$.)
(d) $\mathrm{f}'\!\left(\tfrac{10}{3}\right) = \tfrac{100}{3} - \tfrac{400}{3} + 100 = 0$, so the formula would divide by zero. Starting close to it fails too: $x_0 = 3.3$ gives $x_1 \approx -31.2$, a meaningless negative length.
In context, $x = \tfrac{10}{3}$ is the stationary point of the volume: it gives the maximum possible volume, $\tfrac{16000}{27} \approx 593$ cm$^3$.