# The Newton-Raphson Method

amath
The Newton-Raphson Method is an iterative algorithm for finding a zero of a function given the estimate of the zero. The method uses the derivative of the function and iterates the current value to find the next value using the formula:

x_(i+1)=x_(i)-f(x_i)/(f'(x_i))
Then, the absolute relative approximate error is found using:

$\epsilon_{abs}$=|(x_(i+1)-x_(i))/x_(i+1)|*100
If the absolute relative approximate error is less than the pre-specified relative error tolerance, the iteration stops and the last iterated value is returned as the zero closest to the estimate.
While the Newton-Raphson method is a powerful root-finding algorithm , it has some shortcomings the most obvious of which is when the derivative of a particular iterate in the process equals zero.

*The pre-specified relative error tolerance is taken as 0.00001 in my calculations.*

__Example 1:__

Let's find a zero of the function, f(x)=x^3-1, starting with a guess of 6.

Starting with an initial guess of 6, we get: x_(1)=x_(0)-f(x_0)/(f'(x_0))=6-215/108=4.00 bar(925)

The subsequent estimates are found as:

x_(2)=x_(1)-f(x_1)/(f'(x_1))$\approx$2.603577

x_(3)=x_(2)-f(x_2)/(f'(x_2))$\approx$1.841661

x_(4)=x_(3)-f(x_3)/(f'(x_3))$\approx$1.326053

x_(5)=x_(4)-f(x_4)/(f'(x_4))$\approx$1.073600

x_(6)=x_(5)-f(x_5)/(f'(x_5))$\approx$1.004930

x_(7)=x_(6)-f(x_6)/(f'(x_6))$\approx$1.000024

x_(8)=x_(7)-f(x_7)/(f'(x_7))$\approx$1.000000 leading us to the correct root, 1 , after eight iterations.

Click here for graphs captured from the Newton-Raphson algorithm in example 1.

#### The animation of the geometric process and algebraic values for example 1:

### Download the MATLAB file, newtonraphson.m that solved example 1 and test it with any function!

Click here for a short analysis of the method and more examples.
endamath