0% found this document useful (0 votes)
70 views21 pages

Chapter 2 Roots of Equation

The document describes several numerical methods for finding the roots or zeroes of equations, including graphical methods, trial and error, bisection, false position, simple fixed point iteration, and Newton-Raphson. Bisection works by repeatedly bisecting an interval containing a root until the interval is smaller than a specified tolerance. False position is similar but takes the slopes of the function into account to converge faster. Simple fixed point iteration and Newton-Raphson are open methods that require an initial guess and generate successive approximations without bracketing. Newton-Raphson is particularly fast as it uses the tangent line at each iteration to zero in on the root. Examples are provided to illustrate how to apply each method.

Uploaded by

Shyn Clavecillas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views21 pages

Chapter 2 Roots of Equation

The document describes several numerical methods for finding the roots or zeroes of equations, including graphical methods, trial and error, bisection, false position, simple fixed point iteration, and Newton-Raphson. Bisection works by repeatedly bisecting an interval containing a root until the interval is smaller than a specified tolerance. False position is similar but takes the slopes of the function into account to converge faster. Simple fixed point iteration and Newton-Raphson are open methods that require an initial guess and generate successive approximations without bracketing. Newton-Raphson is particularly fast as it uses the tangent line at each iteration to zero in on the root. Examples are provided to illustrate how to apply each method.

Uploaded by

Shyn Clavecillas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

METHODS ON

FINDING THE ROOTS


OF EQUATION
ROOTS OF
EQUATION
As engineers, we are all very familiar on how we can
obtain the roots of equation in the form
𝑓𝑓𝑥𝑥=𝑎𝑎𝑥𝑥2+𝑏𝑏𝑥𝑥+𝑐𝑐=0.

… How about if equations of higher orders?...


𝑓𝑓𝑛𝑛𝑥𝑥=𝑎𝑎0+𝑎𝑎1𝑥𝑥+𝑎𝑎2𝑥𝑥2+⋯+𝑎𝑎𝑛𝑛𝑥𝑥𝑛𝑛

How about if we have exponential functions?


𝑓𝑓𝑥𝑥=𝑒𝑒−𝑥𝑥−𝑥𝑥
Graphically, we know that the root is when 𝑓𝑓𝑥𝑥=0. Another Option: Trial and Error by Guessing
This is the point when the curve crosses the x-axis.

𝑓𝑓𝑥𝑥=𝑎𝑎𝑥𝑥2+𝑏𝑏𝑥𝑥+𝑐𝑐
What values of x will make 𝑓𝑓(𝑥𝑥)=0? Disadvantages:
- Time-consuming
- You will only be as good as your guesses.

With the advent of computers and numerical models,


we can now solve for the roots of equations.

Disadvantage of Graphical Method:


lacks precision
BISECTION METHOD
Concept:

 Start with 2 numbers as the bracket or extent of our guesses. 𝒙𝒙𝒍𝒍 and 𝒙𝒙𝒖𝒖
 𝑓𝑓(𝑥𝑥) changes sign on opposite sides of the root; meaning 𝒇𝒇(𝒙𝒙𝒍𝒍)𝒇𝒇(𝒙𝒙𝒖𝒖)<𝟎𝟎

 Within the two initial guesses or the interval, the point where the function changes sign is identified by
estimating it to be the midpoint of the two numbers.
 If a function changes sign over an interval, the function value at the midpoint is evaluated.
 The location of the root is then determined as lying at the midpoint of the subinterval within which the sign
change occurs.
 The process is repeated to obtain refined estimates. ALTERNATE NAME:
Binary chopping,
Interval halving,
or Bolzano’s method
STEP 1: Choose lower 𝑥𝑥𝑙𝑙 and upper 𝑥𝑥𝑢𝑢 guesses for the root
such that the function changes sign over the interval.
𝑪𝑪𝑯𝑯𝑬𝑬𝑪𝑪𝑲𝑲: 𝒇𝒇𝒙𝒙𝒍𝒍𝒇𝒇𝒙𝒙𝒖𝒖<𝟎𝟎

𝑋𝑋𝑙𝑙 + 𝑋𝑋𝑢𝑢
STEP 2: An estimate of the root 𝑥𝑥𝑟𝑟 is determined by 𝑋𝑋𝑟𝑟 =
2

STEP 3: Make the following evaluations to determine in which


subinterval the root lies:
a. If 𝑓𝑓𝑥𝑥𝑙𝑙𝑓𝑓𝑥𝑥𝑟𝑟 < 0, the root lies in the lower subinterval. Set 𝒙𝒙𝒖𝒖=𝒙𝒙𝒓𝒓 and
return to step 2.
b. If 𝑓𝑓𝑥𝑥𝑙𝑙𝑓𝑓𝑥𝑥𝑟𝑟 > 0, the root lies in the upper subinterval. Set 𝒙𝒙𝒍𝒍=𝒙𝒙𝒓𝒓 and
return to step 2.
c. If 𝑓𝑓𝑥𝑥𝑙𝑙𝑓𝑓𝑥𝑥𝑟𝑟 = 0, the root equals 𝑥𝑥𝑟𝑟, terminate the computation.
Use the bisection method to solve the drag coefficient needed for a
parachutist of mass 𝑚𝑚 = 68.1𝑘𝑘𝑔𝑔 to have a velocity of 40 m/s after
free-falling for time 𝑡𝑡 =10 𝑠𝑠. Error = 0.05%

Common value of drag


coefficient (12 – 16 kg/s)
Use bisection to determine the drag coefficient needed
so that an 82-kg parachutist has a velocity of 36 m/s
after 4 s of free fall.

Note: The acceleration of gravity is 9.81 m/s2. Start


with initial guesses of xl =3 and xu = 5 and iterate
until the approximate relative error falls below 2%.
Also perform an error check by substituting your final
answer into the original equation.
You buy a $35,000 vehicle for nothing down at $8,500 per
year for 7 years. Use the bisect function provided to
determine the interest rate that you are paying. Employ
initial guesses for the interest rate of 0.01 and 0.3 and a
stopping criterion of 0.00005. The formula relating present
worth P, annual payments A, number of years n, and
interest rate.
FALSE POSITION METHOD

A shortcoming of the bisection method


is that, in dividing the interval from xl to
xu into equal halves, no account is taken
of the magnitudes of f(xl) and f(xu).

ALTERNATE NAME:
Regula Falsi Method
or Linear Interpolation
STEP 1: Choose lower 𝑥𝑥𝑙𝑙 and upper 𝑥𝑥𝑢𝑢 guesses for the root
such that the function changes sign over the interval.
𝑪𝑪𝑯𝑯𝑬𝑬𝑪𝑪𝑲𝑲: 𝒇𝒇𝒙𝒙𝒍𝒍𝒇𝒇𝒙𝒙𝒖𝒖<𝟎𝟎

𝑓𝑓(𝑋𝑋𝑢𝑢 )(𝑋𝑋𝑙𝑙 −𝑋𝑋𝑢𝑢 )


STEP 2: An estimate of the root 𝑥𝑥𝑟𝑟 is determined by 𝑋𝑋𝑟𝑟 = 𝑋𝑋𝑢𝑢 −
𝑓𝑓(𝑋𝑋𝑙𝑙 )−𝑓𝑓(𝑋𝑋𝑢𝑢 )

STEP 3: Make the following evaluations to determine in which


subinterval the root lies:
a. If 𝑓𝑓𝑥𝑥𝑙𝑙𝑓𝑓𝑥𝑥𝑟𝑟 < 0, the root lies in the lower subinterval. Set 𝒙𝒙𝒖𝒖=𝒙𝒙𝒓𝒓 and
return to step 2.
b. If 𝑓𝑓𝑥𝑥𝑙𝑙𝑓𝑓𝑥𝑥𝑟𝑟 > 0, the root lies in the upper subinterval. Set 𝒙𝒙𝒍𝒍=𝒙𝒙𝒓𝒓 and
return to step 2.
c. If 𝑓𝑓𝑥𝑥𝑙𝑙𝑓𝑓𝑥𝑥𝑟𝑟 = 0, the root equals 𝑥𝑥𝑟𝑟, terminate the computation.
Determine the roots of f (x) = - 12 - 21x + 18x2 - 2.75x3
graphically. In addition, determine the first root of the
function with (a) bisection, and (b) false position. For (c) and
(d) use initial guesses of xl = -1 and xu = 0, and a stopping
criterion of 1%.
Find the positive real root of f (x) = x4 - 8x3 - 35x2 + 450x -
1001 using the false-position method. Use initial guesses of
xl = 4.5 and xu = 6 and perform five iterations. Compute
both the true and approximate errors based on the fact that
the root is 5.60979. Use a plot to explain your results and
perform the computation to within es = 1.0%.
OPEN METHODS
Not dependent on convergence of the function
Require only single starting value of x or 2 starting values that do not necessarily bracket the root

SIMPLE FIXED
POINT SECANT
ITERATION METHOD
METHOD NEWTON – RAPHSON
METHOD
SIMPLE FIXED POINT ITERATION METHOD

Can be done by re-arranging the function 𝑓𝑓𝑥𝑥 = 0 such that x is on the left-hand side of the equation
become 𝑥𝑥 = 𝑔𝑔(𝑥𝑥)
SAMPLE: Find the root of the equation x2 – x – 1 = 0

SIMPLE FIXED POINT


𝑥𝑥 = 𝑔𝑔(𝑥𝑥) i x g(x)
By re-expressing the equation: 1 0 -1
1 2 -1 -0.5
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 3 -0.5 -0.66667
𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 −1 4 -0.66667 -0.6
input output
5 -0.6 -0.625
6 -0.625 -0.61538
7 -0.61538 -0.61905
x g(x) 8 -0.61905 -0.61765
12 -0.61806 -0.61803
13 -0.61803 -0.61804
Root of Equation 14 -0.61804 -0.61803
SIMPLE FIXED POINT ITERATION METHOD

SAMPLE: Find the root of the equation x2 – x – 1 = 0

SIMPLE FIXED POINT


By re-expressing the equation:
i x g(x)
1
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 1 + 1 1 2
𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 2 2 1.5
3 1.5 1.666667
4 1.666667 1.6
5 1.6 1.625
x g(x) 6 1.625 1.615385
7 1.615385 1.619048
8 1.619048 1.617647
12 1.618056 1.618026
13 1.618026 1.618037
Root of Equation 14 1.618037 1.618033
NEWTON – RAPHSON METHOD

If the initial guess at the root is xi, a tangent can be extended from the point [𝑥𝑥𝑖𝑖,𝑓𝑓(𝑥𝑥𝑖𝑖)].

The point where this tangent crosses the x axis usually represents an improved estimate of the root.
𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟
𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 =
𝑟𝑟𝑟𝑟𝑟𝑟
𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 − 0
𝑓𝑓𝑓(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 ) =
𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 − 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛
f(xold)
𝑓𝑓𝑓(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 )(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 − 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 ) = 𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜

𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜
𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 − 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 =
𝑓𝑓𝑓(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 )

𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 Newton – Raphson’s


xnew xold 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 −
𝑓𝑓𝑓(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 ) Equation
NEWTON – RAPHSON METHOD

SAMPLE: Find the root of the equation x2 – x – 1 = 0 using newton – Raphson method

𝑙𝑙𝑒𝑒𝑒𝑒 𝑥𝑥𝑜𝑜 = 1 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 − 𝑥𝑥𝑜𝑜𝑙𝑙𝑙𝑙


𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 𝜖𝜖 =
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 − 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛
𝑓𝑓𝑓(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 )
12 − 1 − 1
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 =1−
2(1) − 1 NEWTON - RAPHSON METHOD
𝑓𝑓 𝑥𝑥𝑜𝑜 = 𝑥𝑥 2 − 𝑥𝑥 − 1 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 =2 i x f(x) f'(x) Relative Error
1 1 -1 1
𝑓𝑓′ 𝑥𝑥𝑜𝑜 = 2𝑥𝑥 − 1 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝑙𝑙𝑒𝑒𝑒𝑒 𝑥𝑥1 = 2 2 2 1 3 50%
3 1.666667 0.111111 2.333333 20%
22 − 2 − 1 4 1.619048 0.002268 2.238095 3%
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 =2− 5 1.618034 1.03E-06 2.236069 0%
2(2) − 1
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 1.667
SECANT METHOD
There are functions when the first derivative is extremely difficult or inconvenient to evaluate.
For such cases, the derivative can be approximated by a backward finite divided difference.

f(xa)
f(xb)
f(xold)

xnew xold xnew xb xa


SECANT METHOD
𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 −
𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠
f(xa) 𝑓𝑓 𝑥𝑥𝑎𝑎 − 𝑓𝑓 𝑥𝑥𝑏𝑏
f(xb) 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠 =
f(xold) 𝑥𝑥𝑎𝑎 − 𝑥𝑥𝑏𝑏

𝑓𝑓 𝑥𝑥𝑎𝑎 (𝑥𝑥𝑎𝑎 − 𝑥𝑥𝑏𝑏 )


𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑎𝑎 −
𝑓𝑓 𝑥𝑥𝑎𝑎 − 𝑓𝑓 𝑥𝑥𝑏𝑏

xnew xold xnew xb xa

Newton – Raphson’s Equation Secant Method


Secant Method
𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 𝑓𝑓 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 − 𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 −
𝑓𝑓𝑓(𝑥𝑥𝑜𝑜𝑜𝑜𝑜𝑜 ) 𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠𝑠
SECANT METHOD
SAMPLE: Find the root of the equation x2 – x – 1 = 0 using Secant
f(xa) method
f(xb)

Secant Method
i xa xb f(xa) f(xb) Relative error
1 3.5 2.5 1.775 -0.475
xnew xb xa 2 2.5 2.71111 -0.475 -0.4515 7.79%
3 2.71111 6.77026 -0.4515 103.679 59.96%
4 6.77026 2.72871 38.0661 3.71716 148.11%
Secant Method 5 2.72871 2.29135 3.71716 1.95892 19.09%
𝑓𝑓 𝑥𝑥𝑎𝑎 (𝑥𝑥𝑎𝑎 − 𝑥𝑥𝑏𝑏 ) 6 2.29135 1.80406 1.95892 0.45057 27.01%
𝑥𝑥𝑛𝑛𝑛𝑛𝑛𝑛 = 𝑥𝑥𝑎𝑎 −
𝑓𝑓 𝑥𝑥𝑎𝑎 − 𝑓𝑓 𝑥𝑥𝑏𝑏

You might also like