Professional Documents
Culture Documents
Chapter 6 Roots of Nonlinear Equations
Chapter 6 Roots of Nonlinear Equations
OPEN METHODS
For the bracketing methods presented earlier, the root is located within an interval prescribed by a lower
and an upper bound. Repeated application of these methods always results in closer estimates of the true
value of the root. Such methods are said to be convergent because they move closer to the truth as the
computation progresses.
In contrast, the open methods described in this part of the chapter are based on formulas that require only
a single starting value of x or two starting values that do not necessarily bracket the root. As such, they
sometimes diverge or move away from the true root as the computation progresses. However, when the
open methods converge, they usually do so much more quickly than the bracketing methods.
Open methods employ a formula to predict the root. Such a formula can be developed for simple fixed-
point iteration (or, as it is also called, one-point iteration or successive substitution) by rearranging the
function 𝑓(𝑥) = 0 so that x is on the left-hand side of the equation:
This transformation can be accomplished either by algebraic manipulation or by simply adding x to both
sides of the original equation. For example,
𝑥 2 − 2𝑥 + 3 = 0
𝑥2 + 3
𝑥=
2
whereas sin 𝑥 = 0 could be put into the form of Eq. 6.8 by adding x to both sides to yield
𝑥 = sin 𝑥 + 𝑥
The utility of Eq. 6.8 is that it provides a formula to predict a new value of x as a function of an old value of x.
Thus, given an initial guess at the root 𝑥𝑖 , Eq. 6.8 can be used to compute a new estimate 𝑥𝑖+1 as expressed
by the iterative formula
As with other iterative formulas, the approximate error for this equation can be determined using the error
estimator:
𝑥𝑖+1 − 𝑥𝑖
𝜀𝑎 = | | × 100% EQ. 6.10
𝑥𝑖+1
FIGURE 6.6
FIGURE 6.7
NEWTON–RAPHSON METHOD
Newton’s method is the most commonly used open method to solve 𝑓(𝑥) = 0, where 𝑓′ is continuous.
Consider the graph of 𝑓(𝑥) in Figure 6.8. Start with an initial point 𝑥1 and locate the point (𝑥1 , 𝑓(𝑥1 )) on the
curve. Draw the tangent line to the curve at that point and let its x-intercept be 𝑥2 . The equation of this
tangent line is
𝑓(𝑥1 )
𝑥2 = 𝑥1 −
𝑓 ′ (𝑥1 )
Once 𝑥2 is available, locate the point (𝑥2 , 𝑓(𝑥2 )), draw the tangent line to the curve at that point, and let 𝑥3
be its x-intercept, which is found as
𝑓(𝑥2 )
𝑥3 = 𝑥2 −
𝑓 ′ (𝑥2 )
Continue this process until the sequence {𝑥𝑛 } converges to the intended root 𝑟. In general, two consecutive
elements 𝑥𝑖 and 𝑥𝑖+1 are related via
𝑓(𝑥𝑖 )
𝑥𝑖+1 = 𝑥𝑖 − , 𝑛 = 1, 2, 3, … , 𝑥1 = 𝑖𝑛𝑖𝑡𝑖𝑎𝑙 𝑝𝑜𝑖𝑛𝑡
𝑓 ′ (𝑥𝑖 ) EQ. 6.11
FIGURE 6.8
As with other root-location methods, Eq. 6.5 can be used as a termination criterion. In addition, however, the
Taylor series derivation of the method provides theoretical insight regarding the rate of convergence. Thus,
the error should be roughly proportional to the square of the previous error. In other words, the number of
significant figures of accuracy approximately doubles with each iteration.
SECANT METHOD
A potential problem in implementing the Newton-Raphson method is the evaluation of the derivative.
Although this is not inconvenient for polynomials and many other functions, there are certain functions
whose derivatives may be extremely difficult or inconvenient to evaluate. For these cases, the derivative
can be approximated by a backward finite divided difference, as in
𝑓(𝑥𝑖−1 ) − 𝑓(𝑥𝑖 )
𝑓 ′ (𝑥𝑖 ) ≅
𝑥𝑖−1 − 𝑥𝑖
This approximation can be substituted into Eq. 6.11 to yield the following iterative equation:
𝑓(𝑥𝑖 )(𝑥𝑖−1 − 𝑥𝑖 )
𝑥𝑖+1 = 𝑥𝑖 − EQ. 6.12
𝑓(𝑥𝑖−1 ) − 𝑓(𝑥𝑖 )
Equation 6.12 is the formula for the secant method. Notice that the approach requires two initial estimates
of x. However, because 𝑓(𝑥) is not required to change signs between the estimates, it is not classified as a
bracketing method.
FIGURE 6.8
Note the similarity between the secant method and the false-position method. For example, Eqs. 6.12 and
6.7 are identical on a term-by-term basis. Both use two initial estimates to compute an approximation of the
slope of the function that is used to project to the x axis for a new estimate of the root. However, a critical
difference between the methods is how one of the initial values is replaced by the new estimate. Recall that
in the false-position method the latest estimate of the root replaces whichever of the original values yielded
a function value with the same sign as 𝑓(𝑥𝑟 ). Consequently, the two estimates always bracket the root.
Therefore, for all practical purposes, the method always converges because the root is kept within the
bracket. In contrast, the secant method replaces the values in strict sequence, with the new value 𝑥𝑖+1
replacing 𝑥𝑖 and 𝑥𝑖 replacing 𝑥𝑖−1 . As a result, the two values can sometimes lie on the same side of the root.
For certain cases, this can lead to divergence.
SAMPLE PROBLEMS:
Solution:
𝑓(𝑥)
𝑥𝑖+1 = 𝑥𝑖 −
𝑓 ′ (𝑥)
Note that:
𝑑(𝑥 𝑛 )
= 𝑛𝑥 𝑛−1 (𝑃𝑜𝑤𝑒𝑟 𝑅𝑢𝑙𝑒)
𝑑𝑥
𝑓 ′ (𝑥) = 3𝑥 2 − 12𝑥 + 11
3.1913 − 3.5
𝜀𝑎 = | | × 100% = 9.6730%
3.1913
Second iteration:
3.0687 − 3.1913
𝜀𝑎 = | | × 100% = 3.9953%
3.0687
Third iteration:
3.0473 − 3.0687
𝜀𝑎 = | | × 100% = 0.7017%
3.0473
After three iterations, we can conclude that the value (approximated) of the root is 3.0473.
𝑓(𝑥𝑖 )(𝑥𝑖−1 − 𝑥𝑖 )
𝑥𝑖+1 = 𝑥𝑖 −
𝑓(𝑥𝑖−1 ) − 𝑓(𝑥𝑖 )
(1.775)(2.5 − 3.5)
𝑥1 = 3.5 − = 2.7111
(−0.475) − (1.775)
2.7111 − 3.5
𝜀𝑎 = | | × 100% = 29.0984%
2.7111
Second iteration:
(−0.4515)(3.5 − 2.7111)
𝑥2 = 2.7111 − = 2.8711
(1.775) − (−0.4515)
2.8711 − 2.7111
𝜀𝑎 = | | × 100% = 5.5722%
2.8711
Third iteration:
(−0.3101)(2.7111 − 2.8711)
𝑥3 = 2.8711 − = 3.2219
(−0.4515) − (−0.3101)
3.2219 − 2.8711
𝜀𝑎 = | | × 100% = 10.8885%
3.2219
After three iterations, we can conclude that the value (approximated) of the root is 3.2219.
Solution:
𝑓(𝑥)
𝑥𝑖+1 = 𝑥𝑖 −
𝑓 ′ (𝑥)
𝑓(𝑥) = 7 sin(𝑥) 𝑒 −𝑥 − 1
Note that:
7 sin(𝑥𝑖 ) 𝑒 −𝑥𝑖 − 1
𝑥𝑖+1 = 𝑥𝑖 − −𝑥
7𝑒 𝑖 (𝑐𝑜𝑠(𝑥𝑖 ) − 𝑠𝑖𝑛(𝑥𝑖 ))
MATH 131 – NUMERICAL SOLUTIONS TO ENG’G PROBLEMS 6
COLLEGE OF ENGINEERING
0.1444 − 0.3
𝜀𝑎 = | | × 100% = 107.7907%
0.1444
Second iteration:
0.1694 − 0.1444
𝜀𝑎 = | | × 100% = 14.7630%
0.1694
Third iteration:
0.1702 − 0.1694
𝜀𝑎 = | | × 100% = 0.4579%
0.1702
After three iterations, we can conclude that the value (approximated) of the root is 𝟎. 𝟏𝟕𝟎𝟐.
𝑓(𝑥𝑖 )(𝑥𝑖−1 − 𝑥𝑖 )
𝑥𝑖+1 = 𝑥𝑖 −
𝑓(𝑥𝑖−1 ) − 𝑓(𝑥𝑖 )
(0.5325)(0.4 − 0.3)
𝑥1 = 0.3 − = 0.1193
(0.8272) − (0.5325)
0.1193 − 0.3
𝜀𝑎 = | | × 100% = 151.3676%
0.1193
Second iteration:
(−0.2606)(0.3 − 0.1193)
𝑥2 = 0.1193 − = 0.1787
(0.5325) − (−0.2606)
2.8711 − 2.7111
𝜀𝑎 = | | × 100% = 33.2295%
2.8711
Third iteration:
(0.0406)(0.1193 − 0.1787)
𝑥3 = 0.1787 − = 0.1707
(−0.2606) − (0.0406)
0.1707 − 0.1787
𝜀𝑎 = | | × 100% = 4.6953%
0.1707
After three iterations, we can conclude that the value (approximated) of the root is 0.1707.
3. (a) Apply the Newton-Raphson method to the function 𝑓(𝑥) = tanh(𝑥 2 − 9) to evaluate its known real root
at 𝑥 = 3. Use an initial guess of 𝑥0 = 3.2 and take a minimum of three iterations. (b) Did the method
exhibit convergence onto its real root?
Solution:
𝑓(𝑥)
𝑥𝑖+1 = 𝑥𝑖 −
𝑓 ′ (𝑥)
𝑓(𝑥) = tanh(𝑥 2 − 9)
Note that:
𝑑(tanh 𝑢) 𝑑𝑢
= sech2 𝑢 ( )
𝑑𝑥 𝑑𝑥
𝑓 ′ (𝑥) = 2xsech2 (𝑥 2 − 9)
tanh(𝑥𝑖2 − 9)
𝑥𝑖+1 = 𝑥𝑖 −
2𝑥𝑖 sech2 (𝑥𝑖2 − 9)
tanh((3.2)2 − 9) 0.8455
𝑥1 = 3.2 − 2 2
= 3.2 − = 2.7368
2(3.2)sech ((3.2) − 9) 1.8253
2.7368 − 3.2
𝜀𝑎 = | | × 100% = 16.9242%
2.7368
Second iteration:
tanh((2.7368)2 − 9) −0.9069
𝑥2 = 2.7368 − = 2.7368 − = 3.6703
2(2.7368)sech2 ((2.7368)2 − 9) 0.9715
3.6703 − 2.7368
𝜀𝑎 = | | × 100% = 25.4348%
3.6703
Third iteration:
tanh((3.6703)2 − 9) 0.9997
𝑥3 = 3.6703 − 2 2
= 3.6703 − = −256.8000
2(3.6703)sech ((3.6703) − 9) 0.0038
−256.8000 − 3.6703
𝜀𝑎 = | | × 100% = 101.4292%
−256.8000
(b) The solution diverges from its real root of x = 3. Due to the concavity of the slope, the next iteration will
always diverge. The following graph illustrates how the divergence evolves.
4. You are designing a spherical tank to hold water for a small village
in a developing country. The volume of liquid it can hold can be
computed as
[3𝑅 − ℎ]
𝑉 = 𝜋ℎ2
3
Solution:
Since the given equation is easy to differentiate, the Newton-Raphson method is the best choice to achieve
results efficiently.
𝑓(𝑥)
𝑥𝑖+1 = 𝑥𝑖 −
𝑓 ′ (𝑥)
[3𝑅 − ℎ]
𝑉 = 𝜋ℎ2
3
MATH 131 – NUMERICAL SOLUTIONS TO ENG’G PROBLEMS 9
COLLEGE OF ENGINEERING
𝜋ℎ3
𝑓(ℎ) = 𝜋ℎ2 𝑅 − −𝑉
3
Note that:
𝑑(𝑢𝑣) 𝑑𝑣 𝑑𝑢
=𝑢 +𝑣 (𝑃𝑟𝑜𝑑𝑢𝑐𝑡 𝑅𝑢𝑙𝑒)
𝑑𝑥 𝑑𝑥 𝑑𝑥
In this problem, we are going to follow the format of the Newton-Raphson formula but 𝑥𝑖 = ℎ𝑖 . Substituting to
the Newton-Raphson Formula gives
𝜋𝑥𝑖3
𝜋𝑥𝑖2 𝑅 − −𝑉
𝑥𝑖+1 = 𝑥𝑖 − 3
2𝜋𝑥𝑖 𝑅 − 𝜋𝑥𝑖2
𝜋(10)3
𝜋(10)(10) − − 1000 1094.3951
𝑥1 = 10 − 3 = 10 − = 6.5164
2𝜋(10)(10) − 𝜋(10)2 314.1593
6.5164 − 10
𝜀𝑎 = | | × 100% = 53.4582%
6.5164
Second iteration:
𝜋(6.5164)3
𝜋(6.5164)(10) − − 1000 44.2603
𝑥2 = 6.5164 − 3 = 6.5164 − = 6.3561
2𝜋(6.5164)(10) − 𝜋(6.5164)2 276.0346
6.3561 − 6.5164
𝜀𝑎 = | | × 100% = 2.5227%
6.3561
Third iteration:
𝜋(6.3561)3
𝜋(6.3561)(10) − − 1000 0.2975
𝑥3 = 6.3561 − 3 = 6.3561 − = 6.3550
2𝜋(6.3561)(10) − 𝜋(6.3561) 2 272.4452
6.3550 − 6.3561
𝜀𝑎 = | | × 100% = 0.0172%
6.3550
Thus, after only three iterations, the root is determined to be 6.3550 with an approximate relative error of
0.0172%.