You are on page 1of 7

Title : Finding Roots of an Equation

Intended Learning Outcomes : At the end of this lesson, you should be able to :
1. Determine real roots of Equations using the False-Position Method
2. Determine real roots of Equations using the Newton-Raphson Method

Discussions :
1. Method of False Position (Regula-Falsi Method)
Method of False Position (aka Linear Interpolation Method) is an iterative method of finding
roots of a given equation using a straight line connecting two points in the curve. Using this straight
line, the current estimate is based on the intersection of the straight line and the x-axis.
Consider the curve shown below. Point(xr,0) is an estimate of the root of the curve y =f(x).
Using similar triangles,

using similar Δ's , x r −x1 x 2−x r


=
−y1 y2

x r y 2−x 1 y 2=x 2 y1−x r y 1

x r ( y 1−y 2)=x 2 y 1−x r y1

solving for xr , x2 y1 x1 y2
xr= −
y1−y 2 y1−y 2
adding and subtracting x2 on the right side,
x2 y1 x1 y2
x r =x 2+ −x2−
y 1−y 2 y 1−y 2

x 2 y 1−x 2 (y 1−y 2)−x 1 y 2


x r =x 2+
y 1−y 2
simplify , y 2 (x 1−x 2 )
x r =x 2− (Method of False Position Fomula)
y 1−y 2

Finding Roots of an Equation page 1 of 7


Illustrative Problem 1 :
Find the real roots of the equation : x4 – 5.1x3 + 5x2 +5x - 6 = 0
Use the False Position Method(FPM). Use a tolerance of %Error < 0.1%

%Error=abs
[ Expected value−Measured Value
Expected Value ]
x 100

Solution :
1. Plot the curve using a spreadsheet software

2. Let y=x 4 – 5.1x3+5x 2+5x−6

y 2 (x 1−x 2 )
x r =x 2−
y 1−y 2
1st iteration : x1 = 3, y1 = -2.7 (Focus on root in betweeen 3.0 and 4.0)
x2 = 4, y2 = 23.6
23.6(3−4)
x r =4− =3.103
(−2.7−23.6) , yr = -2.007
y1 (yr) = 5.42 > 0 ; the root lies in between x2 and xr

2nd iteration : x1 = 3.103, y1 = -2.007


x2 = 4, y2 = 23.6
23.6(3.103−4)
x r =4− =3.173
(−2.007−23.6) , yr = -1.354
y1 (yr) = 2.72 > 0 ; the root lies in between x2 and xr

3rd iteration : x1 = 3.173, y1 = -1.354


x2 = 4, y2 = 23.6
23.6(3.173−4)
x r =4− =3.217
(−1.354−23.6) , yr = -0.860
y1 (yr ) = 1.16 > 0 ; the root lies in between x2 and xr

Finding Roots of an Equation page 2 of 7


4rth iteration : x1 = 3.217, y1 = -0.860
x2 = 4, y2 = 23.6
23.6( 3.217−4)
x r =4− =3.245
(−0.86−23.6) , yr = -0.51
y1 (yr ) = 0.4386 > 0 ; the root lies in between x2 and xr
5th iteration : x1 = 3.245, y1 = -0.51
x2 = 4, y2 = 23.6
23.6( 3.245−4)
x r =4− =3.261
(−0.51−23.6) , yr = -0.297
y1 (yr ) = 0.151 > 0 ; the root lies in between x2 and xr
6th iteration : x1 = 3.261, y1 = -0.297
x2 = 4, y2 = 23.6
23.6(3.261−4)
x r =4− =3.270
(−0.297−23.6) , yr = -0.173
y1 (yr ) = 0.051 > 0 ; the root lies in between x2 and xr

7th iteration : x1 = 3.27, y1 = -0.173


x2 = 4, y2 = 23.6
23.6(3.27−4)
x r =4− =3.275
(−0.173−23.6) , yr = -0.103
y1 (yr ) = 0.0017 > 0 ; the root lies in between x2 and xr

8th iteration : x1 = 3.275, y1 = -0.103


x2 = 4, y2 = 23.6
23.6(3.275−4)
x r =4− =3.278
(−0.103−23.6) , yr = -0.060
y1 (yr ) = 0.006 > 0 ; the root lies in between x2 and xr

9th iteration : x1 = 3.278, y1 = -0.60


x2 = 4, y2 = 23.6
23.6(3.278−4)
x r =4− =3.280
(−0.060−23.6) , yr = -0.031
y1 (yr ) = 0.002 > 0 ; the root lies in between x2 and xr (%Error < 0.1 !)

Summary of FPM on root1


Iteration x1 y1 x2 y2 xr yr y1yr %Error*
1 3.000 -2.700 4.000 23.600 3.103 -2.010 5.428 5.45
2 3.103 -2.010 4.000 23.600 3.173 -1.353 2.721 3.32
3 3.173 -1.353 4.000 23.600 3.218 -0.849 1.149 1.95
4 3.218 -0.849 4.000 23.600 3.245 -0.509 0.432 1.13
5 3.245 -0.509 4.000 23.600 3.261 -0.297 0.151 0.64
6 3.261 -0.297 4.000 23.600 3.270 -0.170 0.050 0.37
7 3.270 -0.170 4.000 23.600 3.275 -0.097 0.016 0.21
8 3.275 -0.097 4.000 23.600 3.278 -0.055 0.005 0.12
9 3.278 -0.055 4.000 23.600 3.280 -0.031 0.002 0.06
10 3.280 -0.031 4.000 23.600 3.281 -0.017 0.001 0.03
11 3.281 -0.017 4.000 23.600 3.282 -0.010 0.000 0.00
*Root1 = 3.282
note : other roots are left for the readers to determine/practice on

Finding Roots of an Equation page 3 of 7


2. Newton-Raphson Method (NRM)
The Newton-Raphson method is an iterative procedure to approximate the a real root of the
continous function y =f(x). In general, the NRM uses an initial guess root x1 which in turn is used to
approximate the next approximate root x2.
The graph below represent a plot of the function f(x). An initial guess x 1 is introduced and a
tangent line is drawn at x1. The value of the function at x1 is y1= f(x1) and the slope is f ' (x1).
The new approximate root x2 is thus computed.

, Newton-Raphson formula
Derivation of the Newton-Raphson Formula
By definition
y1−y 2
Slope=f ' (x 1)=
x1−x 2
substitute y1 = f(x1) and y2 = 0
f ( x1 )
f ' (x 1)=
x1−x 2
f (x 1)
x 1−x 2=
f '( x1 )
express in terms of x2 ,
f (x 1)
x 2=x1−
f '(x1 ) , Newton-Raphson formula
where :
x1 = initial root estimate
x2 = calculated root
f(x1) = value of function at x1
f ' (x1) = value of first derivative at x1

For faster convergence a sufficiently close estimate x1 is necessary. The NRM can yield
inaccurate results in the presence of local maxima/minima. A plot of the graph can help in
determining the first guess x1.

Finding Roots of an Equation page 4 of 7


Illustrative Problem 2 :
Find the negative root of the equation : x4 – 5.1x3 + 5x2 +5x - 6 = 0
Use the Newton-Raphson Method(NRM). Use a tolerance of %Error < 0.1%

Solution :
1. Plot the function : y = x4 – 5.1x3 + 5x2 +5x - 6

2. Determine the first derivative of f(x)


Let f(x) = x4 – 5.1x3 + 5x2 +5x - 6
f'(x) = 4x3 – 15.3x2 + 10x +5

3. Perform the NRM


1st iteration : try x1 = -1.2
f(x1) = (-1.2)4 – 5.1(-1.2)3 + 5(-1.2)2 +5(-1.2) – 6 = 6.086
f ' (x1 ) = 4(-1.2)3 – 15.3(-1.2)2 + 10(-1.2) +5 = -35.944
f (x 1)
x 2=x1−
f '( x1 )
6.086
x 2=−1.2− =1.031
−35.944
2nd iteration : try x1 = -1.031
f(x1) = (-1.031)4 – 5.1(-1.031)3 + 5(-1.031)2 +5(-1.031) – 6 = 0.879
f ' (x1 ) = 4(-1.031)3 – 15.3(-1.031)2 + 10(-1.031) +5 = -25.957
0.897
x 2=−1.031− =−0.996
−25.957
3rd iteration : try x1 = -0.996
f(x1) = (-0.996)4 – 5.1(-0.996)3 + 5(-0.996)2 +5(-0.996) – 6 = 0.006
f ' (x1 ) = 4(-0.996)3 – 15.3(-0.0.996)2 + 10(-0.996) +5 = -24.096
0.006
x 2=−0.996− =−0.996 (equal to the last x 2 )
−24.096
Expected Value = -0.9958 %Error = 0.007 < 0.1 , OK

Answer : The negative root is x = -0.996 .

Finding Roots of an Equation page 5 of 7


Application : Structural Engineering
Determine the location of the maximum deflection in the beam shown. EI is constant.
Neglect the weight of beam.

Solution :
1. Determine the support reactions

2. Apply the Double Integration Method


EI y" = (8/3) x – 2(1/2)<x-2>2
EI y' = (4/3) x2 – (1/3) <x-2>3 + C1
EI y = (4/9) x3 – (1/12) <x-2>4 + C1x +C2

Evaluate the constants C1 and C2


@x=0 , y = 0 , C2 = 0
@x= 6m , y = 0
0 = (4/9)(6)3 – (1/12)(6-2)4 + C1(6)
C1 = -112/9 KN.m3

3. Locate maximum deflection, set y' = 0


0 = (4/3) x2 - (1/3)(x-2)3 – 112/9

4. Find the root using NRM


Let f(x) = (4/3) x2 - (1/3)(x-2)3 – 112/9
f '(x) = (8/3) x – (x-2)2

by inspection 2m < x < 6m;


iter.1 try x1 = 3m (midspan)
f(x1) = (4/3) (3)2 - (1/3)(1)3 – 112/9 = -0.778
f '(x1) = (8/3) (3) – (1)2 =7
x2 = 3 - (-0.778/7) = 3.111
iter.2 try x1 = 3.111 m
f(x1) = (4/3) (3.111)2 - (1/3)(1.111)3 – 112/9 = -0.003
f '(x1) = (8/3) (3.111) – (1.111)2 = 6.925
x2 = 3.111 - (-0.003/6.925) = 3.111

Answer. The maximum deflection is at approximately 3.111m right of support A.

Finding Roots of an Equation page 6 of 7


Self Assessment(Problem Set) :

1. Find the all real roots of the equation : cos(2x) - x/2 = 0 , x in radians
Use the Method of False-Position(MFM). Use a tolerance of %Error < 0.1%

2. Find the all real roots of the equation : cos(2x) - x/2 = 0


Use the Newton-Raphson Method(NRM). Use a tolerance of %Error < 0.1%

References :
1. Applied Numerical Methods with MATLAB for Engineers and Scientist
Steven C. Chapra, McGraw Hill International Edition c.2005

2. Elementary Numerical Analysis 3rd Edition


Kendall Atkinson &Weimin Han, John Wiley and Sons c.2004

3. Numerical Methods for Engineers 5th Edition


Steven C. Chapra & Raymond P. Canale, McGraw Hill International Edition c.2006

Finding Roots of an Equation page 7 of 7

You might also like