Newton's method can be explained as an iterative method where
The equation of the tangent line of $f$ at the point $x_0$ is given by $$y = f'(x_0)(x-x_0)+f(x_0)$$
The zero of this line is $x_1$ and we obtain it by making $y=0,$ in the equation of the tangent line, which gives us the point where the line intersects the $OX$ axis.
$$0 = f'(x_0)(x_1-x_0)+f(x_0)$$If we solve this equation in $x_1$
$$-f(x_0)= f'(x_0)(x_1-x_0)\quad \Rightarrow\quad -\frac{f(x_0)}{f'(x_0)}=x_1 -x_0 $$and
$$x_1=x_0-\frac{f(x_0)}{f'(x_0)}$$Similarly, to obtain $x_2$
$$x_2=x_1-\frac{f(x_1)}{f'(x_1)}$$and so on.
- Given an initial guess $x_0$
- for $k=1,2,\ldots,\mathrm{MaxNumIter}$:
- Compute $x_k=x_{k-1}-\dfrac{f(x_{k-1})}{f'(x_{k-1})}$
- If $x_k$ meets the stopping condition, stop.
- Else, perform another iteration.
Approximate, using Newton’s method, $r=\sqrt{3}.$ Use as initial guess $x_{0}=1,$ give three iterations, and compute the residual. Use a calculator to estimate the absolute error of the approximation.
Our equation is
$$x=\sqrt{3} \quad \Rightarrow \quad x^2=3 \quad \Rightarrow \quad x^2-3=0$$Therefore $f(x)=x^2-3$ and $f'(x) = 2x$
The iteration function is given by the expression
$$x_{k+1} = x_k-\frac{f(x_k)}{f'(x_k)}$$In this case
$$x_{k+1} = x_k-\frac{x_k^2-3}{2x_k}=\frac{2x_k^2-x_k^2+3}{2x_k}=\frac{x_k^2+3}{2x_k}$$That is
$$x_{k+1} =\frac{x_k^2+3}{2x_k}$$As $\alpha= 1.732051$ the absolute error is
The value of the function at the root is zero. The value of the function in the approximation is called residual and, if it is a good approximation, it is a small
Also, the residual in step $k$ is known, while the error is unknown (we need the exact solution, which is what we are looking for).