Secant Method for Nonlinear Equations
Secant Method for Nonlinear Equations
05
Secant Method of Solving Nonlinear Equations
1. derive the secant method to solve for the roots of a nonlinear equation,
2. use the secant method to numerically solve a nonlinear equation.
What is the secant method and why would I want to use it instead of the Newton-
Raphson method?
The Newton-Raphson method of solving a nonlinear equation f ( x) 0 is given by the
iterative formula
f ( xi )
xi 1 = xi (1)
f ( xi )
One of the drawbacks of the Newton-Raphson method is that you have to evaluate the
derivative of the function. With availability of symbolic manipulators such as Maple,
MathCAD, MATHEMATICA and MATLAB, this process has become more convenient.
However, it still can be a laborious process, and even intractable if the function is derived as
part of a numerical scheme. To overcome these drawbacks, the derivative of the function,
f (x) is approximated as
f ( xi ) f ( xi 1 )
f ( xi ) (2)
xi xi 1
Substituting Equation (2) in Equation (1) gives
f ( xi )( xi xi 1 )
xi 1 xi (3)
f ( xi ) f ( xi 1 )
The above equation is called the secant method. This method now requires two initial
guesses, but unlike the bisection method, the two initial guesses do not need to bracket the
root of the equation. The secant method is an open method and may or may not converge.
However, when secant method converges, it will typically converge faster than the bisection
method. However, since the derivative is approximated as given by Equation (2), it typically
converges slower than the Newton-Raphson method.
03.05.1
03.05.2 Chapter 03.05
The secant method can also be derived from geometry, as shown in Figure 1. Taking two
initial guesses, xi 1 and xi , one draws a straight line between f ( xi ) and f ( xi 1 ) passing
through the x -axis at xi 1 . ABE and DCE are similar triangles.
Hence
AB DC
AE DE
f ( xi ) f ( xi 1 )
xi xi 1 xi 1 xi 1
On rearranging, the secant method is given as
f ( xi )( xi xi 1 )
xi 1 xi
f ( xi ) f ( xi 1 )
f (x)
f (xi) B
f (xi–1) C
E D A
x
xi+1 xi–1 xi
Example 1
You are working for ‘DOWN THE TOILET COMPANY’ that makes floats (Figure 2) for
ABC commodes. The floating ball has a specific gravity of 0.6 and a radius of 5.5 cm. You
are asked to find the depth to which the ball is submerged when floating in water.
The equation that gives the depth x to which the ball is submerged under water is given by
x 3 0.165 x 2 3.993 10 4 0
Use the secant method of finding roots of equations to find the depth x to which the ball is
submerged under water. Conduct three iterations to estimate the root of the above equation.
Find the absolute relative approximate error and the number of significant digits at least
correct at the end of each iteration.
Secant Method 03.05.3
Solution
f x x 3 0.165 x 2 3.993 10 4
Let us assume the initial guesses of the root of f x 0 as x 1 0.02 and x0 0.05 .
x0
x 3
0
0.165 x02 3.993 10 4 x0 x1
x 3
0 0.165 x 3.993 10
2
0
4
x 3
1 0.165 x21 3.993 10 4
0.05
0.05 3
0.1650.05 3.993 10
2 4
0.05 0.02
0.05 3
0.1650.05 3.993 10 4
2
0.02 3
0.1650.02 3.993 10 4
2
0.06461
Iteration 2
f x1 x1 x0
x 2 x1
f x1 f x0
x1
x3
1
0.165 x12 3.993 10 4 x1 x0
x 3
1
0.165 x12 3.993 10 4 x03 0.165 x02 3.993 10 4
03.05.4 Chapter 03.05
0.06461
0.06461 0.1650.06461
3 2
3.993 10 4 0.06461 0.05
0.06461 0.1650.06461
3 2
3.993 10 4 0.05 3
0.1650.05 3.993 10 4
2
0.06241
The absolute relative approximate error a at the end of Iteration 2 is
x 2 x1
a 100
x2
0.06241 0.06461
100
0.06241
3.525%
The number of significant digits at least correct is 1, as you need an absolute relative
approximate error of 5% or less.
Iteration 3
f x2 x2 x1
x3 x2
f x2 f x1
x2
x 3
2
0.165 x22 3.993 10 4 x2 x1
x 3
2
0.165 x22 3.993 10 4 x13 0.165 x12 3.993 10 4
0.06241
0.06241 0.1650.06241
3 2
3.993 10 4 0.06241 0.06461
0.06241 0.1650.06241
3 2
3.993 10 4 0.06461 0.1650.06461
3 2
3.993 10 4
0.06238
The absolute relative approximate error a at the end of Iteration 3 is
x3 x2
a 100
x3
0.06238 0.06241
100
0.06238
0.0595%
The number of significant digits at least correct is 2, as you need an absolute relative
approximate error of 0.5% or less. Table 1 shows the secant method calculations for the
results from the above problem.
2. The secant method formula for finding the square root of a real number R from the
equation x 2 − R = 0 is
xi xi −1 + R
(A)
xi + xi −1
xi xi −1
(B)
xi + xi −1
1 R
(C) xi +
2 xi
2 xi2 + xi xi −1 − R
(D)
xi + xi −1
3. The next iterative value of the root of x 2 − 4 = 0 using secant method, if the initial
guesses are 3 and 4, is
(A) 2.2857
(B) 2.5000
(C) 5.5000
(D) 5.7143
4. The root of the equation f ( x ) = 0 is found by using the secant method. Given one of
the initial estimates is x0 = 3 , f (3) = 5 , and the angle the secant line makes with the
x-axis is 57° , the next estimate of the root, x1 , is
(A) –3.2470
(B) –0.24704
(C) 3.247
(D) 6.2470
03.05.1
03.05.2 Chapter 03.05
5. For finding the root of sin x = 0 by the secant method, the following choice of initial
guesses would not be appropriate.
π π
(A) and
4 2
π 3π
(B) and
4 4
π π
(C) − and
2 2
π π
(D) and
3 2
6. When drugs are given orally to a patient, the drug concentration c in the blood
stream at time t is given by a formula
c = Kte − at
where K is dependent on parameters such as the dose administered while a is
dependent on the absorption and elimination rates of the drug. If K = 2 and
a = 0.25 , and t is in seconds and c is in mg ml , the time at which the maximum
concentration is reached is given by the solution of the equation
(A) 2te −0.25t = 0
(B) 2e −0.25t − 2te −0.25t = 0
(C) 2e −0.25t − 0.5te −0.25t = 0
(D) 2te −0.25t = 2
For a complete solution, refer to the links at the end of the book.
03.05.2
Chapter 03.05
Secant Method of Solving a Nonlinear Equation –
More Examples
Chemical Engineering
Example 1
You have a spherical storage tank containing oil. The tank has a diameter of 6 ft. You are
asked to calculate the height h to which a dipstick 8 ft long would be wet with oil when
immersed in the tank when it contains 4 ft 3 of oil.
Dipstick
The equation that gives the height h of the liquid in the spherical tank for the given volume
and radius is given by
f h h 3 9h 2 3.8197 0
Use the secant method of finding roots of equations to find the height h to which the dipstick
is wet with oil. Conduct three iterations to estimate the root of the above equation. Find the
absolute relative approximate error at the end of each iteration and the number of significant
digits at least correct at the end of each iteration.
03.05.1
03.05.2 Chapter 03.05
Solution
Let us take the initial guesses of the root of f h 0 as h1 0.5 and h0 1 .
Iteration 1
The estimate of the root is
f h0 h0 h1
h1 h0
f h0 f h1
h0
h 9h02 3.8197 h0 h1
0
3
h03 9h 3.8197 h31 9h21 3.8197
2
0
1
13
91 3.8197 1 0.5
2
13 2
91 3.8197 0.5 90.5 3.8197 3 2
0.64423
The absolute relative approximate error a at the end of Iteration 1 is
h1 h0
a 100
h1
0.64423 1
100
0.64423
55.224%
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of 5% or less for one significant digit to be correct in your result.
Iteration 2
The estimate of the root is
f h1 h1 h0
h2 h1
f h1 f h0
h1
h1 9h12 3.8197 h1 h0
3
h13 9h 3.8197 h03 9h02 3.8197
1
2
0.64423
0.64423 3 2
90.64423 3.8197 0.64423 1
0.64423 3 2
90.64423 3.8197 1 91 3.8197
3 2
0.67185
The absolute relative approximate error a at the end of Iteration 2 is
h2 h1
a 100
h2
0.67185 0.64423
100
0.67185
4.1104%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
Secant Method – More Examples: Chemical Engineering 03.05.3
Iteration 3
The estimate of the root is
f h2 h2 h1
h3 h2
f h2 f h1
h2
h 2
3
9h22 3.8197 h2 h1
h23 9h 3.8197 h13 9h12 3.8197
2
2
0.67185
0.67185 3 2
90.67185 3.8197 0.67185 0.64423
0.67185 3
90.67185 3.8197 0.64423 2 90.64423 3.8197
2 2
0.67759
The absolute relative approximate error a at the end of Iteration 3 is
h3 h2
a 100
h3
0.67759 0.67185
100
0.67759
0.84768%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
NONLINEAR EQUATIONS
Topic Secant Method-More Examples
Summary Examples of Secant Method
Major Chemical Engineering
Authors Autar Kaw
Date August 7, 2009
Web Site [Link]
Chapter 03.05
Secant Method of Solving a Nonlinear Equation –
More Examples
Civil Engineering
Example 1
You are making a bookshelf to carry books that range from 8½" to 11" in height and would
take up 29" of space along the length. The material is wood having a Young’s Modulus of
3.667 Msi , thickness of 3/8" and width of 12". You want to find the maximum vertical
deflection of the bookshelf. The vertical deflection of the shelf is given by
where x is the position along the length of the beam. Hence to find the maximum deflection
dv
we need to find where f ( x) 0 and conduct the second derivative test.
dx
Books
Bookshelf
The equation that gives the position x where the deflection is maximum is given by
Use the secant method of finding roots of equations to find the position x where the
deflection is maximum. Conduct three iterations to estimate the root of the above equation.
Find the absolute relative approximate error at the end of each iteration and the number of
significant digits at least correct at the end of each iteration.
03.05.1
03.05.2 Chapter 03.05
Solution
Let us take the initial guesses of the root of f x 0 as x1 10 and x0 15.
Iteration 1
The estimate of the root is
f x0 x0 x 1
x1 x0
f x0 f x 1
f x0 0.67665 10 8 x04 0.26689 105 x03 0.12748 103 x02 0.018507
0.67665 108 15 0.26689 105 15 0.12748 103 15 0.018507
4 3 2
8.2591 104
f x1 0.67665 108 x41 0.26689 105 x31 0.12748 103 x21 0.018507
0.67665 108 10 0.26689 105 10 0.12748 103 10 0.018507
4 3 2
8.4956 103
x1 15
8.2591 10 4 15 10
8.2591 10 4 8.4956 103
14.557
The absolute relative approximate error a at the end of Iteration 1 is
x1 x0
a 100
x1
14.557 15
100
14.557
3.0433%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
Iteration 2
The estimate of the root is
f x1 x1 x0
x 2 x1
f x1 f x0
f x1 0.67665 108 x14 0.26689 105 x13 0.12748 103 x12 0.018507
0.67665 108 14.557 0.26689 10 5 14.557
4 3
2.9870 105
x2 15
2.9870 105 14.557 15
2.9870 105 8.2591 10 4
14.572
The absolute relative approximate error a at the end of Iteration 2 is
Secant Method-More Examples: Civil Engineering 03.05.3
x 2 x1
a 100
x2
14.572 14.557
100
14.572
0.10611%
The number of significant digits at least correct is 2, because the absolute relative
approximate error is less than 0.5% .
Iteration 3
The estimate of the root is
f x 2 x 2 x1
x3 x 2
f x 2 f x1
f x2 0.67665 10 8 x24 0.26689 105 x23 0.12748 103 x22 0.018507
0.67665 108 14.572 0.26689 105 14.572
4 3
6.0676 109
x3 14.572
6.0676 109 14.572 14.557
6.0676 109 2.9870 105
14.572
The absolute relative approximate error a at the end of Iteration 3 is
x3 x 2
a 100
x3
14.572 14.572
100
14.572
2.1559 105%
The number of significant digits at least correct is 6, because the absolute relative
approximate error is less than 0.00005% .
NONLINEAR EQUATIONS
Topic Secant Method-More Examples
Summary Examples of Secant Method
Major Civil Engineering
Authors Autar Kaw
Date August 7, 2009
Web Site [Link]
Chapter 03.05
Secant Method of Solving a Nonlinear Equation –
More Examples
Computer Science
Example 1
To find the inverse of a number a , one can use the equation
1
f (c ) a 0
c
where c is the inverse of a .
Use the secant method of finding roots of equations to find the inverse of a 2.5 . Conduct
three iterations to estimate the root of the above equation. Find the absolute relative
approximate error at the end of each iteration and the number of significant digits at least
correct at the end of each iteration.
Solution
1
f (c ) a 0
c
1
a (ci ci 1 )
ci
ci 1 ci
1 1
a a
ci ci 1
1
a (ci ci 1 )
ci
ci
1 1
ci 1 ci
1
a (ci ci 1 )
ci
ci
(ci ci 1 )
ci ci 1
1
ci ci ci 1 a
ci
03.05.1
03.05.2 Chapter 03.05
ci ci 1 (aci 1)
Let us take the initial guesses of the root of f c 0 as c 1 0.1 and c0 0.6.
Iteration 1
The estimate of the root is
c1 c0 c 1 (ac0 1)
0.6 (0.1)2.5(0.6) 1
0.55
The absolute relative approximate error a at the end of Iteration 1 is
c1 c 0
a 100
c1
0.55 0.6
100
0.55
9.0909%
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of less than 5% for one significant digit to be correct in your result.
Iteration 2
The estimate of the root is
c 2 c1 c 0 (ac1 1)
0.55 (0.6)2.5(0.55) 1
0.325
The absolute relative approximate error a at the end of Iteration 2 is
c 2 c1
a 100
c2
0.325 0.55
100
0.325
69.231%
The number of significant digits at least correct is 0.
Iteration 3
The estimate of the root is
c3 c 2 c1 (ac 2 1)
0.325 (0.55)2.5(0.325) 1
0.42813
The absolute relative approximate error a at the end of Iteration 3 is
c3 c 2
a 100
c3
Secant Method – More Examples: Computer Science 03.05.3
0.42813 0.325
100
0.42813
24.088%
The number of significant digits at least correct is 0.
NONLINEAR EQUATIONS
Topic Secant Method-More Examples
Summary Examples of Secant Method
Major Computer Engineering
Authors Autar Kaw
Date August 7, 2009
Web Site [Link]
Chapter 03.05
Secant Method of Solving a Nonlinear Equation –
More Examples
Electrical Engineering
Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,
Thermally
conductive epoxy
coating
the relationship between the resistance R of the thermistor and the temperature is given by
1
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 lnR
3
T
where T is in Kelvin and R is in ohms.
A thermistor error of no more than 0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19C , we need to solve
1
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 lnR
3
19.01 273.15
and
1
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 lnR
3
18.99 273.15
Use the secant method of finding roots of equations to find the resistance R at 18.99 C .
Conduct three iterations to estimate the root of the above equation. Find the absolute relative
03.05.1
03.05.2 Chapter 03.05
approximate error at the end of each iteration and the number of significant digits at least
correct at the end of each iteration.
Solution
Solving
1
1.129241 10 3 2.341077 10 4 ln( R) 8.775468 10 8 lnR
3
18.99 273.15
We get
f ( R) 2.341077 10 4 ln( R) 8.775468 10 8 lnR 2.293775 10 3
3
Let us take the initial guesses of the root of f R 0 as R1 14000 and R0 15000 .
Iteration 1
The estimate of the root is
f R0 R0 R1
R1 R0
f R0 f R1
f R0 2.341077 10 4 ln R0 8.775468 10 8 ln R0 2.293775 10 3
3
3.5383 10 5
f R1 2.341077 10 4 lnR1 8.775468 10 8 ln R1 2.293775 10 3
3
1.7563 10 5
R1 15000
3.5383 10 5 15000 14000
3.5383 10 5 1.7563 10 5
= 13014
Iteration 2
The estimate of the root is
f R1 R1 R0
R2 R1
f R1 f R0
f R1 2.341077 10 4 ln R1 8.775468 10 8 ln R1 2.293775 10 3
3
Secant Method – More Examples: Electrical Engineering 03.05.3
1.2658 10 6
R2 13014
1.2658 10 6 13014 15000
1.2658 10 6 3.5383 10 5
13083
The absolute relative approximate error a at the end of Iteration 2 is
R2 R1
a 100
R2
13083 13014
100
13083
0.52422%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
Iteration 3
The estimate of the root is
f R2 R2 R1
R3 R2
f R2 f R1
f R2 2.341077 10 4 lnR2 8.775468 10 8 lnR2 2.293775 10 3
3
8.8907 10 8
R3 13083
8.8911 10 8 13083 13014
8.8911 10 8 1.2658 10 6
13078
The absolute relative approximate error a at the end of Iteration 3 is
R3 R2
a 100
R3
13078 13083
100
13078
0.034415%
The number of significant digits at least correct is 3, because the absolute relative
approximate error is less than 0.05% .
Chapter 03.05
Secant Method of Solving a Nonlinear Equation –
More Examples
Industrial Engineering
Example 1
You are working for a start-up computer assembly company and have been asked to
determine the minimum number of computers that the shop will have to sell to make a profit.
The equation that gives the minimum number of computers n to be sold after considering the
total costs and the total sales is
f (n) 40n1.5 875n 35000 0
Use the secant method of finding roots of equations to find the minimum number of
computers that need to be sold to make a profit. Conduct three iterations to estimate the root
of the above equation. Find the absolute relative approximate error at the end of each
iteration and the number of significant digits at least correct at the end of each iteration.
Solution
Let us take the initial guesses of the root of f n 0 as n1 25 and n0 50 .
Iteration 1
The estimate of the root is
f n0 n0 n 1
n1 n0
f n0 f n 1
n0
40n 875n0 35000 n0 n1
1.5
0
40n 1.5
0
875n0 35000 40n1.15 875n1 35000
50
40(50)
875(50) 35000 50 25
1.5
40(50) 1.5
875(50) 35000 40(25)1.5 875(25) 35000
60.587
The absolute relative approximate error a at the end of Iteration 1 is
n1 n0
a 100
n1
60.587 50
100
60.587
17.474%
03.05.1
03.05.2 Chapter 03.05
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of less than 5% for one significant digit to be correct in your result.
Iteration 2
The estimate of the root is
f n1 n1 n0
n2 n1
f n1 f n0
n1
40n 1.5
1 875n1 35000 n1 n0
40n1.5
1
875n1 35000 40n01.5 875n0 35000
60.587
4060.587 87560.587 3500060.587 50
1.5
4050 87550 35000
1.5
62.569
The absolute relative approximate error a at the end of Iteration 2 is
n 2 n1
a 100
n2
62.569 60.587
100
62.569
3.1672%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
Iteration 3
The estimate of the root is
f n2 n2 n1
n3 n 2
f n2 f n1
n2
40n 875n2 35000n2 n1
1.5
2
40n 1.5
2 875n2 35000 40n11.5 875n1 35000
62.569
4062.569 87562.569 3500062.569 60.587
1.5
4060.587 87560.587 35000
1.5
62.690
The absolute relative approximate error a at the end of Iteration 3 is
n3 n 2
a 100
n3
62.690 62.569
100
62.690
Secant Method-More Examples: Industrial Engineering 03.05.3
0.19425%
The number of significant digits at least correct is 2, because the absolute relative
approximate error is less than 0.5% .
NONLINEAR EQUATIONS
Topic Secant Method-More Examples
Summary Examples of Secant Method
Major Industrial Engineering
Authors Autar Kaw
Date August 7, 2009
Web Site [Link]
Chapter 03.05
Secant Method of Solving a Nonlinear Equation –
More Examples
Mechanical Engineering
Example 1
A trunnion has to be cooled before it is shrink fitted into a steel hub.
The equation that gives the temperature T f to which the trunnion has to be cooled to obtain
the desired contraction is given by
f T f 0.50598 10 10 T f3 0.38292 10 7 T f2 0.74363 10 4 T f 0.88318 10 2 0
Use the secant method of finding roots of equations to find the temperature T f to which the
trunnion has to be cooled to. Conduct three iterations to estimate the root of the above
equation. Find the absolute relative approximate error at the end of each iteration and
the number of significant digits at least correct at the end of each iteration.
Solution
Let us take the initial guesses of the root of f T f 0 as T f , 1 110 and T f ,0 130 .
Iteration 1
The estimate of the root is
f T f ,0 T f ,0 T f , 1
T f ,1 T f ,0
f T f ,0 f T f , 1
03.05.1
03.05.2 Chapter 03.05
T f ,1 130
7.7091 10 5 130 110
7.7091 10 5 1.1825 10 3
= 128.78
The absolute relative approximate error a at the end of Iteration 1 is
T f ,1 T f , 0
a 100
T f ,1
128.78 130
100
128.78
0.95051%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .
Iteration 2
The estimate of the root is
f T f ,1 T f ,1 T f , 0
T f , 2 T f ,1
f T f ,1 f T f ,0
f T f ,1 0.50598 10 10 T f3,1 0.38292 10 7 T f2,1 0.74363 10 4 T f ,1 0.88318 10 2
0.50598 10 10 128.78 0.38292 10 7 128.78
3 2
128.75 128.78
100
128.75
0.016419%
The number of significant digits at least correct is 3.
Iteration 3
The estimate of the root is
f T f , 2 T f , 2 T f ,1
T f ,3 T f , 2
f T f , 2 f T f ,1
f T f , 2 0.50598 10 10 T f3, 2 0.38292 10 7 T f2, 2 0.74363 10 4 T f , 2 0.88318 10 2
0.50598 10 10 (128.75) 3 0.38292 10 7 (128.75) 2
0.74363 10 4 (128.75) 0.88318 10 2
1.5241 10 9
T f ,3 128.75
1.5241 10 5 128.75 128.78
1.5241 10 9 1.3089 10 6
128.75
The absolute relative approximate error a at the end of Iteration 3 is
T f ,3 T f , 2
a 100
T f ,3
128.75 128.75
100
128.75
1.9097 10 5 %
The number of significant digits at least correct is 6, because the absolute relative
approximate error is less than 0.00005% .
NONLINEAR EQUATIONS
Topic Secant Method-More Examples
Summary Examples of Secant Method
Major Mechanical Engineering
Authors Autar Kaw
Date August 7, 2009
Web Site [Link]