TP2
“Newton Raphson method”
Instructed by Chhorn sopheaktra
1. Introduction
The Newton-Raphson method, or Newton Method, is a powerful technique for
solving equations numerically. Like so much of the differential calculus, it is based on
the simple idea of linear approximation. The essential of this tutorial is divided to four
parts, the basic formula, the algorithms, the problem of newton Raphson method and
practice.
2. Basic formula
2.1. Linear approximation
Let 𝑥0 be a good estimate of 𝑟 and let 𝑟 = 𝑥0 + ℎ. Since the true root is 𝑟,and ℎ =
𝑟 − 𝑥0 , the number ℎ measures how far the estimate 𝑥0 is from the truth 𝑟. Since ℎ is
‘small’, we can use the linear (tangent line) approximation to conclude that:
𝑓(𝑟) = 𝑓(𝑥0 + ℎ) = 𝑓 (𝑥0 ) + ℎ𝑓 ′ (𝑥0 )
Since 𝑓 (𝑟) = 0,
𝑓 (𝑥0 ) + ℎ𝑓 ′ (𝑥0 ) = 0
𝑓 (𝑥0 )
ℎ=−
𝑓 ′ (𝑥0 )
𝑓 (𝑥0 )
𝑟 = 𝑥0 −
𝑓 ′ (𝑥0 )
Our new improved estimate 𝑥1 of 𝑟 is therefore given by:
𝑓 (𝑥0 )
𝑥1 = 𝑥0 −
𝑓 ′ (𝑥0 )
Continue in this way. If 𝑥𝑛−1 is the current estimate, then the next estimate 𝑥𝑛 is given
by:
𝑓 (𝑥𝑛−1 )
𝑥𝑛 = 𝑥𝑛−1 −
𝑓 ′ (𝑥𝑛−1 )
2.2. A Geometric Interpretation of the Newton-Raphson
Figure 1. Geometric interpretation of Newton Raphson
Suppose the function have an equation 𝑓(𝑥) and 𝑟 is the true root of its. If we have a
point 𝑎 as shown in figure 1. So the tangent line can be written as:
𝑦 = 𝑓 (𝑎) + (𝑥 − 𝑎)𝑓 ′ (𝑎)
Let b be new estimation point (the intercept of the tangent line and x-axis). Then
𝑓 (𝑎 )
𝑏=𝑎−
𝑓 ′ (𝑎 )
3. Problem of Newton Raphson method
Once the Newton Method catches scent of the root, it usually hunts it down
with amazing speed. But since the method is based on local information,
namely 𝑓(𝑥𝑛 ) and 𝑓 ′ (𝑥𝑛 ), the Newton Method's sense of smell is deficient.
If the initial estimate is not close enough to the root, the Newton Method may
not converge, or may converge to the wrong root
The successive estimates of the Newton Method may converge to the root too
slowly, or may not converge at all.
4. Algorithms
4.1. Condition
Give Newton the right equation. In applied problems, that's where most of the
effort goes.
Give Newton an equation of the form 𝑓(𝑥). For example, 𝑥𝑒 𝑥 = 1 is not of the
right form: write it as 𝑥𝑒 𝑥 − 1 = 0. There are many ways to make an equation
ready for the Newton Method.
A Newton Method calculation can go bad in various ways. We can usually tell
when it does: the first few 𝑥𝑛 to settle down. There is almost always a simple
fix: spend time to find a good starting 𝑥0 .
A graphing program (plotting method) can help with 𝑥0 .
4.2. Calculation process
Selected the initial value for 𝑥0
Define function of 𝑓(𝑥) and 𝑓 ′ (𝑥𝑛 )
𝑓(𝑥𝑛−1 )
Find the new improved estimate base on equation 𝑥𝑛 = 𝑥𝑛−1 −
𝑓′ (𝑥𝑛−1 )
Checked the stopping condition based on error value or 𝑓(𝑥) value and
iteration value
If the process is not meeting the stopping condition, repeat the process
If the process is meeting the stopping condition, stop the process and display
the result (Note: in matlab you can use whatever display command that you
want. i.e. display, fprintf, plot…etc.)
5. Practice
Using matlab to find the root of equation 𝑒 2𝑥 = x + 6, corrected up to 6 decimal
place (maximum error < 0.0000001) by using Newton Raphson method
Find all solutions of 5x + ln(𝑥) = 1000 correct to 4 decimal places, use the
Newton Method.
6. Additional matlab command
“fprintf” command is used to data to text. Note: you can find the information in
[Link]