Professional Documents
Culture Documents
and Computation
Lecture # 5
(Solution of Non-Linear Equations)
Newton-Raphson Method
Cons:
➢The convergence of Bisection method is always slow.
➢If one of the initial guesses is closer to the root it will take larger number of
iterations to reach the root.
➢If 𝑓(𝑥) is such that it just touches the 𝑥 − axis, it will be unable to find the
lower guess and upper guess. For example
(𝑥 + 1.55)2 + sin(𝑥 ) + 1 = 0
Derivation of Newton-Raphson Method
Given a non-linear equation 𝑓 (𝑥 ) = 0 where 𝑓 is continuous and differentiable
function. If 𝑥𝑛 is the approximation of the root, then we draw a tangent line to
the graph of 𝑓 at 𝑥𝑛 . This line touches the point (𝑥𝑛 , 𝑓(𝑥𝑛 )) and has slope 𝑓′(𝑥𝑛 )
To find equation of this tangent line we use
𝑦 − 𝑦0 = 𝑚(𝑥 − 𝑥0 )
Where (𝑥0 , 𝑦0 ) = (𝑥𝑛 , 𝑓(𝑥𝑛 )) and 𝑚 = 𝑓′(𝑥𝑛 )
⇒ 𝑦 − 𝑓(𝑥𝑛 ) = 𝑓′(𝑥𝑛 )(𝑥 − 𝑥𝑛 )
⇒ 𝑦 = 𝑓′(𝑥𝑛 )(𝑥 − 𝑥𝑛 ) + 𝑓(𝑥𝑛 )
The point at which this line touches the x-axis i.e. 𝑦 = 0 will be the better
approximation of the root. Consider that point as 𝑥𝑛+1
⇒ 0 = 𝑓′(𝑥𝑛 )(𝑥𝑛+1 − 𝑥𝑛 ) + 𝑓(𝑥𝑛 )
Upon Rearranging we will get
𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
𝑓′(𝑥𝑛 )
𝑓 (𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − ′ ; 𝑛 = 0,1,2, …
𝑓 (𝑥𝑛 )
OR
𝑓 (𝑥𝑛−1 )
𝑥𝑛 = 𝑥𝑛−1 − ′ ; 𝑛 = 1,2,3, …
𝑓 (𝑥𝑛−1 )
Repeat this process again and again until you find the root.
Stopping Criterias
• |𝑓(𝑥𝑛 )| < 𝜖
• |𝑥𝑛+1 − 𝑥𝑛 | < 𝜖
|𝑥𝑛+1 −𝑥𝑛 |
• <𝜖
|𝑥𝑛+1 |
Question: Given a non-linear equation 2𝑥 − 5𝑥 + 2 = 0. Use Newton-Raphson Method
to find the root of this equation correct upto 4 decimal places (𝜀 = 10−4 ). Use 𝑥0 = 0 as
initial guess.
Solution: First let’s Compute derivative of given function
𝑓 ′ (𝑥 ) = 2𝑥 (ln (2)) − 5
Now start newton’s method
𝑓 (𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 − ′ ; 𝑛 = 0,1,2, …
𝑓 (𝑥𝑛 )
We take initial guess 𝑥0 = 0
1st Iteration: n=0
𝑓 (𝑥0 )
𝑥1 = 𝑥0 − ′
𝑓 (𝑥0 )
𝑓 (𝑥0 ) = 3
𝑓 ′ (𝑥0 ) = −4.3069
3
𝑥1 = 0 − = 0.6966
−4.3069
2nd Iteration: n=1
𝑓 (𝑥1 )
𝑥2 = 𝑥1 − ′
𝑓 (𝑥1 )
𝑓 (𝑥1 ) = 0.1378
𝑓 ′ (𝑥1 ) = −3.8767
0.1378
𝑥2 = 0.6966 − = 0.7321
−3.8767