You are on page 1of 41

Module 2

Solving of Algebraic and


Transcendental Equations

Engr. Gerard Ang


School of EECE
Methods Used in Solving
Non-Linear Equations
A. Graphical Method
B. Analytical Method
1. Direct Methods - give the exact value of the roots in a
finite number of steps. Direct methods determine all
the roots at the same time.
2. Indirect or Iterative Methods - are based on the
concept of successive approximations. The general
procedure is to start with one or more initial
approximation (or guess) to the root and obtain a
sequence of iterates which in the limit converges to the
actual or true solution to the root.
Graphical Method
Find the root of f(x) = x3 + x2 – 3x – 3.
Using Matlab to graphically locate the roots,
150
>> x = -5:0.001:5;
>> y = x.^3 + x.^2 - 3.*x - 3;
100
>> plot(x,y)
>> grid
>> 50

-50

-100
-5 -4 -3 -2 -1 0 1 2 3 4 5
Indirect or Iterative Methods
A. Bracketing Methods – these are methods based on
two initial guesses that bracket a root.
1. Bisection Method
2. Method of False Position (Regula Falsi Method)
3. Secant Method
B. Non-Bracketing (Open) Methods – based on one or
more initial estimation (guess) of the solution that
does not bracket a root.
1. Newton-Raphson Method (Newton's Method)
2. Successive Approximation Method (Fixed Point
Iteration)
Bisection (or Interval Halving) Method
After a root of f(x) = 0 has been
bracketed in the interval (a, b).
Bisection method can be used to close
in on it. The Bisection method
accomplishes this by successfully
halving the interval until it becomes
sufficiently small.

Algorithm for the Bisection Method


Step 1 Define c = (a + b)/2
Step 2 If f(c)*f(a) < 0 then set b = c.
Otherwise set a = c.
Step 3 If |a – b| < tolerance then
accept c as the root and stop else go
back to step 1.
Sample Problem
on Bisection Method

Find the root of f(x) = x3 + x2 – 3x – 3


starting with a = 1 and b = 2 with tolerance
value of 0.0001 using bisection method.
Excel Output for Bisection Method
Find the root of f(x) = x3 + x2 – 3x – 3 starting with a = 1 and b = 2 with tolerance value of
0.0001 using bisection method.
f(x) = x^3 + x^2 - 3x - 3
a=1 b=2
tol = 0.0001

n a b c f(c) f(a) f(c)*f(a) < 0 |a - b| < tol tol


1 1.000000 2.000000 1.500000 -1.875000 -4.000000 FALSE FALSE 0.0001
2 1.500000 2.000000 1.750000 0.171875 -1.875000 TRUE FALSE 0.0001
3 1.500000 1.750000 1.625000 -0.943359 -1.875000 FALSE FALSE 0.0001
4 1.625000 1.750000 1.687500 -0.409424 -0.943359 FALSE FALSE 0.0001
5 1.687500 1.750000 1.718750 -0.124786 -0.409424 FALSE FALSE 0.0001
6 1.718750 1.750000 1.734375 0.022030 -0.124786 TRUE FALSE 0.0001
7 1.718750 1.734375 1.726563 -0.051755 -0.124786 FALSE FALSE 0.0001
8 1.726563 1.734375 1.730469 -0.014957 -0.051755 FALSE FALSE 0.0001
9 1.730469 1.734375 1.732422 0.003513 -0.014957 TRUE FALSE 0.0001
10 1.730469 1.732422 1.731445 -0.005728 -0.014957 FALSE FALSE 0.0001
11 1.731445 1.732422 1.731934 -0.001109 -0.005728 FALSE FALSE 0.0001
12 1.731934 1.732422 1.732178 0.001201 -0.001109 TRUE FALSE 0.0001
13 1.731934 1.732178 1.732056 0.000046 -0.001109 TRUE FALSE 0.0001
14 1.731934 1.732056 1.731995 -0.000532 -0.001109 FALSE FALSE 0.0001
15 1.731995 1.732056 1.732025 -0.000243 -0.000532 FALSE TRUE 0.0001
16 1.732025 1.732056 0.0001

After 15 iterations, root is 1.732025


Secant Method
The secant method is a root-
finding algorithm that uses a
succession of roots of secant
lines to better approximate a
root of a function f(x).
A secant line of a curve is a line that (locally)
intersects two points on the curve

Algorithm for the Secant Method:


If |f(x0)| < |f(x1)| swap x0 with x1
Step 1 Define x2 = x0 – f(x0)*(x0 – x1)/[f(x0) – f(x1)]
Step 2 Set x0 = x1 and x1 = x2.
Step 3 If |f(x2)| < tolerance then accept x2 as the root
and stop else go back to step 1.
Sample Problem in
Secant Method

Find the root of f(x) = x3 + x2 – 3x – 3


starting with x0 = 1 and x1 = 2 with tolerance
value of 0.0001 using secant method.
Excel Output for Secant Method
Find the root of f(x) = x3 + x2 – 3x – 3 starting with x0 = 1 and x1 = 2 with
tolerance value of 0.0001 using secant method.

f(x) = x^3 + x^2 - 3x - 3


x0 = 1 x1 = 2
tol = 0.0001
xo x1 f(x0) f(x1) |f(x0)| < |f(x1)|
1 2 -4 3 FALSE

n x0 x1 f(x0) f(x1) x2 f(x2) tol f(x2) < tol


1 1.000000 2.000000 -4.000000 3.000000 1.571429 -1.364431 0.0001 FALSE
2 2.000000 1.571429 3.000000 -1.364431 1.705411 -0.247745 0.0001 FALSE
3 1.571429 1.705411 -1.364431 -0.247745 1.735136 0.029255 0.0001 FALSE
4 1.705411 1.735136 -0.247745 0.029255 1.731996 -0.000515 0.0001 FALSE
5 1.735136 1.731996 0.029255 -0.000515 1.732051 -0.000001 0.0001 TRUE
6 1.731996 1.732051 0.0001
After 5 iterations, the root converges to 1.732051
Regula Falsi (or False Position or
Linear Interpolation) Method
The regula falsi method is similar to
bisection method except the next iterate is
taken at the intersection of a line between the
pair of x-values and the x-axis rather than at
the midpoint. Doing so gives faster
convergence than does bisection but at the
expense of a more complicated algorithm. It
combines the features of the bisection and
secant method.

Algorithm for the False Position Method:


Step 1 Define c = a – f(a)*(a – b)/[(f(a) – f(b)]
Step 2 If f(c) is opposite sign to f(a) then
set b = c else set a = c.
Step 3 If |f(c)| < tolerance then accept c as the
root and stop else return to step 1.
Sample Problem
in Regula Falsi
Find the root of f(x) = x3 + x2 – 3x – 3 = 0
accurate to within 0.0001 using regula falsi
method.
Excel Output for Regula Falsi
Find the root of f(x) = x3 + x2 – 3x – 3 = 0 accurate to
within 0.0001 using regula falsi method.

f(x) = x^3 + x^2 - 3x - 3


a=1 b=2
tol = 0.0001

n a b f(a) f(b) c f(c) |f(c)| < tol tol


1 1.000000 2.000000 -4.000000 3.000000 1.571429 -1.364431 FALSE 0.0001
2 1.571429 2.000000 -1.364431 3.000000 1.705411 -0.247745 FALSE 0.0001
3 1.705411 2.000000 -0.247745 3.000000 1.727883 -0.039340 FALSE 0.0001
4 1.727883 2.000000 -0.039340 3.000000 1.731405 -0.006111 FALSE 0.0001
5 1.731405 2.000000 -0.006111 3.000000 1.731951 -0.000946 FALSE 0.0001
6 1.731951 2.000000 -0.000946 3.000000 1.732035 -0.000146 FALSE 0.0001
7 1.732035 2.000000 -0.000146 3.000000 1.732048 -0.000023 TRUE 0.0001
8 1.732048 2.000000 0.0001

After 7 iterations, the root converges to 1.732048


Successive Approximation Method
or Fixed Point Iteration
The fixed point iteration is a method of computing fixed points
of iterated functions. Suppose we are given an equation f(x) = 0
whose roots are to be determined. The equation can be written
as
𝑥 = 𝑓(𝑥)
More specifically, given a function f(x) defined on the real
numbers with real values and given a point x0 in the domain of f,
the fixed point iteration is
𝑥𝑛+1 = 𝑓(𝑥𝑛 ) where: n = 0, 1, 2, …
which gives rise to the sequence which is hoped to converge to
a point x. If f is continuous, then one can prove that the obtained
x is a fixed point of f(x).
Sample Problem
in Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
initial guess = 1 tolerance = 0.001
First Arrangement:
x = sqrt(2x + 3)
n xn xn+1 |xn+1 - xn| < tol tol
0 1.0000000 2.2360680 FALSE 0.0001
1 2.2360680 2.7335208 FALSE 0.0001
2 2.7335208 2.9098181 FALSE 0.0001
3 2.9098181 2.9697872 FALSE 0.0001
4 2.9697872 2.9899121 FALSE 0.0001
5 2.9899121 2.9966355 FALSE 0.0001
6 2.9966355 2.9988783 FALSE 0.0001
7 2.9988783 2.9996261 FALSE 0.0001
8 2.9996261 2.9998754 FALSE 0.0001
9 2.9998754 2.9999585 TRUE 0.0001
After 9 iterations, the root converges to 2.999585
Sample Problem in Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
initial guess = 1 tolerance = 0.001
Second Arrangement
x = 3/(x - 2)
n xn xn+1 |xn+1 - xn| < tol tol
0 1.0000000 -3.0000000 FALSE 0.0001
1 -3.0000000 -0.6000000 FALSE 0.0001
2 -0.6000000 -1.1538462 FALSE 0.0001
3 -1.1538462 -0.9512195 FALSE 0.0001
4 -0.9512195 -1.0165289 FALSE 0.0001
5 -1.0165289 -0.9945205 FALSE 0.0001
6 -0.9945205 -1.0018298 FALSE 0.0001
7 -1.0018298 -0.9993904 FALSE 0.0001
8 -0.9993904 -1.0002032 FALSE 0.0001
9 -1.0002032 -0.9999323 FALSE 0.0001
10 -0.9999323 -1.0000226 TRUE 0.0001
After 10 iterations, the root converges to -1.0000226
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.

initial guess = 1
Third Arrangement
x = (x^2 - 3)/2
n xn xn+1 |xn+1 - xn| < tol tol
0 1.0000000 -1.0000000 FALSE 0.0001
1 -1.0000000 -1.0000000 TRUE 0.0001
After 1 iteration, the root converges to -1.0000000
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
initial guess = 4 tolerance = 0.0001
First Arrangement:
x = sqrt(2x + 3)
n xn xn+1 |xn+1 - xn| < tol tol
0 4.0000000 3.3166248 FALSE 0.0001
1 3.3166248 3.1037477 FALSE 0.0001
2 3.1037477 3.0343855 FALSE 0.0001
3 3.0343855 3.0114400 FALSE 0.0001
4 3.0114400 3.0038109 FALSE 0.0001
5 3.0038109 3.0012700 FALSE 0.0001
6 3.0012700 3.0004233 FALSE 0.0001
7 3.0004233 3.0001411 FALSE 0.0001
8 3.0001411 3.0000470 TRUE 0.0001
9 3.0000470 3.0000157 TRUE 0.0001
After 9 iterations, the root converges to 3.0000157
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.
initial guess = 4 tolerance = 0.0001
Second Arrangement
x = 3/(x - 2)
n xn xn+1 |xn+1 - xn| < tol tol
0 4.0000000 1.5000000 FALSE 0.0001
1 1.5000000 -6.0000000 FALSE 0.0001
2 -6.0000000 -0.3750000 FALSE 0.0001
3 -0.3750000 -1.2631579 FALSE 0.0001
4 -1.2631579 -0.9193548 FALSE 0.0001
5 -0.9193548 -1.0276243 FALSE 0.0001
6 -1.0276243 -0.9908759 FALSE 0.0001
7 -0.9908759 -1.0030506 FALSE 0.0001
8 -1.0030506 -0.9989842 FALSE 0.0001
9 -0.9989842 -1.0003387 FALSE 0.0001
10 -1.0003387 -0.9998871 FALSE 0.0001
11 -0.9998871 -1.0000376 FALSE 0.0001
12 -1.0000376 -0.9999875 TRUE 0.0001
After 12 iterations, the root converges to -0.9999875
Excel Output for Fixed Point Iteration
Use simple fixed-point iteration to locate the root of f(x)
= x2 – 2x – 3 = 0.

initial guess = 4 tolerance = 0.0001


Third Arrangement
x = (x^2 - 3)/2 tol
n xn xn+1 |xn+1 - xn| < tol 0.0001
0 4.0000000 6.5000000 FALSE 0.0001
1 6.5000000 19.6250000 FALSE 0.0001
2 19.6250000 191.0703125 FALSE 0.0001
3 191.0703125 18252.4321594 FALSE
The iterates are diverging and never converges to a certain root.
Newton’s Method
The Newton-Raphson method
is the best-known method of
finding roots of a function f(x).
The method is simple and fast.
One drawback of this method is
that it uses the derivative f'(x) of
the function as well as the
function f(x) itself. Hence, the
Newton-Raphson method is
usable only in problems where 𝑓(𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
f'(x) can be readily computed. 𝑓′(𝑥𝑛 )

Where: n = 0, 1, 2, …
Sample Problems in
Newton’s Method
1. Find the root of f(x) = x6 – x – 1 = 0 accurate
to within 0.001 using Newton’s method.
2. Use Newton’s method to approximate the
positive root of x5 – 2 = 0 accurate to four
decimal places.
3. Approximate one real root of the non−linear
equation f(x) = x2 + 4x + 3 + sin x – xcos x to
four decimal places using Newton’s method.
Excel Output for Newton’s Method
1. Find the root of f(x) = x6 – x – 1 = 0 accurate to within
0.001 using Newton’s method.
x^6 - x - 1 = 0
tolerance = 0.001
f(x) = x^6 - x - 1 = 0 f'(x) = 6x^5 - 1

initial guess = 1
n xn xn+1 |x+1 - xn| < tol tol
0 1.0000000 1.2000000 FALSE 0.0001
1 1.2000000 1.1435758 FALSE 0.0001
2 1.1435758 1.1349095 FALSE 0.0001
3 1.1349095 1.1347242 FALSE 0.0001
4 1.1347242 1.1347241 TRUE 0.0001
After 4 iterations, the root converges to 1.1347241

initial guess = -1
n xn xn+1 |x+1 - xn| < tol tol
0 -1.0000000 -0.8571429 FALSE 0.0001
1 -0.8571429 -0.7899519 FALSE 0.0001
2 -0.7899519 -0.7783727 FALSE 0.0001
3 -0.7783727 -0.7780898 FALSE 0.0001
4 -0.7780898 -0.7780896 TRUE 0.0001
After 4 iterations, the root converges to -0.7780896
Excel Output for Newton’s Method
2. Use Newton’s method to fifth root of 2
f(x) = x^5 - 2 f'(x) = 5x^4
approximate the positive
root of x5 – 2 = 0 accurate initial guess = 32
n xn
tolerance = 0.001
xn+1 |x+1 - xn| < tol tol
to four decimal places. 0 32.0000000 25.6000004 FALSE 1.00E-12
1 25.6000004 20.4800012 FALSE 1.00E-12
2 20.4800012 16.3840033 FALSE 1.00E-12
3 16.3840033 13.1072082 FALSE 1.00E-12
4 13.1072082 10.4857801 FALSE 1.00E-12
5 10.4857801 8.3886572 FALSE 1.00E-12
6 8.3886572 6.7110065 FALSE 1.00E-12
7 6.7110065 5.3690024 FALSE 1.00E-12
8 5.3690024 4.2956833 FALSE 1.00E-12
9 4.2956833 3.4377213 FALSE 1.00E-12
10 3.4377213 2.7530411 FALSE 1.00E-12
11 2.7530411 2.2093961 FALSE 1.00E-12
12 2.2093961 1.7843036 FALSE 1.00E-12
13 1.7843036 1.4669054 FALSE 1.00E-12
14 1.4669054 1.2599120 FALSE 1.00E-12
15 1.2599120 1.1666743 FALSE 1.00E-12
16 1.1666743 1.1492438 FALSE 1.00E-12
17 1.1492438 1.1486989 FALSE 1.00E-12
18 1.1486989 1.1486984 FALSE 1.00E-12
19 1.1486984 1.1486984 TRUE 1.00E-12
After 19 iterations, the root converges to 1.1486984
Excel Output for Newton’s Method
3. Approximate one real root of the non−linear equation
f(x) = x2 + 4x + 3 + sin x – xcos x to four decimal
places using Newton’s method.

f(xn) = xn^2 + 4xn + 3 + sinxn - xncosxn


f'(xn) = 2xn + 4 + xnsinxn
tolerance = 0.0001

initial guess = 1

n xn f(xn) f'(xn) xn+1 |xn+1 - xn| < tol tol


0 1.0000 8.3012 6.8415 -0.2134 FALSE 0.0001
1 -0.2134 2.1889 3.6185 -0.8183 FALSE 0.0001
2 -0.8183 0.2258 2.9608 -0.8945 FALSE 0.0001
3 -0.8945 0.0020 2.9086 -0.8952 FALSE 0.0001
4 -0.8952 0.0000 2.9081 -0.8952 TRUE 0.0001
After 4 iterations, the root converges to -0.8952
Modified Newton Raphson Method

The iteration scheme in modified Newton-Raphson


method is given by
𝑓 𝑥𝑛
𝑥𝑛+1 = 𝑥𝑛 −
𝑓′ 𝑥𝑛 +𝑎 𝑥𝑛 +𝑓 𝑥𝑛
Where:
1
𝑎 𝑥𝑛 = −
2𝑓′ (𝑥𝑛 )
where: a(x) is a smoothing function
Substituting a(x) in the above equation,
𝑓(𝑥𝑛 )𝑓′ (𝑥𝑛 )
𝑥𝑛+1 = 𝑥𝑛 −
[𝑓′ 𝑥𝑛 ]2 −𝑓 𝑥𝑛 𝑓′′ 𝑥𝑛
Sample Problem in
Modified Newton Raphson Method
Solve f(x) = x4 – 11x + 8 using modified Newton-
Raphson modified near 2 with tolerance value of
0.00001.
Excel Output for
Modified Newton Raphson Method
Solve f(x) = x4 – 11x + 8 using modified Newton-
Raphson modified near 2 with tolerance value of
0.00001.

n xn f(xn) f'(xn) f''(xn) xn+1 |xn+1 - xn| < tol tol

0 2.00000 2.00000 21.00000 48.00000 1.87826 FALSE 0.00001

1 1.87826 -0.21505 15.50499 42.33437 1.89162 FALSE 0.00001

2 1.89162 -0.00405 16.07476 42.93891 1.89188 FALSE 0.00001

3 1.89188 0.00000 16.08557 42.95034 1.89188 TRUE 0.00001

After 3 iterations, the roots converges to 1.89188


Muller’s Method
Muller’s method is based on approximating the function in the neighborhood of
the root by a quadratic polynomial. This gives a much closer to the actual curve.
A second degree-polynomial is made to fit three points near a root, [x0, f(x0)], [x1,
f(x1)], [x2, f(x2)], and the proper zero of this quadratic, using the quadratic formula,
is used as the improved estimate of the root. The process is then repeated using
the set of three points nearest the roots being evaluated.
f(x)
ℎ0 = 𝑥1 − 𝑥0 ℎ1 = 𝑥2 − 𝑥1
(x0, f0) y = f(x)
𝑓 𝑥1 − 𝑓(𝑥0 ) 𝑓 𝑥2 − 𝑓(𝑥1 )
𝛿0 = 𝛿1 =
𝑥1 − 𝑥0 𝑥2 − 𝑥1
(x1, f1)
Parabola
= ax2 + bx + c 𝛿1 − 𝛿0
𝑎=
ℎ1 + ℎ0 𝑐 = 𝑓(𝑥2 )
x 𝑏 = 𝑎ℎ1 + 𝛿1
(x2, f2)

2𝑐
h1 h2 𝑥3 = 𝑥2 −
𝑏 ± 𝑏2 − 4𝑎𝑐
Muller’s Method

Algorithm for Muller’s Method:


Step 1 Evaluate f0, f1, f2
Step 2 Solve for a, b and c.
Step 3 If 𝑏 + 𝑏 2 − 4𝑎𝑐 > 𝑏 − 𝑏 2 − 4𝑎𝑐 then use
+ 𝑏2 − 4𝑎𝑐 otherwise use − 𝑏 2 − 4𝑎𝑐
Step 4 Solve for x3.
Step 5 If |x3 - x2| < tolerance accept x3 as the root
and stop otherwise set x0 = x1, x1 = x2, x2 =
x3 and return to step 1.
Sample Problems in Muller’s Method

1. Find a root using Muller’s method between 0 and 1 of


the transcendental function f(x) = 3x + sin(x) – ex.
Tolerance = 0.0001.
2. Use Muller’s method with guesses of 4.5, 5.5 and 5 to
determine a root of the equation f(x) = x3 – 13x – 12
with tolerance value of 0.0001.
Excel Output for Muller’s Method
1. Find a root using Muller’s method between 0 and 1 of
the transcendental function f(x) = 3x + sin(x) – ex.
Tolerance = 0.0001
n x0 x1 x2 n x0 x1 x2 n x0 x1 x2
1 0.0000 0.5000 1.0000 2 0.5000 1.0000 0.3549 3 1.0000 0.3549 0.3603
f(x0) f(x1) f(x2) f(x0) f(x1) f(x2) f(x0) f(x1) f(x2)
-1.0000 0.3307 1.1232 0.3307 1.1232 -0.0138 1.1232 -0.0138 -0.0002

h0 h1 h0 h1 h0 h1

0.5000 0.5000 0.5000 -0.6451 -0.6451 0.0054

d0 d1 d0 d1 d0 d1

2.6614 1.5850 1.5850 1.7625 1.7625 2.5068


a b c a b c a b c
-1.0764 1.0468 1.1232 -1.2240 2.5521 -0.0138 -1.1635 2.5005 -0.0002
discr |b + discr| > |b - discr| discr |b + discr| > |b - discr| discr |b + discr| > |b - discr|
2.4355 TRUE 2.5388 TRUE 2.5003 TRUE
den 3.4823 den 5.0909 den 5.0008
x3 tol x3 tol x3 tol
0.3549 0.0001 0.3603 0.0001 0.3604 0.0001
|x3 - x2| < tol FALSE |x3 - x2| < tol FALSE |x3 - x2| < tol TRUE
Excel Output for Muller’s Method

2. Use Muller’s method with guesses of 4.5, 5.5 and 5 to


determine a root of the equation f(x) = x3 – 13x – 12
with tolerance value of 0.0001.
n 1 n 2 n 3 n 4
x0 x1 x2 x0 x1 x2 x0 x1 x2 x0 x1 x2
4.5000 5.5000 5.0000 5.5000 5.0000 3.9765 5.0000 3.9765 4.0011 3.9765 4.0011 4.0000
f(x0) f(x1) f(x2) f(x0) f(x1) f(x2) f(x0) f(x1) f(x2) f(x0) f(x1) f(x2)
20.6250 82.8750 48.0000 82.8750 48.0000 -0.8163 48.0000 -0.8163 0.0368 -0.8163 0.0368 0.0000
h0 h1 h0 h1 h0 h1 h0 h1
1.0000 -0.5000 -0.5000 -1.0235 -1.0235 0.0246 0.0246 -0.0010
d0 d1 d0 d1 d0 d1 d0 d1
62.2500 69.7500 69.7500 47.6949 47.6949 34.7310 34.7310 35.0126
a b c a b c a b c a b c
15.0000 62.2500 48.0000 14.4765 32.8780 -0.8163 12.9775 35.0498 0.0368 11.9775 35.0000 0.0000
discr |b + discr| > |b - discr| discr |b + discr| > |b - discr| discr |b + discr| > |b - discr| discr |b + discr| > |b - discr|
31.5446 TRUE 33.5892 TRUE 35.0225 TRUE 35.0000 TRUE
den 93.7946 den 66.4672 den 70.0723 den 70.0001
x3 tol x3 tol x3 tol x3 tol
3.9765 0.0001 4.0011 0.0001 4.0000 0.0001 4.0000 0.0001
|x3 - x2| < tol FALSE |x3 - x2| < tol FALSE |x3 - x2| < tol FALSE |x3 - x2| < tol TRUE
Bairstow’s Method
Bairstow's method is an iterative approach related loosely to both
Newton and Muller’s method. The algorithm was developed by Leonard
Bairstow in 1920. The algorithm finds the roots in complex conjugate
pairs using only real arithmetic.
Bairstow's approach is to use Newton’s method to adjust the
coefficients r and s in the quadratic polynomial x2 – rx - s until its roots
are also roots of the polynomial being solved. The roots of the
quadratic may then be determined, and the polynomial may be divided
by the quadratic to eliminate those roots. This process is then iterated
until the polynomial becomes quadratic or linear, and all the roots have
been determined.
𝑓 𝑥 = 𝑎𝑛 𝑥 𝑛 + ⋯ + 𝑎2 𝑥 2 + 𝑎1 𝑥 + 𝑎0
𝑓 𝑥 = 𝑥 2 − 𝑟𝑥 − 𝑠 𝑏𝑛 𝑥 𝑛−2 + ⋯ + 𝑏𝑛−1 𝑥 𝑛−3 + 𝑏3 𝑥 + 𝑏2
+𝑏1 𝑥 − 𝑟 + 𝑏0
Bairstow’s Method
On multiplying out and equating coefficient of like powers of x, we will get
𝑏𝑛 = 𝑎𝑛
𝑏𝑛−1 = 𝑎𝑛−1 + 𝑟𝑏𝑛
𝑏𝑖 = 𝑎𝑖 + 𝑟𝑏𝑖+1 + 𝑠𝑏𝑖+2 For i = n – 2 to 0

𝑐𝑛 = 𝑏𝑛
𝑐𝑛−1 = 𝑏𝑛−1 + 𝑟𝑐𝑛
𝑐𝑖 = 𝑏𝑖 + 𝑟𝑐𝑖+1 + 𝑠𝑐𝑖+2 For i = n – 2 to 0

𝑐2 Δ𝑟 + 𝑐3 Δ𝑠 = −𝑏1 𝑟𝑛+1 = 𝑟𝑛 + Δ𝑟
𝑐1 Δ𝑟 + 𝑐2 Δ𝑠 = −𝑏0 𝑠𝑛+1 = 𝑠𝑛 + Δ𝑠

The roots can be determined by:


𝑟± 𝑟 2 +4𝑠
𝑥=
2
Sample Problems in
Bairstow’s Method
1. Using Bairstow’s method, find the quadratic factors of
x4 – 1.1x3 + 2.3x2 + 0.5x + 3.3 = 0
Use x2 + x + 1 as starting factor (r = -1, s = -1).
(Frequently r = s = 0 are used as starting values if no
information as to an approximate factor is known.)

2. Employ Bairstow’s method, to determine the roots of


the polynomial
x5 – 3.5x4 + 2.75x3 + 2.125x2 – 3.875x + 1.25 = 0
Use initial guess of r = s = -1 and tolerance of 0.0001
Excel Output for Bairstow’s Method
Find the quadratic factors of
x4 – 1.1x3 + 2.3x2 + 0.5x + 3.3 = 0
Use x2 + x + 1 as starting factor (r = -1, s = -1). (Frequently r = s = 0 are used as
starting values if no information as to an approximate factor is known.)

n 1.0000 a4 1.0000 b4 1.0000 c4 1.0000 del-r 0.1097 tolerance 0.0001


rn -1.0000 a3 -1.1000 b3 -2.1000 c3 -3.1000 del-s -0.0635 |rn+1 - rn| < tol FALSE
sn -1.0000 a2 2.3000 b2 3.4000 c2 5.5000 rn+1 -0.8903 |sn+1 - sn| < tol FALSE
a1 0.5000 b1 -0.8000 c1 -3.2000 sn+1 -1.0635
a0 3.3000 b0 0.7000 c0 -1.6000
n 2.0000 a4 1.0000 b4 1.0000 c4 1.0000 del-r -0.0097 tolerance 0.0001
rn -0.8903 a3 -1.1000 b3 -1.9903 c3 -2.8806 del-s -0.0367 |rn+1 - rn| < tol FALSE
sn -1.0635 a2 2.3000 b2 3.0085 c2 4.5097 rn+1 -0.9000 |sn+1 - sn| < tol FALSE
a1 0.5000 b1 -0.0619 c1 -1.0136 sn+1 -1.1002
a0 3.3000 b0 0.1557 c0 -3.7378
n 3.0000 a4 1.0000 b4 1.0000 c4 1.0000 del-r 0.0000 tolerance 0.0001
rn -0.9000 a3 -1.1000 b3 -2.0000 c3 -2.9000 del-s 0.0002 |rn+1 - rn| < tol TRUE
sn -1.1002 a2 2.3000 b2 2.9999 c2 4.5099 rn+1 -0.9000 |sn+1 - sn| < tol FALSE
a1 0.5000 b1 0.0004 c1 -0.8681 sn+1 -1.1000
a0 3.3000 b0 -0.0007 c0 -4.1810
n 4.0000 a4 1.0000 b4 1.0000 c4 1.0000 del-r 0.0000 tolerance 0.0001
rn -0.9000 a3 -1.1000 b3 -2.0000 c3 -2.9000 del-s 0.0000 |rn+1 - rn| < tol TRUE
sn -1.1000 a2 2.3000 b2 3.0000 c2 4.5100 rn+1 -0.9000 |sn+1 - sn| < tol TRUE
a1 0.5000 b1 0.0000 c1 -0.8690 sn+1 -1.1000
a0 3.3000 b0 0.0000 c0 -4.1789
MATLAB Implementation
Roots Command/Function
The roots(p) function is used to find roots of any polynomial
where p is a row vector containing the polynomial coefficients
in descending order.
Find the roots of f(x) = x3 + x2 – 3x – 3.
>> a = [1 1 -3 -3];
>> roots(a)

ans =

1.7321
-1.7321
-1.0000

>>
MATLAB Implementation
Fzero Command
The fzero(f,x) function tries to find a zero of a function of one variable,
where f is a string containing the name of a real−valued function of a
single real variable. MATLAB searches for a value near a point where
the function f changes sign, and returns that value, or returns NaN if the
search fails.
Find the roots of f(x) = x3 + x2 – 3x – 3.

>> fzero('x^3 + x^2 - 3*x - 3',1)

ans =

1.7321

>>
MATLAB Implementation

Find a root between 0 and 1 of the transcendental


function f(x) = 3x +sin(x) – ex.

>> fzero('3*x + sin(x) - exp(x)',1)

ans =

0.3604

>>

You might also like