Using Newton's Method to Compute a Square Root

Calculators and computers use Newton's Method to compute square roots. On this slide, we'll see how to compute $\sqrt{2}$.

Finding the square root of 2 is the same thing as solving $x^2 - 2 = 0$. So we set $f(x)=x^2-2$, $f'(x)=2x$, and apply the recursive formula $$x_{n+1} = x_n - \frac{f(x_n)}{f'(x_n)} = x_n - \frac{x_n^2-2}{2x_n}.$$ It only takes a few steps to get 10 or 20 decimal places.



$x_n$ $x$ $f(x) = x^2-2$ $f'(x)=2x$ $x-\dfrac{f(x)}{f'(x)}$ 1.4142135623731
$x_1$ 1 -1 2 $1 - \tfrac{-1}{2} = 3/2$ $\underline{1}.5000000000000$
$x_2$ $\tfrac{3}{2}$ $\tfrac{1}{4}$ 3 $\tfrac{3}{2} - \tfrac{1/4}{3}=\tfrac{17}{2}$ $\underline{1.41}66666666667$
$x_3$ $\tfrac{17}{12}$ $\tfrac{1}{144}$ $\tfrac{17}{6}$ $\tfrac{17}{12} - \tfrac{1/144}{17/6} = \tfrac{577}{408}$ $\underline{1.41421}56862745$
$x_4$ $\tfrac{577}{408}$ $\tfrac{1}{166464}$ $\tfrac{577}{204}$ $\tfrac{665857}{470832}$ $\underline{1.41421356237}47$

(The computed value is correct up to the final underlined digit.)