You are on page 1of 22

Numerical Methods

Engr. Raymond C. Gallego


Presenter
The Newton-Raphson method (also known as
Newton's method) is a way to quickly find a good
approximation for the root of a real-valued
function f(x) = 0. It uses the idea that a continuous
and differentiable function can be approximated by
a straight line tangent to it.
How it Works
Suppose you need to find the root of a continuous,
differentiable function f(x), and you know the root you are
looking for is near the point x=x0​. Then Newton's method
tells us that a better approximation for the root is x1​=x0​−f′
(x0​)/f(x0​)​.This process may be repeated as many times as
necessary to get the desired accuracy. In general, for
any x-value xn​, the next value is given by xn+1 ​ =
xn​−f′(xn​)/f(xn​)​.
Note: the term "near" is used loosely because it
does not need a precise definition in this context.
However, x0​should be closer to the root you
need than to any other root (if the function has
multiple roots).
Geometric Representation
Here is a picture to demonstrate what Newton's method actually does:
We draw a tangent line to the graph of f(x) at the point x=xn​.
This line has slope f′(xn​) and goes through the point (xn​, f(xn​)).
Therefore, it has the equation y = f′(xn​)(x−xn​) + f(xn​). Now, we
find the root of this tangent line by setting y = 0 and x = xn+1​for
our new approximation. Solving this equation gives us our
new approximation,
which is xn+1 ​= xn​− f(xn​)/f’(xn​)​.
Find a root of an equation f(x)=2x3-2x-5 using Newton
Raphson method

Solution:
Here 2x3-2x-5=0

Let f(x)=2x3-2x-5

d/dx(2x3-2x-5) = 6x2-2

∴f′’(x)=6x2-2
Here
x 0 1 2
f(x) -5 -5 7

Here f(1) = -5<0 and f(2) = 7>0

∴ Root lies between 1 and 2

x0= (1+2)/2 =1.5

x0=1.5
1st iteration :

f(x0) = f(1.5) = 2⋅1.53-2⋅1.5-5 = -1.25

f′(x0) = f′’(1.5) = 6⋅1.52-2 =11.5

x1 = x0 - f(x0)/f′’(x0)

x1 = 1.5 – (-1.25/11.5)

x1 = 1.6087
2nd iteration :

f(x1) = f(1.6087) = 2⋅1.60873-2⋅1.6087-5 = 0.1089

f′(x1) = f′(1.6087) = 6⋅1.60872-2 = 13.5274

x2 = x1 - f(x1)/f′’(x1)

x2 = 1.6087 - 0.1089/13.5274

x2=1.6006
3rd iteration :

f(x2) = f(1.6006) = 2⋅1.60063-2⋅1.6006-5 = 0.0006

f′(x2) = f′(1.6006) = 6⋅1.60062-2 =13.3724

x3 = x2- f(x2)/f′’(x2)

x3 = 1.6006 - 0.0006/13.3724

x3 = 1.6006
4th iteration :

f(x3)=f(1.6006) =2⋅1.60063 - 2⋅1.6006 - 5 = 0

f ′(x3) = f ′(1.6006 ) = 6⋅1.60062 – 2 =13.3715

x4 = x3 - f(x3)/f′’(x3)

x4 = 1.6006 - 0/13.3715

x4 =1.6006
Approximate root of the equation 2x3-2x-5=0 using Newton
Raphson method is 1.6006

n x0 f(x0) f′(x0) x1 Update

1 1.5 -1.25 11.5 1.6087 x0=x1


2 1.6087 0.1089 13.5274 1.6006 x0=x1
3 1.6006 0.0006 13.3724 1.6006 x0=x1
4 1.6006 0 13.3715 1.6006 x0=x1
2. Find a root of an equation f(x) = x-cosx using
Newton Raphson method

Solution:
Here x-cos(x) = 0

Let f(x) = x-cos(x)

d/dx(x-cos(x)) = 1+sin(x)
∴f ′(x) = 1+sin(x)
Here

x 0 1

f(x) -1 0.4597
Here f(0) = -1<0 and f(1) = 0.4597>0

∴ Root lies between 0 and 1

x0 = (0+1)/2 = 0.5

x0 = 0.5
1st iteration :

f(x0) = f(0.5) = 0.5-cos(0.5) = -0.3776

f ′(x0) = f ′(0.5) = 1+sin(0.5) = 1.4794

x1 = x0 - f(x0)/f ′(x0)

x1 = 0.5 – (-0.3776/1.4794)

x1 = 0.7552
2nd iteration :

f(x1) = f(0.7552) = 0.7552 - cos(0.7552) = 0.0271

f ′(x1) = f ′(0.7552) = 1 + sin(0.7552) = 1.6855

x2 = x1 - f(x1)/f ′(x1)

x2 = 0.7552 - 0.0271/1.6855

x2 = 0.7391
3rd iteration :

f(x2) = f(0.7391) = 0.7391 - cos(0.7391) = 0.0001

f ′(x2) = f ′(0.7391) = 1 + sin(0.7391) = 1.6737

x3 = x2 - f(x2)/f ′(x2)

x3 = 0.7391 - 0.0001/1.6737

x3 = 0.7391
Approximate root of the equation x-cos(x)=0 using Newton
Raphson method is 0.7391

n x0 f(x0) f′(x0) x1 Update

1 0.5 -0.3776 1.4794 0.7552 x0=x1

2 0.7552 0.0271 1.6855 0.7391 x0=x1

3 0.7391 0.0001 1.6737 0.7391 x0=x1


END

You might also like