Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views18 pages

Chapter Two Non-Linear Equations - 115736

Uploaded by

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

Chapter Two Non-Linear Equations - 115736

Uploaded by

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

Chapter two

Non-linear equations

Numerical Iteration Method

A numerical iteration method or simply iteration method is a mathematical


procedure that generates a sequence of improving approximate solutions for
a class of problems. A specific way of implementation of an iteration method,
including the termination criteria, is called an algorithm of the iteration
method. In the problems of finding the solution of an equation an iteration
method uses an initial guess to generate successive approximations to the
solution. Since the iteration methods involve repetition of the same process
many times, computers can act well for finding solutions of equation
numerically.

Some of the iteration methods for finding solution of equations involve:

(1) Bisection method,

(2) Method of false position (Regula-falsi Method),

(3) Newton-Raphson method.

A numerical method to solve equations may be a long process in some


cases. If the method leads to value close to the exact solution, then we say
that the method is convergent. Otherwise, the method is said to be
divergent.

Solution of Algebraic and Transcendental Equations One of the most


common problem encountered in engineering analysis is that given a
function f (x), find the values of x for which f(x) = 0. The solution (values of
x) are known as the roots of the equation f(x) = 0, or the zeroes of the
function f (x). The roots of equations may be real or complex. In general, an
equation may have any number of (real) roots, or no roots at all. For
example, sin x – x = 0 has a single root, namely, x = 0, whereas tan x – x =

1
0 has infinite number of roots (x = 0, ± 4.493, ± 7.725, …). Algebraic and
Transcendental Equations f(x) = 0 is called an algebraic equation if the
corresponding ( ) f x is a polynomial. An example is 7x2 + x - 8 = 0.

f (x) is called transcendental equation if f(x) contains trigonometric, or


exponential or logarithmic functions. Examples of transcendental equations
are sin x–x = 0, etc

There are two types of methods available to find the roots of algebraic and
transcendental equations of the form f (x) = 0. 1.

1. Direct Methods: Direct methods give the exact value of the roots in a
finite number of steps. We assume here that there are no round off
errors. Direct methods determine all the roots at the same time.
2. Indirect or Iterative Methods: Indirect or iterative methods are
based on the concept of successive approximations. The general
procedure is to start with one or more initial approximation to the root
and obtain a sequence of iterates k which in the limit converges to the
actual or true solution to the root. Indirect or iterative methods
determine one or two roots at a time. The indirect or iterative methods
are further divided into two categories: bracketing and open
methods. The bracketing methods require the limits between which
the root lies, whereas the open methods require the initial estimation
of the solution. Bisection and False position methods are two known
examples of the bracketing methods. Among the open methods, the
Newton-Raphson is most commonly used. The most popular method
for solving a non-linear equation is the Newton-Raphson method and
this method has a high rate of convergence to a solution. In this
chapter and in the coming chapters, we present the following indirect
or iterative methods with illustrative examples:
1. Fixed Point Iteration Method
2. Bisection Method
3. Method of False Position (Regula Falsi Method)
2
4. Newton-Raphson Method (Newton’s method)

Bisection Method

Bisection Method The bisection method is one of the bracketing methods for
finding roots of an equation. For a given a function f(x), guess an interval
which might contain a root and perform a number of iterations, where, in
each iteration the interval containing the root is get halved. The bisection
method is based on the intermediate value theorem for continuous functions.
Intermediate value theorem for continuous functions:

Let us suppose we have an equation of the form f(x) = 0 in which solution


lies between in the range (a, b). Also f(x) is continuous and it can be
algebraic or transcendental. If f (a) and f (b) are opposite signs, then there
exist at least one real root between a and b. Let f (a) be positive and f (b)
negative. Which implies at least one root exits between a and b. We assume
that root to be x 0= (a+ b)/2. Check the sign of f (xo). If f( x 0) is negative, the
root lies between a and xo. If f( x 0) is positive, the root lies between xo and b.
Subsequently any one of this case occur.

a+ x 0
x1 =
2

When f( x 1) is negative, the root lies between x 0 and x 1 and let the root be x 2=
( x 0 + x 1) / 2. Again f( x 2) negative then the root lies between x 0 and x 2.

Let x 3=¿ ( x 0+ x 2)/2 and so on. Repeat the process x 0, x 1, x 2… Whose limit of
convergence is the exact root?

Steps:

1. Find a and b in which f(a) and f(b) are opposite signs for the given
equation using trial and error method.

2. Assume initial root as x 0 = (a+ b)/2.

3
3. If f( x 0) is negative, the root lies between a and x 0 and take the root as x 1 =
( x 0+ a)/2.

4. If f( x 0) is positive , then the root lies between x 0 and b and take the root
as

x 1 = ( x 0 +b)/2.

5. If f( x 1) is negative , the root lies between x 0 and x 1 and let the root be x 2
= ( x 0 + x 1) / 2.

6. If f( x 2) is negative , the root lies between x 0 and x 2 and let the root be x 3
= ( x 0 + x 2) / 2 .

7. Repeat the process until any two consecutive values are equal and hence
the root.

Criterion for termination

1. A convenient criterion is to compute the percentage error Ԑr is defined


by;

current approximation−previous approximation


Relative error = Ԑr = | |*100%
current approximation

The computations can be terminated when relative error becomes less than
a prescribed tolerance.

2. Termination after N steps (N given, fixed)


3. Termination if(xn+1 - xn ≤Ԑ (Ԑ> 0 given)
4. Termination if f(xn)≤α (α>0 given).

Example 1:

Find the positive root of x 3 – x = 1 correct to four decimal places by


bisection method.

Solution: Let f(x) = x3 – x – 1

4
f(0) = 03 - 0 -1 = -1 = -ve

f (1) = 13 - 1 -1 = -1 = -ve

f (2) = 23 - 2 -1 = 5 = +ve

So root lies between 1 and 2, we can take (1+2) /2 as initial root and
proceed.

i.e., f (1.5) = 0.8750 = +ve and f(1) = -1 = -ve

So root lies between 1 and 1.5 ,

Let x 0 = (1+1.5) /2 as initial root and proceed.

f(1.25) = - 0.2969

So, root lies between x1 between 1.25 and 1.5

Now x 1= (1.25 + 1.5) /2 = 1.3750 f(1.375) = 0.2246 = +ve

So, root lies between x2 between 1.25 and 1.375

Now x 2 = ( 1.25 + 1.375)/2 = 1.3125 f(1.3125) = -0.051514 = -ve

Therefore, root lies between 1.375and 1.3125

Now x3 = ( 1.375 + 1.3125) / 2 = 1.3438 f(1.3438) = 0.082832 =


+ve

So root lies between 1.3125 and 1.3438

Now x 4 = ( 1.3125 + 1.3438) / 2 = 1.3282 f(1.3282) = 0.014898 =


+ve

So root lies between 1.3125 and 1.3282

Now x5 = ( 1.3125 + 1.3282) / 2 = 1.3204 f(1.3204) = - 0.018340 =


-ve

So root lies between 1.3204 and 1.3282

5
Now x 6 = ( 1.3204 + 1.3282) / 2 = 1.3243 f(1.3243) = -ve

So root lies between 1.3243 and 1.3282

Now x7 = ( 1.3243 + 1.3282) / 2 = 1.3263 f(1.3263) = +ve

So root lies between 1.3243 and 1.3263

Now x8 = ( 1.3243 + 1.3263) / 2 = 1.3253 f(1.3253) = +ve

So root lies between 1.3243 and 1.3253

Now x9 = ( 1.3243 + 1.3253) / 2 = 1.3248 f(1.3248) = +ve

So root lies between 1.3243 and 1.3248

Now x 10 = ( 1.3243 + 1.3248) / 2 = 1.3246 f(1.3246) = -ve

So root lies between 1.3248 and 1.3246

Now x 11 = ( 1.3248 + 1.3246) / 2 = 1.3247 f(1.3247) = -ve

So root lies between 1.3247 and 1.3248

Now x 12 = ( 1.3247 + 1.3247) / 2 = 1.32475

Therefore , the approximate root is x= 1.32475

Example 2:

Find the positive root of x – cos x = 0 by bisection method.

Solution : Let f(x) = x – cos x

f(0) = 0 - cos (0) = 0 -1 = -1 = -ve

f(0.5) = 0.5 – cos (0.5) = -0.37758 = -ve

f(1) = 1 – cos (1) = 0.42970 = +ve

So root lies between 0.5 and 1

Let x 0 = (0.5 +1) /2 as initial root and proceed.

6
f(0.75) = 0.75 – cos (0.75) = 0.018311 = +ve

So root lies between 0.5 and 0.75

x 1= (0.5 +0.75) /2 =0.625 f(0.625) = 0.625 – cos (0.625) = -


0.18596

So root lies between 0.625 and 0.750

x 2= (0.625 +0.750) /2 = 0.6875 f(0.6875) = - 0.085335

So root lies between 0.6875 and 0.750

x3 = (0.6875 +0.750) /2 = 0.71875 f(0.71875) = 0.71875-


cos(0.71875) = - 0.033879

So root lies between 0.71875 and 0.750

x 4 = (0.71875 +0.750) /2 = 0.73438 f(0.73438) = -0.0078664


= - ve

So root lies between 0.73438 and 0.750

x 5= 0.742190 f(0.742190) = 0.0051999 = + ve

x6 = (0.73438 +0.742190) /2 = 0.73829 f(0.73829) = -


0.0013305

So root lies between 0.73829 and 0.74219

x7 = (0.73829+0.74219) = 0.7402 f(0.7402) = 0.7402-cos(0.7402)


= 0.0018663

So root lies between 0.73829 and 0.7402

x 8 = 0.73925 f(0.73925) = 0.00027593

x 9= 0.7388

The root is x = 0.7388.

7
Merits of bisection method

1. The iteration using bisection method always produces a root, since


the method brackets the root between two values.
2. As iterations are conducted, the length of the interval gets halved.
So one can guarantee the convergence in case of the solution of the
equation.
3. The Bisection Method is simple to program in a computer.

Demerits of bisection method

1. The convergence of the bisection method is slow as it is simply based


on halving the interval.
2. Bisection method cannot be applied over an interval where there is a
discontinuity.
3. Bisection method cannot be applied over an interval where the
function takes always values of the same sign.
4. The method fails to determine complex roots.
5. If one of the initial guesses a or b is closer to the exact solution, it will
take larger number of iterations to reach the root

Exercises

Find a real root of the following equations by bisection method.

1. e x = 3x
2. x 3-4x-9 = 0

Regula Falsi method or Method of False Position

This method is also based on the intermediate value theorem. In this


method also, as in bisection method, we choose two points a and b such that
f (a) and f (b) are of opposite signs (i.e. f(a)f(b)<0) . Then, intermediate

8
value theorem suggests that a zero of f lies in between a and b, if f is a
continuous function.

Steps:

1. Find a and b in which f(a) and f(b) are opposite signs for the given
equation using trial and error method.
2. Therefore root lies between a and b if f(a)is very close to zero select
af ( b )−bf ( a )
and compute x1 by using the following formula: x1 =
f ( b )−f ( a )
3. If f(x1)* f(a) <0 , then root lies between x1 and a.
af ( x 1 )−x 1 f (a)
Compute x2 by using the following formula: x2 =
f ( x 1 )−f ( a)
4. Calculate the values of ( x3, x4, x5, ….) by using the above
formula until any two successive values are equal and
subsequently we get the solution of the given equation.

Example 1:

Solve for a positive root of x3 -4x+1=0 by and Regula Falsi method

Solution:

Let f(x) = x3-4x+1 = 0

f(0) = 03-4 (0)+1 = 1 = +ve

f(1) = 13-4(1)+1 = -2 = -ve

So a root lies between 0 and 1

We shall find the root that lies between 0 and 1.

Here a=0, b=1

af ( b )−bf ( a ) 0 f ( 1 )−1 f ( 0 ) 0−(1)


x1 = = = = 0.333333
f ( b )−f ( a ) f ( 1 )−f ( 0 ) (−2)−1

9
f( x 1) = f(1/3) = (1/27)-(4/3) +1 = -0.2963

Now f(0) and f(1/3) are opposite in sign. Hence the root lies between 0 and
1/3.

0 f ( 1/3 )−1 /3 f ( 0 ) −0.33333


x 2= = = 0.25714
f ( 1/3 )−f ( 0 ) −0.2963−1

Now f( x 2) = f(0.25714) = - 0.011558 = -ve . So the root lies between 0 and


0.25714

0∗f ( 0.25714 )−(0.25714)f ( 0 ) −0.25714


x3 = = = 0.25420
f ( 0.25714 )−f ( 0 ) −0.25714−1

f( x 3) = f(0.25420) = -0.0003742

So the root lies between 0 and 0.25420

0∗f ( 0.25420 )−0.25420∗f ( 0 ) −0.25420


x4 = = x1 = = 0.25410
f ( 0.25420 ) −f ( 0 ) −0.0003742−1

f( x 4 ) = f(0.25410) = - 0.000012936

The root lies between 0 and 0.25410

0∗f ( 0.25410 )−0.25410 f ( 0 ) 0.000012936


x5 = = = 0.25410
f ( b )−f ( a ) −0.000012936−1

Hence the root is x = 0.25410.

Example 2:

Find an approximate root of x log 10x – 1.2 = 0 by False position method.

Solution:

Let f(x) = x log10x – 1.2

f(1) = -1.2 = -ve;

f(2) = 2 x 0.30103 -1.2 = - 0.597940

10
f(3) = 3x0.47712 – 1.2 = 0.231364 = +ve

So, the root lies between 2 and 3.

2 f ( 3 )−3 f ( 2 ) 2∗0.231364−3∗(−0.59794)
x1 = = = 2.721014
f ( 3 )−f ( 2 ) 0.231364−(−0.59794)

f( x 1) = f(2.7210) = - 0.017104

The root lies between x1 and 3.

2.721014∗f ( 3 ) −3∗f ( 2.721014 ) 2.721014∗0.231364−3∗(−0.017104 )


x2 = = =
f ( 3 )−f ( 2.721014 ) 0.231364−(−0.017104 )
2.7402

f( x 2) = f(2.7402) = 2.7402 x log(2.7402) – 1.2

= - 0.00038905

So the root lies between 2.740211 and 3

2.7402∗f (3 )−3∗f ( 2.7402 )


x3 = = 2.740627
f ( 3 )−f (2.7402 )

f(2.740627) = 0.00011998

So the root lies between 2.740211 and 2.740627

2.7402∗f ( 2.7406 )−2.7406∗f ( 2.7402 )


x4 = = 2.7405
f ( 2.7406 )−f ( 2.7402 )

f( x 4 ) = 0.00050903

Hence the root is x = 2.7405.

Exercise

Solve the following by method of false position (Regula Falsi Method)

x3 +2x2 +10x – 20 (Ans :1.3688)

Theoretical Exercises with Answers:

11
1. What is the difference between algebraic and transcendental
equations?
Ans: An equation f(x)= 0 is called an algebraic equation if the
corresponding f( x) is a polynomial, while, f (x) is called
transcendental equation if the corresponding f(x) contains
trigonometric, or exponential or logarithmic functions.
2. Why we are using numerical iterative methods for solving
equations?
Ans: As analytic solutions are often either too tiresome or simply
do not exist, we need to find an approximate method of solution.
This is where numerical analysis comes into the picture.
3. Based on which principle, the bisection and regula-falsi method
is developed? Ans: These methods are based on the
intermediate value theorem for continuous functions: stated as,
“If f is a continuous function and f(a) and f(b) have opposite
signs, then at least one root lies in between a and b If the
interval (a , b) is small enough, it is likely to contain a single root.

4. What are the advantages and disadvantages of the bracketing
methods like bisection and regula-falsi?
Ans: (i) The bisection and regula-falsi method is always
convergent. Since the method brackets the root, the method is
guaranteed to converge. The main disadvantage is, if it is not
possible to bracket the roots, the methods cannot applicable.
For example, if f(x) is such that it always takes the values with
same sign, say, always positive or always negative, then we
cannot work with bisection method. Some examples of such
functions are
I. f (x) = x 2 which take only non-negative values and
II. f (x) = −x 2 , which take only non-positive values

12
Newton-Raphson method (or Newton’s method)

The Newton-Raphson method, or Newton Method, is a powerful technique for


solving equations numerically. Like so much of the differential calculus, it is
based on the simple idea of linear approximation.

Consider f (x) = 0, where f has continuous derivative f ‘. From the figure we


can say that at, x =a ; y = f (a) = 0 ; which means that a is a solution to the
equation f( x )= 0 . In order to find the value of a, we start with any arbitrary
point x0 . From figure we can see that, the tangent to the curve f at (x 0,f(x0))
with slope f’(x0) touches the x-axis at x1.

Figure 1: graphical representation of roots of f(x) using Newton’s method

f (x 0 )−f (x 1)
Now tan(β) = f’( x 0) =
x 0−x 1

As f (x 1) = 0, the above simplified to:

f (x 0)
x 1=x 0− '
f (x 0 )

In the second step, we compute

f (x 1)
x 2=x 1− and so on.
f ' (x 1)

13
More generally, we write xn+1 in terms of xn, f(xn) and f’(xn) for n=1, 2, … by
means of the Newton-Raphson formula

f ( xn )
x n+1=x n − '
f (x n)

Steps:

1. Find a and b in which f(a) and f(b) are opposite signs for the given
equation using trial and error method. We assume that root to be
either a or b, in which the value of f(a) or f(b) is very close to zero.
That number is assumed to be initial root.
2. Assume initial root as xo = a i.e., if f(a)is very close to zero or xo = b
if f(b)is very close to zero
3. Use an initial guess of the root xn, to estimate the new value of the
root, xn+1 , as

f (x n )
x n+1=x n −
f ' (x n)

4. Calculate the values of ( x3, x4, x5, ….) by using the above formula
until any two successive values are equal and subsequently we get
the solution of the given equation.

Example 1: Find the positive root of f(x) = 2x 3 - 3x-6 =0 by Newton –


Raphson method correct to five decimal places.

Solution:

Let f(x) = 2x3 -3x – 6 ;

f ’(x) = 6x2 – 3

14
f(1) = 2-3-6 = -7 = -ve

f(2) = 16 – 6-6 =4 = +ve

3
f ( xn) 2∗x n −3∗x n−6
xn+1=xn - =x n−¿ 2
¿
f '( x n ) (6∗x n −3)¿

So, a root between 1 and 2. In which 4 is closer to 0. Hence we assume initial


root as 2.

Consider x0 = 2

So

x 1=¿ x 0 – f( x 0)/f’( x 0) = x 0 - ((2* x 03 - 3* x 0 - 6) / (6* x 02-3))

= (4(2)2+6)/(6(2)2- 3) = 38/21 = 1.809524

x 2 = (4(1.809524)3+6)/(6(1.809524)2- 3) = 29.700256a/16.646263 =
1.784200

x 3 = (4(1.784200)3+6)/(6(1.784200)2- 3) = 28.719072/16.100218 =
1.783769

x 4 = (4(1.783769)3+6)/(6(1.783769)2- 3) = 28.702612/16.090991 =
1.783769

Since X3 and X4 are equal, hence root is x = 1.783769

Example 2:

Using Newton’s method, find the root between 0 and 1 of x 3 = 6x – 4 correct


to 5 decimal places.

Solution:

Let f(x) = x3 -6x+4; f(0) = 4 = +ve; f(1) = -1 = -ve

f’(x) = 3x2- 6

15
3
f ( xn ) x n −6∗xn + 4
xn+1=xn - = xn - 2
¿
f '( xn) (3∗x n −6)¿

So a root lies between 0 and 1

f(1) is nearer to 0. Therefore we take initial root as x 0 = 1

f’(x) = 3x2- 6

x1 = (2 x 02– 4)/(3 x 02-6) = (2-4)/(3-6) = 2/3 = 0.66666

x2 = (2(2/3) 3 – 4 )/(3(2/3) 2-6) = 0.73016

x3 = (2(0.73015873) 3 – 4 )/(3(0.73015873) 2-6) = (3.22145837/


4.40060469)

= 0.73205

x4 = (2(0.73204903) 3 – 4 )/(3(0.73204903) 2-6) = (3.21539602/


4.439231265)

= 0.73205

The root is 0.73205 correct to 5 decimal places.

Exercise:

Solve the following by using Newton – Raphson Method : x3 -x -1= 0


(Ans :1.3247 )

The Secant Method

We have seen that the Newton-Raphson method requires the evaluation of


derivatives of the function and this is not always possible, particularly in the
case of functions arising in practical problems. In the secant method, the
derivative at n x is approximated by the formula

f ( xn )−f (xn−1)
f’(xn)=
xn−xn−1

This can be written as

16
fn−fn−1
f’n= where fn = f(xn)
xn−xn−1

Hence, the newton-Rahpson formula becomes:

f ( xn ) [ xn−xn−1]
xn+1=xn -
fn−fn−1

It should be noted that this formula requires two initial approximations to the
root.

Summary

Method Pros Cons

Bisection - Easy, Reliable, Convergent - Slow

- One function evaluation per - Needs an interval [a,b]


iteration containing the root, i.e.,

- No knowledge of derivative is f(a)f(b)<0

needed

Newton - Fast (if near the root) - May diverge

17
-Two function evaluations per - Needs derivative and an
iteration initial guess x0 such that f’(x0)
is nonzero

Secant - Fast (slower than Newton) - May diverge

-One function evaluation per - Needs two initial points guess


iteration x0, x1 such that

- No knowledge of derivative is f(x0)- f(x1) is nonzero


needed

18

You might also like