Let us understand first Theory to the problem and it is basic application of derivatives.
our problem is to find the square root of a real number R.
So,
$\large x=\sqrt{R}$
$\large x^{2}={R}$
$\large x^{2}-{R}=0$
say , $\large f(x)=x^{2}-{R}$
so we need to find the solution when f(x)=0.
Idea:-
let’s see the idea through the graph.
Lets assume a point $\large x_{0}$ is the required solution of our equation $\large x^{2}-{R}=0$.
$\large x_{N}$ is the desired point which is square root of R.
(say for practical purpose if you want to find the square root of 5 you will choose $\large x_{0}$=2 as we know it is the closest assumption to square root of 5).
now the corresponding y co-ordinate is $\large x_{0}^{2}-R$.
Now we will draw a tangent on $\large \left ( x_{0},x_{0}^{2}-R \right )$ as we show in the diagram it will intersect the x axis at point $x_{1}$ .
Now if you observe carefully in the diagram the point $x_{1}$ is closer to the point $x_{N}$ than $x_{0}$.
Now if we again do the same analysis again by drawing a tangent from $\large \left ( x_{1},x_{1}^{2}-R \right )$ we will get $x_{2}$ which will be more closer to $x_{N}$ than $x_{1}$.
This is the crux of this method if we do this procedure 4-5 times we will get an accurate answer .
But this geometric procedure is not feasible to write a program for this problem so we have to derive some mathematical formula .
now we know ,
the equation of the tangent is,
$\large (y-y_{0})=m(x-x_{0})$
m=slope of the tangent=derivative of the function
$\large m=f'(x)=2x$
we will put y=0 in the equation as the tangent will intersect with x axis and that point y=0.
$\large -y_{0}=2x_{0}(x-x_{0})$ [as we will draw tangent at ($x_{0},y_{0}$) that point slope=2$x_{0}$]
$\large x=x_{0}-\frac{y_{0}}{2x_{0}}$
$\large x=x_{0}-\frac{x_{0}^{2}-R}{2x_{0}}$ [as $\large y_{0}=x_{0}^{2}-R$]
$\large x=\frac{x_{0}}{2}+\frac{R}{2x_{0}}$
so we got x1 by this equation.
The formula looks like ,
$\large x_{i+1}=\frac{x_{i}}{2}+\frac{R}{2x_{i}}$
correct answer is C.
useful links:-
- https://ocw.mit.edu/courses/18-01-single-variable-calculus-fall-2006/fb8c24f09aba8413984f8ce5961586bd_lec13.pdf
- https://ocw.mit.edu/courses/18-01-single-variable-calculus-fall-2006/resources/lecture-13-newtons-method/