Showing posts with label newton raphson algorithm. Show all posts
Showing posts with label newton raphson algorithm. Show all posts

About the Newton Raphson method


Consider the following equation:
Y = x^2 + 2x – 3
If you are asked to find the roots of that equation, it is a pretty simple process of factoring the equation and then using the zero product rule to solve for possible values of x.

Illustrated as follows:
Y = x^2 + 2x – 3
 = (x+3)(x-1)
For finding zeros, y = 0
So, (x+3)(x-1) = 0
Using the zero product rule,
(x+3) = 0 ; (x-1) = 0
Thus, x = -3 or x = 1. Therefore these are the two zeros of the given equation.

Now consider the following equation:
Y = 2x^2 + x+ 5
Since in this case the left hand side polynomial is prime, we can simply use the quadratic formula to find the real roots of this equation (if any).

But now suppose if the function is like this:
Y = 3x^5 + x^3 – 2x^2  - x + 7
There are no simple methods or formulae for finding the roots (or zeros) of such a function. This is where we use some method of approximation. One such method is the Newton – Raphson method named after the mathematicians  Issac Newton and Joseph Raphson who invented the method. The idea here is to start with some approximate zero of the function and then through iterative process come to closer and closer approximations of the zeros of the polynomial function.  For a function of one variable the Newton -

Raphson algorithm can be stated as follows:
1. For a function f, we guess the zero = x0 to begin our iterations.
2. For the next best approximation of the zero of f we use the following formula:
X1 = x0 – f(x0)/f’(x0). Thus f(x1) is closer to 0 than f(x0).
3. The next best approximation would be x2 given by the formula:
X2 = x1 – f(x1)/f’(x1). Thus f(x2) is closer to 0 than f(x1)
4. The above iterative process can be continued for as many number of times as we like. Each time the zero we get would be closer and closer to the actual zero of the polynomial.
5. The general formula for the (n+1)th approximation is like this:
X(x+1) = x(n) – f(x(n))/f’(x(n))

For any newton – raphson example, we begin by guessing a zero. For functions with smaller coefficients, we can conveniently assume 0 as an approximate zero. For other functions, we may graph the function using few test values to come to some approximate first guess.