MAT495_Chapter 10

Embed Size (px)

Citation preview

  • 8/10/2019 MAT495_Chapter 10

    1/11

    Part 2 APPROXIMATION METHODS MAT 295

    135

    Chapter 10

    Bisection

    MethodAt the end of this chapter, students should be able to:

    Define the location at which a non-linear function equals zero

    Derive and apply Bisection method

    10.1 Introduction

    Chapter 10 shall discuss one of the most basic problems in numerical

    analysis: finding values of a variable x that satisfy the equation 0)( xf . Asolution to this problem is called a zero of )(xf or a root of )(xf . In this

    chapter, the focus of our discussion will be on solving non-linear equations.

    Before further discussion, lets take a look at some classes of functions:

    (a) linear functions:

    baxxf )(

    (b) polynomials (non-linear):

    012

    22

    21

    1 ...)( axaxaxaxaxaxf n

    nn

    nn

    n

    , 1n

    (c) transcendental functions (non-linear):

    xxxf tan)(

    xexf x 2ln3)(

  • 8/10/2019 MAT495_Chapter 10

    2/11

    Part 2 APPROXIMATION METHODS MAT 295

    136

    10.2 Root Finding

    In any algebra books we learn that the real roots of a quadratic function can

    be found either by factorizing or by using standard formula i.e. quadratic

    formula. Even if the roots are irrational, they can always be found.The roots of a polynomial of higher degree can also be found by using the

    factor theorem (only when the roots are integers or simple rational fractions).

    There are many equations whose roots cannot be evaluated exactly by any

    methods. The approximate value of the roots of such equations can be found

    either by a graphical approach or by one of a number of methods using

    successive numerical approximations or by a combination of these processes.

    Basically when we are discussing about finding roots, we want to find out

    where

    (i) the function )(xf crosses thex-axis or

    (ii) two equations intersect each other (Figure 10.1).

    ((aa))ff((xx))ccrroosssseessxx--aaxxiiss ((bb))ttwwooeeqquuaattiioonnssiinntteerrsseecctt

    eeaacchhootthheerr

    FFiigguurree1100..11

    Definition

    Given an equation 0)( xf , the function )(xf is non-linear if it is not of the

    form bax .

    Definition

    If a function )(xf is continuous on the interval ),( ba and if )(af and )(bf

    have different signs (one positive and one negative) or 0)()( bfaf , then

    there exists at least one real root on the interval ),( ba .

    x

    y

    0

    root

    y=f(x)

    r

    x

    y

    0

    root

    y=f(x)

    y=g(x)

  • 8/10/2019 MAT495_Chapter 10

    3/11

    Part 2 APPROXIMATION METHODS MAT 295

    137

    Take a note that the definition demands that the function )(xf be continuous

    on the given interval. Figure 10.2 shows two cases that may occur

    if 0)()( bfaf .

    ((aa))ff((xx))iissccoonnttiinnuuoouuss ((bb))ff((xx))iissnnoottccoonnttiinnuuoouussFFiigguurree1100..22

    Example 1

    Show that 3)( xxf has a root in the interval [-1, 2].

    Identify the interval

    [-1, 2] a= -1 and b= 2

    Identify the function and compute )(af and )(bf

    3)( xxf or 03 x

    1)1( f 8)2( f

    Determine if 0)()( bfaf

    08)8)(1()1()2( ff

    Since 0)1()2( ff it can be concluded that there exists a root in [-1, 2].

    Solut ion

    Steps : Root finding

    Identify the interval ),( ba

    Identify the function )(xf and compute )(af and )(bf

    Determine if 0)()( bfaf then ],[ bar

    x

    y

    0

    ba

    f(b)

    f(a)

    x

    y

    0 a b

    f(b)

    f(a)

  • 8/10/2019 MAT495_Chapter 10

    4/11

    Part 2 APPROXIMATION METHODS MAT 295

    138

    Example 2

    Given 013 xx , show that one of the solutions of the equation lies

    between -2 and 1.

    Identify the interval

    [-2, 1] a = -2 and b = 1

    Identify the function and compute at aand b

    013 xx or 1)( 3 xxxh

    5)2(h 1)1(h

    Determine if 0)()( bhah

    05)1)(5()1()2( hh

    Hence, there exists a root in the interval [-2, 1].

    Example 3

    Let 02xex . Determine the interval of the root of the function of

    interest.

    Identify the function :

    02 xex 2)( xexf x

    In order to determine the interval of the root, lets plot the graph. There

    are two options to do this.

    (i) Plot 2)( xexf

    x

    or

    (ii) Break 2)( xexf x to two simpler functions, i.e.

    )()(

    2

    02

    xgxh

    xe

    xe

    x

    x

    Solut ion

    Solut ion

  • 8/10/2019 MAT495_Chapter 10

    5/11

    Part 2 APPROXIMATION METHODS MAT 295

    139

    (a) 2)( xexf x (b) xexh )( and xxg 2)(

    Figure 10.3

    Based on Figure 10.3 it can be shown that there exists a root in [0, 1].

    Example 13 showed the existence of a root between given intervals. The

    examples did not provide the procedure to determine the root. There are a

    number of procedures that can be used to locate the desired root.

    Determine the existence of a root for the following functions in a given

    interval.

    (i) 166)( 3 xxxf ; [1, 2]

    (ii) xxxf 3coscos)( ;

    2,

    2

    (iii) 01

    1ln2

    x

    x

    The procedure of solving a non-linear equation numerically is different from

    the procedure of solving the equation analytically. Analytical method of root

    finding attempted to find exactsolution to the equation. Not all equations can

    be solved analytically. In many instances in real applications, it is impossible

    or cumbersome to find the root analytically, thus the equation is solved

    Warm up exercise

  • 8/10/2019 MAT495_Chapter 10

    6/11

    Part 2 APPROXIMATION METHODS MAT 295

    140

    numerically. Numerical method of solving non-linear equation begins with a

    rough estimate of the root. The information is used to produce a better

    estimate. The process is repeated until a desired accuracy is achieved. The

    repetition process is also known as iterative method of root finding. In this

    chapter, we are going to discuss two numerical methods of root finding

    namely

    (i) Bisection method

    (ii) Newtons method

    1100..33Bisection Method

    The simplest numerical technique that shall first be discussed here is the

    Bisection method or sometimes called the method of halving of intervals. The

    method is based on the Intermediate Value theorem and attempts to locate a

    solution to the equation 0)( xf in a sequence of intervals of decreasing

    size.

    Figure 10.4

    In order to apply the Bisection method, we have to assume the function )(xf

    is continuous on the interval ),( ba such that 0)()( bfaf . Hence, there

    exists at least one value r in the interval ),( ba in which 0)( rf (ris the root).

    The interval is then halved or divided into two subintervals by the midpoint of

    aand b. Checking is done to locate in which of the two smaller subintervals

    the root lie. The process is repeated until a desired accuracy is achieved

    (Figure 10.4).

    x

    y

    0 ba

    f(b)

    f(a)

    r1 r2 r3

  • 8/10/2019 MAT495_Chapter 10

    7/11

    Part 2 APPROXIMATION METHODS MAT 295

    141

    Example 4

    The solution of the equation 03 x is known to exist between the values -

    1 and 2. Apply the Bisection method with 3 iterations to reduce the interval

    of the root.

    Identify the equation and determine )(xf

    03 x or 3)( xxf

    Identify the existence of a root

    [-1, 2] a = -1 and b = 2

    3)( xxf 1)1( f 8)2( f

    08

    )8)(1()2()1(

    ff

    Compute2bac

    5.02

    21

    c

    and 125.0)5.0( f

    Determine

    0)125.0)(1()5.0()1( ff

    0)8)(125.0()2()5.0( ff

    Since 0)5.0()1( ff then )5.0,1(r

    Solut ion

    Steps : Bisection Method

    Identify the equation and determine )(xf

    Identify the existence of a root : 0)()( bfaf

    Compute2

    bac

    and )(cf

    Determine if

    0)()( cfaf then ),( car

    0)()( cfbf then ),( bcr

    Repeat until desired iteration/accuracy

  • 8/10/2019 MAT495_Chapter 10

    8/11

    Part 2 APPROXIMATION METHODS MAT 295

    142

    Repeat until desired iterations/accuracy

    i x3)( xxf Root in Bisection

    0 -1 -1.000

    1 2 8.000 [-1, 2] 0.5

    2 0.5 0.125 [-1, 0.5] -0.25

    3 -0.25 -0.016 [-0.25, 0.5] 0.125

    Hence, after 3 iterations, the estimated root is 0.125.

    Example 5

    Given 1)( 3 xxxh , justify that one of the roots of this function lies

    between -2 and 1. Hence, use the Bisection method to calculate the

    approximation to 2 significant digits.

    Identify the equation

    013 xx or 1)( 3 xxxh

    Identify the existence of a root

    [-2, 1] a = -2 and b = 1

    1)( 3 xxxh 5)2( h 1)1( h

    05

    )1)(5()1()2(

    hh

    Compute2

    bac

    5.02

    12 c and 375.1)5.0( h

    Determine

    0)375.1)(5()5.0()2( hh

    0)1)(375.1()1()5.0( hh

    Then )5.0,2( r .

    Solut ion

  • 8/10/2019 MAT495_Chapter 10

    9/11

    Part 2 APPROXIMATION METHODS MAT 295

    143

    Repeat until desired iteration/accuracy

    i x 1)( 3 xxxh root in Bisection

    0 -2 -5.000

    1 1 1.000 [-2, 1] -0.5

    2 -0.5 1.375 [-2, -0.5] -1.250

    3 -1.250 0.297 [-2, -1.25] -1.625

    4 -1.625 -1.666 [-1.625, -1.25] -1.438

    5 -1.438 -0.536 [-1.438, -1.25] -1.344

    6 -1.344 -0.084 [-1.344, -1.25] -1.297

    The root of 1)( 3 xxxh approximated to 2 significant digits is 3.1r .

    Example 6

    The equation xex 2 has one solution. Estimate the solution to 2

    decimal places.

    Identify the equation and determine )(xf

    xex 2

    02 xex or 2)( xexf x

    Identify the existence of a root

    There exists a root in [0, 1]. (Refer Example 3)

    Compute2

    bac

    and f(c)

    5.0210 c and f(0.5) = 0.149

    Determine

    0)5.0()0( ff

    0)1()5.0( ff

    Then )5.0,0(r

    Solut ion

  • 8/10/2019 MAT495_Chapter 10

    10/11

  • 8/10/2019 MAT495_Chapter 10

    11/11

    Part 2 APPROXIMATION METHODS MAT 295

    145

    3. Determine the first four approximations of the actual root of the equation

    02

    13 x in the interval [0,1] by the Bisection method.

    4. By the method of Bisection determine the first three approximations of the

    following equations

    (a) 01sin 3 xx ; [-2, 0]

    (b) 03ln xx ; [4, 5]

    (c) xxxf 3coscos)( ;

    2,

    2

    (d) xx tan2 ; [0, 3]

    5. Show that 023

    xx has a root between 1 and 2. Use the Bisectionmethod to approximate the root accurate to two decimal places.

    6. Using the Bisection method, solve 3ln xx , given that the root is close to

    the value 2. Obtain the root correct to two decimal places.

    7. Use the Bisection method to approximate the zero of 21)( xxxf in [0,

    1]. Give your answers accurate to 2 significant digits.

    8. Solve xexcos2 accurate to one decimal place using the Bisection method.