# Newtons method for approximating function

Newtons method for approximating function :
Let f(x) = 0, where f is differentiable in an open interval (a,b) containing 'x' and $x_{n}$ is an approximation solution and f '($x_{n}) \ne$ 0 then the next approximation is given by

$x_{n+1} = x_{n} - \frac{f(x_{n})}{f '(x_{n})}$

Where $x_{n+1}$ is the final approximation and $|x_{n} - x_{n+1}|$is within the accuracy limit.
Each successive application of this procedure is called an iteration.

If the function f(x) is linear then to find the roots, we make f(x) = 0.
If the function f(x) is quadratic then either make f(x) = 0 , find the factors of it and find the roots otherwise use the quadratic formula.
If the function f(x) is cubic then factor it or graph the given function and find the roots of the function.
But if the function is a polynomial of degree more than three or if the function is non-polynomial then in such cases we use Newtons method for approximating function.

## Examples on Newtons method for approximating function

Example 1: Use Newton's method for approximate a root of f(x) =$x^{3}$ -3x + 1 in the interval [1,2]. $x_{0}$= 2 , then find $x_{1},x_{2}$
Solution : f(x) =$x^{3}$ -3x + 1
f(2) = $2^{3}$ - 3(2) + 1 = 3
f '(x) = $3x^{2} -3 \Rightarrow f '(2) = 3(2)^{2} -3$ = 9
f(x) =$x^{3}$ -3x + 1 to find $x_{1},x_{2},x_{3}$ we will use the formula of Newton's method.

$x_{n+1} = x_{n} - \frac{f(x_{n})}{f '(x_{n})}$

Plug in n= 0
$x_{1} = x_{0} - \frac{f(x_{0})}{f '(x_{0})}$

= 2 - $\frac{3}{9}$

$x_{1} \approx$ 1.6666667

For $x_{2}$

f(x) =$x^{3}$ -3x + 1
f '(x) = $3x^{2}$ -3
f(1.66667) = $(1.6666667)^{3}$ -3(1.6666667) + 1 = 0.629629
f '(1.6666667) = $3(1.6666667)^{2}$ -3 = 5.3336667
$x_{n+1} = x_{n} - \frac{f(x_{n})}{f '(x_{n})}$

Plug in x= 1
$x_{2} = x_{1} - \frac{f(x_{1})}{f '(x_{1})}$

= 1.6666667 - $\frac{0.629629}{5.3336667}$

$x_{2}$ = 1.5486111

Example 2: Using Newton's method find the value of $\sqrt{5}$
Solution : x = $\sqrt{5}$
$x^{2}$ = 5
f(x) = $x^{2}$ - 5 = 0
x = $\pm \sqrt{5}$
$\sqrt{4} < \sqrt{5} < \sqrt{9}$
2 < $\sqrt{5}$ <3
Let $x_{0}$ = 2
f($x_{0}$) = 4 - 5 = -1
f(2) = -1
f(x) = $x^{2}$ - 5
f '(x) = 2x
f '(2) = 4
Using Newton's formula
$x_{n+1} = x_{n} - \frac{f(x_{n})}{f '(x_{n})}$

Plug in x = 0
$x_{1} = x_{0} - \frac{f(x_{0})}{f '(x_{0})}$

$x_{1} = 2 - \frac{-1}{4}$

$x_{1} = 2 + \frac{1}{4}$

$x_{1} \approx$ 2.25