Numerical method
IESAM360
Lesson 2: Newton raphson method
Lecture: Franklin Junior Mwakatos
Email: samuelsimwaka7@gmail.com
NRM
Method used to approximate the root (or 𝑥 value) of a particular equation 𝑓 𝑥 =
0.
Below is the formula
𝒇 𝒙𝒏
𝒙𝒏"𝟏 = 𝒙𝒏 −
𝒇$ 𝒙𝒏
Recall: Techniques of differentiation like power rule. Power rule of
differentiation implies that if 𝑦 = 𝑎𝑥 % where 𝑎 and 𝑛 are constants then 𝑎𝑥 % $ is
computed by
𝑎𝑥 % $ = 𝑎 + 𝑛𝑥 %&'
i.e.
4𝑥 ( $
= 4 + 3𝑥 (&' = 12𝑥 )
The derivative of any constant is 0 i.e. 3 $ = 0
NRM
Also recall differentiation of trig functions
⇒ sin 𝑥 $ = cos 𝑥
⇒ cos 𝑥 $ = − sin 𝑥
$
⇒ tan 𝑥 = 𝑠𝑒𝑐 ) 𝑥
NRM
Problem: Use NRM to approximate the value of 2
Solution
Using scientific calculator 2 = 1.4142(4 dp)
Using NRM; first the need to generate an equation 𝑓 𝑥 = 0, so let 𝑥 = 2 hence
)
)
⇒𝑥 = 2
⇒ 𝑥) = 2
⇒ 𝑥) − 2 = 0
This implies that 𝑓 𝑥 = 𝑥 ) − 2 hence 𝑓 $ 𝑥 = 2𝑥. Now lets find the inverval
𝑥* , 𝑥' or range in which the root of the equation lies. The range should always
satisfy the inequality below
𝑓 𝑥* + 𝑓 𝑥' < 0 (𝑛𝑒𝑔𝑎𝑡𝑖𝑣𝑒)
NRM
First trial: lets try between 0 and 1.
When 𝑥* = 0, substitute into the function 𝑓 𝑥 = 𝑥 ) − 2 to obtain 𝑓 𝑥*
⇒ 𝑓 𝑥* = 0) − 2 = −2
When 𝑥' = 1;
⇒ 𝑓 𝑥' = 1) − 2 = −1
Then lets check if they satisfy the condition 𝑓 𝑥* + 𝑓 𝑥' < 0
⇒ −2 + −1 = 2 > 0
Then this means (0,1) can never be the interval for the equation. Lets try
between 1 and 2 or (1,2)
For 𝑥* = 1;
⇒ 𝑓 𝑥* = 1) − 2 = −1
NRM
For 𝑥' = 2;
⇒ 𝑓 𝑥' = 2) − 2 = 2
⇒ −1 + 2 = −2 > 0
Yes the interval (1,2) has satisfied the condition 𝑓 𝑥* + 𝑓 𝑥' < 0. Now, lets
compute 𝑓 $ (𝑥' ). This is simply achieved by substituting 𝑥' = 2 into the function
𝑓 $ (𝑥) i.e.
⇒ 𝑓 $ (𝑥' ) = 2 2 = 4
Next perform iterations till you reach a point where f(𝑥% )=0 or f(𝑥% )=0.000d
First iteration: @ n=1 the formula becomes
𝑓 𝑥% 𝑓 𝑥'
𝑥%"' = 𝑥% − $ ⇒ 𝑥) = 𝑥' − $
𝑓 𝑥% 𝑓 𝑥'
Substitute 𝑥' = 2, 𝑓 𝑥' = 2 and 𝑓 $ (𝑥' ) = 4 into the above to obtain
2
𝑥) = 2 − = 1.5
4
NRM
Evaluate 𝑓(𝑥) ) and 𝑓 $ 𝑥) before performing the second iteration
⇒ 𝑓 𝑥) = 1.5) − 2 = 0.25
⇒ 𝑓 $ 𝑥) = 2 1.5 = 3
Second iteration @ n=2;
𝑓 𝑥)
⇒ 𝑥( = 𝑥) − $
𝑓 𝑥)
0.25
= 1.5 −
3
𝑥( = 1.4667
Evaluate 𝑓(𝑥( ) and 𝑓 $ 𝑥(
⇒ 𝑓 𝑥( = 1.4167) − 2 = 0.0070
⇒ 𝑓 $ 𝑥( = 2 1.4167 = 2.8334
NRM
Third iteration @ n=3;
𝑓 𝑥(
⇒ 𝑥+ = 𝑥( −
𝑓 $ 𝑥(
0.0070
= 1.4167 −
2.8334
𝑥+ = 1.4142
𝑓 𝑥+ = 1.4142) − 2 = 0. Therefore the required value of 2 is 1.4142 and indeed
it fits perfectly into the interval (1,2)
Try to use NRM to approximate the value of 3
END OF LESSON 2
Thanks for your time…
My writings bangs an echo of simplicity-Mwakatos