Study the Newton-Raphson method, an iterative numerical approach to efficiently approximate roots of real-valued functions.
The Newton-Raphson method, or tangent method, computes successive approximations of a root of $f(x) = 0$ by replacing the function with its tangent. When it works, it converges very quickly and the number of correct digits doubles at each step [1].
Given an initial point $x_0$, $x_{n+1} = x_n - \dfrac{f(x_n)}{f'(x_n)}$ is calculated. Geometrically, $x_{n+1}$ is the intersection with the $x$ axis of the tangent to the graph at $x_n$. The method requires the derivative (see the lines on derivatives) [1][2].
For $f(x) = x^2 - 2$ the formula becomes $x_{n+1} = \dfrac{1}{2}\left(x_n + \dfrac{2}{x_n}\right)$. With $x_0 = 1$ (assumed values):
- $x_1 = 1.5$ (error $\approx 8.6 \cdot 10^{-2}$)
- $x_2 = 1.41667$ (error $\approx 2.5 \cdot 10^{-3}$)
- $x_3 = 1.414215686$ (error $\approx 2.1 \cdot 10^{-6}$)
- $x_4 = 1.41421356237$ (error $\approx 1.6 \cdot 10^{-12}$)
The error goes from $10^{-3}$ to $10^{-6}$ to $10^{-12}$: each step roughly squares the error (calculation). With bisection, about $20$ steps would be needed for $10^{-6}$ (see the line on bisection).
If $f'(\alpha) \neq 0$ at the root $\alpha$ and $x_0$ is close enough, convergence is quadratic: $|e_{n+1}| \approx C|e_n|^2$, with $C = \left|\dfrac{f''(\alpha)}{2f'(\alpha)}\right|$. For a multiple root convergence becomes linear.
- If $f'(x_n) = 0$ the tangent is horizontal and the step is undefined.
- A distant initial point can lead to divergence or cycles.
- It can converge to a root different from the intended one.
For this reason, bisection is often used to locate the root and Newton to refine it.
Calculation of roots and inverse functions, optimization (the method seeks zeros of the derivative), and solving nonlinear systems, where the Jacobian matrix is used (general remark).
It requires the derivative, which can be costly or unavailable; in that case, the secant method is used. It does not guarantee global convergence: a good initial estimate is needed. See the line on numerical methods for the overall picture.
[1] Wikipedia (it): Metodo delle tangenti
[2] Wikipedia (en): Newton's method
Generating summary…