Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

Embed Size (px)

Citation preview

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    1/102

    7TECHNIQUES OF INTEGRATIONTECHNIQUES OF INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    2/102

    There are two situations in which it is

    impossible to find the exact value of

    a definite integral.

    TECHNIQUES OF INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    3/102

    TECHNIQUES OF INTEGRATION

    The first situation arises from the fact that,

    in order to evaluate using the

    Fundamental Theorem of Calculus (FTC),

    we need to know an antiderivative of f .

    ( )b

    a f x dx∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    4/102

    TECHNIQUES OF INTEGRATION

    owever, sometimes, it is difficult, or

    even impossible, to find an antiderivative

    (!ection 7.").

    For example, it is impossible to evaluate

    the following integrals exactl#$

    21 1 3

    0 11 xe dx x dx

    −+∫ ∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    5/102

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    6/102

    TECHNIQUES OF INTEGRATION

    &n both cases, we need to find

    approximate values of definite

    integrals.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    7/102

    7.7

    Approximate Integration

    &n this section, we will learn$

    ow to find approximate values

    of definite integrals.

    TECHNIQUES OF INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    8/102

    APPROXIMATE INTEGRATION

    'e alread# know one method for

    approximate integration.

    ecall that the definite integral is defined as

    a limit of iemann sums.

    !o, an# iemann sum could be used as

    an approximation to the integral.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    9/102

    APPROXIMATE INTEGRATION

    &f we divide a, b* into n subintervals

    of e+ual length  x  - (b  a)/n, we have$

    where x i 0 is an# point in the i th subinterval x i 12, x i *.

    1

    ( ) ( *)

    nb

    ia

    i

     f x dx f x x=

    ≈ ∆∑∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    10/102

    Ln APPROXIMATION

    &f x i 0 is chosen to be the left endpoint of

    the interval, then x i 0 - x i 12 and we have$

    The approximation Ln is called the left endpointapproximation.

    1

    1( ) ( )

    nb

    n ia

    i f x dx L f x x−

    =≈ = ∆∑∫ 

    E!ation "

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    11/102

    &f f ( x ) 3 4, the integral represents an area

    and %+uation 2 represents an approximation

    of this area b# the rectangles shown here. 

    Ln APPROXIMATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    12/102

    &f we choose x i 0 to be the right endpoint,

     x i 0 - x i  and we have$

    The approximation R n 

    is called right endpoint

    approximation.

    E!ation #

    1

    ( ) ( )nb

    n ia

    i

     f x dx R f x x=

    ≈ = ∆∑∫ 

    R n APPROXIMATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    13/102

    APPROXIMATE INTEGRATION

    &n !ection ".5, we also considered the case

    where x i 0 is chosen to be the midpoint

    of the subinterval  x i 12, x i *.i x

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    14/102

    M n APPROXIMATION

    The figure shows

    the midpoint

    approximation M n.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    15/102

    M n APPROXIMATION

    M n appears to be better

    than either Ln or R n.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    16/102

    THE MI$POINT RU%E

    where

    and

    1 2

    ( )

    [ ( ) ( ) ... ( )]

    b

    na

    n

     f x dx M 

     x f x f x f x≈= ∆ + + +∫ 

    b a x

    n

    −∆ =

    11 12 ( ) midpoint of [ , ]i i i i i x x x x x− −= + =

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    17/102

    TRAPE&OI$A% RU%E

     6nother approximationcalled the

    Trape8oidal uleresults from averaging

    the approximations in %+uations 2 and 5,

    as follows.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    18/102

    TRAPE&OI$A% RU%E

    [

    ]

    [

    ]

    11 1

    1

    1

    0 1 1 2

    1

    0 1 2

    1

    1( ) ( ) ( )

    2

    ( ( ) ( ))2

    ( ( ) ( )) ( ( ) ( ))2

    ... ( ( ) ( ))

    ( ) 2 ( ) 2 ( )2

    ... 2 ( ) ( )

    n nb

    i iai i

    n

    i i

    i

    n n

    n n

     f x dx f x x f x x

     x f x f x

     x f x f x f x f x

     f x f x

     x f x f x f x

     f x f x

    −= =

    −=

    ≈ ∆ + ∆ ∆  

    = +

    ∆= + + +

    + + +

    ∆= + +

    + + +

    ∑ ∑∫ ∑

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    19/102

    THE TRAPE&OI$A% RU%E

    where  x  - (b  a)/n and x i  - a 9 i   x  

    [

    ]

    0 1 2

    1

    ( )

    ( ) 2 ( ) 2 ( )2

    ... 2 ( ) ( )

    b

    na

    n n

     f x dx T  x

     f x f x f x

     f x f x−

    ≈∆

    = + +

    + + +

    ∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    20/102

    TRAPE&OI$A% RU%E

    The reason for the name can be seen

    from the figure, which illustrates the case

    f ( x ) 3 4.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    21/102

    TRAPE&OI$A% RU%E

    The area of the trape8oid that lies above

    the i th subinterval is$

    &f we add the areas of

    all these trape8oids,we get the right side of

    the Trape8oidal ule.

    11

    ( ) ( )[ ( ) ( )]

    2 2

    i ii i

     f x f x   x x f x f x− −

    +   ∆  ∆ = + ÷  

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    22/102

    APPROXIMATE INTEGRATION

     6pproximate the integral

    with n - ", using$

    a. Trape8oidal ule

    b. :idpoint ule

    Examp'e "2

    1

    (1/ ) x dx

    ∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    23/102

    APPROXIMATE INTEGRATION

    'ith n - ", a - 2 and b - 5,

    we have$  x  - (5 2)/" - 4.5

    !o, the Trape8oidal ule gives$

    2

    51

    1 0.2[ (1) 2 (1.2) 2 (1.4)

    2

    2 (1.6) 2 (1.8) (2)]

    1 2 2 2 2 10.1

    1 1.2 1.4 1.6 1.8 2

    0.695635

    dx T f f f     x

     f f f  

    ≈ = + +

    + + +

     = + + + + + ÷  

    ∫ 

    Examp'e " a

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    24/102

    APPROXIMATE INTEGRATION

    The approximation is illustrated

    here.

    Examp'e " a

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    25/102

    APPROXIMATE INTEGRATION

    The midpoints of the five subintervals

    are$ 2.2, 2.;, 2.", 2.7, 2.<

    Examp'e " (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    26/102

    APPROXIMATE INTEGRATION

    !o, the :idpoint ule gives$

    2

    1

    1[ (1.1) (1.3) (1.5)

    (1.7) (1.9)]

    1 1 1 1 1 1

    5 1.1 1.3 1.5 1.7 1.90.691908

    dx x f f f     x

     f f  

    ≈ ∆ + +

    + +

     = + + + + ÷  

    ∫ 

    Examp'e " (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    27/102

    APPROXIMATE INTEGRATION

    &n %xample 2, we deliberatel# chose

    an integral whose value can be computed

    explicitl# so that we can see how accurate

    the Trape8oidal and :idpoint ules are.

    =# the FTC,

    2 2

    11

    1 ln ] ln 2 0.693147...dx x x

    = = =∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    28/102

    APPROXIMATION ERROR

    The error in using an approximation is

    defined as the amount that needs to be

    added to the approximation to make it

    exact.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    29/102

    APPROXIMATE INTEGRATION

    From the values in %xample 2, we see that

    the errors in the Trape8oidal and :idpoint

    ule approximations for n - " are$

    E T  > 4.445?@@

    E M  > 4.4425;<

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    30/102

    APPROXIMATE INTEGRATION

    &n general, we have$

    ( )

    ( )

    b

    T na

    b

     M na

     E f x dx T 

     E f x dx M 

    = −

    = −

    ∫ 

    ∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    31/102

    APPROXIMATE INTEGRATION

    The tables show the results of calculations

    similar to those in %xample 2. owever, these are for n - ", 24, and 54 and for

    the left and right endpoint approximations and also

    the Trape8oidal and :idpoint ules.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    32/102

    APPROXIMATE INTEGRATION

    'e can make several observations

    from these tables.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    33/102

    &n all the methods. we get more accurate

    approximations when we increase n. owever, ver# large values of n result in so man#

    arithmetic operations that we have to beware ofaccumulated round1off error.

    O)SER*ATION "

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    34/102

    O)SER*ATION #

    The errors in the left and right endpoint

    approximations are$ Apposite in sign

     6ppear to decrease b# a factor of about 5

    when we double the value of n 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    35/102

    O)SER*ATION +

    The Trape8oidal and :idpoint ules

    are much more accurate than the endpoint

    approximations.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    36/102

    O)SER*ATION ,

    The errors in the Trape8oidal and :idpoint

    ules are$ Apposite in sign

     6ppear to decrease b# a factor of about ?

    when we double the value of n 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    37/102

    O)SER*ATION -

    The si8e of the error in the :idpoint ule

    is about half that in the Trape8oidal ule.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    38/102

    MI$POINT RU%E *S. TRAPE&OI$A% RU%E

    The figure shows wh# we can usuall# expect

    the :idpoint ule to be more accurate than

    the Trape8oidal ule.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    39/102

    MI$POINT RU%E *S. TRAPE&OI$A% RU%E

    The area of a t#pical rectangle in

    the :idpoint ule is the same as the area

    of the trape8oid ABCD whose upper side is

    tangent to the graph at P .

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    40/102

    MI$POINT RU%E *S. TRAPE&OI$A% RU%E

    The area of this trape8oid is closer to

    the area under the graph than is the area

    of that used in the Trape8oidal ule.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    41/102

    MI$POINT RU%E *S. TRAPE&OI$A% RU%E

    The midpoint error (shaded red) is smaller

    than the trape8oidal error (shaded blue).

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    42/102

    O)SER*ATIONS

    These observations are corroborated

    in the following error estimateswhich

    are proved in books on numerical

    anal#sis.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    43/102

    O)SER*ATIONS

    Botice that Abservation ? corresponds

    to the n5 in each denominator because$

    (5n)5 - ?n5

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    44/102

    APPROXIMATE INTEGRATION

    That the estimates depend on the si8e of

    the second derivative is not surprising if #ou

    look at the figure.

    f’’ ( x ) measures how much

    the graph is curved.

    ecall that f’’ ( x ) measures

    how fast the slope of y  - f ( x )

    changes.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    45/102

    ERROR )OUN$S

    !uppose f’’ ( x ) D K  for a D x  D b.

    &f E T  and E M  are the errors in

    the Trape8oidal and :idpoint ules,

    then

    3 3

    2 2( ) ( )and12 24

    T M  K b a K b a E E 

    n n− −≤ ≤

    Etimate +

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    46/102

    ERROR )OUN$S

    Eets appl# this error estimate to the

    Trape8oidal ule approximation in %xample 2.

    &f f ( x ) - 2/ x , then f’ ( x ) - 12/ x 5 and f’’ ( x ) - 5/ x ;.

     6s 2 D x  D 5, we have 2/ x ≤ 2G

    so,

    3 32 2''( ) 2

    1 f x

     x= ≤ =

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    47/102

    ERROR )OUN$S

    !o, taking K  - 5, a - 2, b - 5, and n - "

    in the error estimate (;), we see$

    3

    22(2 1) 112(5) 150

    0.006667

    T  E    −≤ =

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    48/102

    ERROR )OUN$S

    Comparing this estimate with the actual error

    of about 4.445?@@, we see that it can happen

    that the actual error is substantiall# less than

    the upper bound for the error given b# (;).

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    49/102

    ERROR ESTIMATES

    ow large should we take n in order to

    guarantee that the Trape8oidal and :idpoint

    ule approximations for are

    accurate to within 4.4442H

    Examp'e #

    2

    1(1/ ) x dx∫ 

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    50/102

    ERROR ESTIMATES

    'e saw in the preceding calculation

    that f’’ ( x ) D 5 for 2 D x  D 5

    !o, we can take K  - 5, a - 2, and b - 5 in (;).

    Examp'e #

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    51/102

    ERROR ESTIMATES

     6ccurac# to within 4.4442 means that

    the si8e of the error should be less than

    4.4442

    Therefore, we choose n so that$3

    2

    2(1)0.0001

    12n<

    Examp'e #

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    52/102

    ERROR ESTIMATES

    !olving the ine+ualit# for n,

    we get

    or  

    Thus, n = ?2 will ensure

    the desired accurac#.

    2   2

    12(0.0001)n   >

    140.8

    0.0006n > ≈

    Examp'e #

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    53/102

    ERROR ESTIMATES

    &ts +uite possible that a lower value

    for n would suffice.

    owever, ?2 is the smallest value for whichthe error1bound formula can guarantee us accurac#

    to within 4.4442

    Examp'e #

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    54/102

    ERROR ESTIMATES

    For the same accurac# with the :idpoint ule,

    we choose n so that$

    This gives$

    3

    2

    2(1)

    0.000124n <

    129

    0.0012n > ≈

    Examp'e #

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    55/102

    ERROR ESTIMATES

    a. Ise the :idpoint ule with n - 24 to

    approximate the integral

    b. Jive an upper bound for the error involved

    in this approximation.

    21

    0. xe dx∫ 

    Examp'e +

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    56/102

    ERROR ESTIMATES

     6s a - 4, b - 2, and n - 24, the :idpoint ule

    gives$

    21

    0

    0.0025 0.0225 0.0625 0.1225 0.2025

    0.3025 0.4225 0.5625 0.7225 0.9025

    [ (0.05) (0.15) ... (0.85) (0.95)]

    0.1

    1.460393

     xe dx

     x f f f f  

    e e e e e

    e e e e e

    ≈ ∆ + + + +

    + + + +

    =   + + + + + ≈

    ∫ 

    Examp'e + a

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    57/102

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    58/102

    ERROR ESTIMATES

     6s f ( x ) - e x 2 , we have$

    f’ ( x ) - 5 xe x 2  and f’’ ( x ) - (5 9 ? x 5)e x 2  

     6lso, since 4 D x  D 2, we have x 5 D 2.

    ence, 4 D f’’ ( x ) - (5 9 ? x 5) e x 2  D Ke

    Examp'e + (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    59/102

    ERROR ESTIMATES

    Taking K  - Ke, a - 4, b - 2, and n - 24 in

    the error estimate (;), we see that an upper

    bound for the error is$3

    2

    6 (1)

    24(10) 400

    0.007

    e e

    =

    Examp'e + (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    60/102

    ERROR ESTIMATES

    %rror estimates give upper bounds

    for the error.

    The# are theoretical, worst1case scenarios.

    The actual error in this case turns out to be

    about 4.445;

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    61/102

    APPROXIMATE INTEGRATION

     6nother rule for approximate integration

    results from using parabolas instead

    of straight line segments to approximate

    a curve.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    62/102

    APPROXIMATE INTEGRATION

     6s before, we divide a, b* into n subintervals

    of e+ual length h -  x  - (b  a)/n.

    owever, this time, we assume n is an even number.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    63/102

    APPROXIMATE INTEGRATION

    Then, on each consecutive pair of intervals,

    we approximate the curve y  - f ( x ) 3 4 b#

    a parabola, as shown.

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    64/102

    APPROXIMATE INTEGRATION

    &f y i  - f ( x i ), then P i ( x i , y i ) is the point on

    the curve l#ing above x i .

     6 t#pical parabola passes through

    three consecutive points$ P i , P i 92, P i 95

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    65/102

    APPROXIMATE INTEGRATION

    To simplif# our calculations, we first

    consider the case where$

     x 4 - 1h, x 2 - 4, x 5 - h

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    66/102

    APPROXIMATE INTEGRATION

    'e know that the e+uation of

    the parabola through P 4, P 2, and P 5 

    is of the form

    y = Ax 5 + Bx + C  

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    67/102

    APPROXIMATE INTEGRATION

    Therefore, the area under the parabola

    from x  - 1 h  to x  - h is$

    2 2

    0

    3

    0

    3

    2

    ( ) 2 ( )

    23

    23

    (2 6 )

    3

    h h

    h

    h

     Ax Bx C dx Ax C dx

     x A Cx

    h A Ch

    h Ah C 

    −+ + = +

    = +

     = + ÷  

    = +

    ∫ ∫ 

    O G O

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    68/102

    APPROXIMATE INTEGRATION

    owever, as the parabola passes through

    P 4(1 h, y 4), P 2(4, y 2), and P 5(h, y 5), we have$

    y 4 - A( h)5

     9 B(1 h) 9 C  - Ah5

      Bh 9 C   y 2 - C 

      y 5 - Ah5 9 Bh 9 C 

    APPROXIMATE INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    69/102

    APPROXIMATE INTEGRATION

    Therefore,

    y 4 9 ?y 2 9 y 5 - 5 Ah5 9 KC 

    !o, we can rewrite the area under

    the parabola as$

    0 1 2( 4 )

    3

    h y y y+ +

    APPROXIMATE INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    70/102

    APPROXIMATE INTEGRATION

    Bow, b# shifting this parabola

    hori8ontall#, we do not change

    the area under it.

    APPROXIMATE INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    71/102

    APPROXIMATE INTEGRATION

    This means that the area under the parabola

    through P 4, P 2, and P 5 from x  - x 4 to x  - x 5 

    is still$0 1 2( 4 )

    3

    h y y y+ +

    APPROXIMATE INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    72/102

    APPROXIMATE INTEGRATION

    !imilarl#, the area under the parabola

    through P 5, P ;, and P ? from x  - x 5 to x  - x ? 

    is$2 3 4( 4 )

    3

    h y y y+ +

    APPROXIMATE INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    73/102

    APPROXIMATE INTEGRATION

    Thus, if we compute the areas under all

    the parabolas and add the results, we get$

    0 1 2 2 3 4

    2 1

    0 1 2 3 4

    2 1

    ( ) ( 4 ) ( 4 )

    3 3

    ... ( 4 )3

    ( 4 2 4 23

    ... 2 4 )

    − −

    − −

    ≈ + + + + +

    + + + +

    = + + + +

    + + + +

    ∫ b

    a

    n n n

    n n n

    h h f x dx y y y y y y

    h y y y

    h  y y y y y

     y y y

    APPROXIMATE INTEGRATION

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    74/102

    APPROXIMATE INTEGRATION

    Though we have derived this approximation

    for the case in which f ( x ) 3 4, it is a

    reasonable approximation for an# continuous

    function f  .

    Bote the pattern of coefficients$

    2, ?, 5, ?, 5, ?, 5, . . . , ?, 5, ?, 2

    SIMPSON/S RU%E

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    75/102

    SIMPSON/S RU%E

    This is called !impsons uleafter

    the %nglish the %nglish mathematician

    Thomas !impson (272427K2).

    SIMPSON/S RU%E R '

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    76/102

    SIMPSON/S RU%E

    where n is even and  x  - (b  a)/n.

    R!'e

    0 1 2 3

    2 1

    ( )

    [ ( ) 4 ( ) 2 ( ) 4 ( )3

    ... 2 ( ) 4 ( ) ( )]

    b

    na

    n n n

     f x dx S 

     x f x f x f x f x

     f x f x f x− −

    ∆= + + +

    + + + +

    ∫ 

    SIMPSON/S RU%E Examp'e ,

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    77/102

    SIMPSON/S RU%E

    Ise !impsons ule

    with n - 24 to approximate

    2

    1(1/ ) x dx∫ 

    Examp'e ,

    SIMPSON/S RU%E Examp'e ,

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    78/102

    SIMPSON/S RU%E

    Lutting f ( x ) - 2/ x , n - 24, and  x  - 4.2 in

    !impsons ule, we obtain$

    2

    101

    1[ (1) 4 (1.1) 2 (1.2) 4 (1.3)

    3

    ... 2 (1.8) 4 (1.9) (2)]

    1 4 2 4 2 4 2 4

    0.1   1 1.1 1.2 1.3 1.4 1.5 1.6 1.7

    2 4 13

    1.8 1.9 2

    0.693150

     xdx S f f f f    

     x

     f f f  

    ∆≈ = + + +

    + + + +

     + + + + + + + ÷

    =   ÷ ÷+ + + ÷  

    ∫ 

    Examp'e ,

    SIMPSON/S RU%E

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    79/102

    SIMPSON S RU%E

    &n %xample ?, notice that !impsons ule

    gives a much better approximation

    (S24 > 4.K

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    80/102

    SIMPSON S RU%E

    &t turns out that the approximations in

    !impsons ule are weighted averages of

    those in the Trape8oidal and :idpoint ules$

    ecall that E T  and E M  usuall# have opposite signsand E M   is about half the si8e of E T |.

    1 22   3 3n n n

    S T M = +

    SIMPSON/S RU%E

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    81/102

    SIMPSON S RU%E

    &n man# applications of calculus, we need to

    evaluate an integral even if no explicit formula

    is known for y as a function of x .

     6 function ma# be given graphicall# or as

    a table of values of collected data.

    SIMPSON/S RU%E

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    82/102

    SIMPSON S RU%E

    &f there is evidence that the values are not

    changing rapidl#, then the Trape8oidal ule

    or !impsons ule can still be used to find

    an approximate value for .b

    a  y dx∫ 

    SIMPSON/S RU%E Examp'e -

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    83/102

    SIMPSON S RU%E

    The figure shows data traffic on the link from

    the I.!. to !'&TC, the !wiss academic and

    research network, on Februar# 24, 2

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    84/102

    SIMPSON S RU%E

    Ise !impsons ule to estimate the total

    amount of data transmitted on the link up to

    noon on that da#.

    Examp'e -

    SIMPSON/S RU%E Examp'e -

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    85/102

    SIMPSON S RU%E

    !ince we want the units to be consistent

    and D(t ) is measured in :b/s, we convert

    the units for t  from hours to seconds.

    Examp'e -

    SIMPSON/S RU%E Examp'e -

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    86/102

    SIMPSON S RU%E

    &f we let A(t ) be the amount of data (in :b)

    transmitted b# time t , where t  is measured in

    seconds, then A’ (t ) - D(t ).

    !o, b# the Bet Change Theorem (!ection ".?),

    the total amount of data transmitted b# noon

    (when t  - 25 x K45 - ?;,544) is$

    43,200

    0(43, 200) ( ) A D t dt = ∫ 

    Examp'e -

    SIMPSON/S RU%E Examp'e -

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    87/102

    SIMPSON S RU%E

    'e estimate the values of D(t ) at hourl#

    intervals from the graph and compile them

    here.

    Examp'e -

    SIMPSON/S RU%E Examp'e -

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    88/102

    SIMPSON S RU%E

    Then, we use !impsons ule

    with n - 25 and t  - ;K44 to estimate

    the integral, as follows.

    Examp'e -

    SIMPSON/S RU%E Examp'e -

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    89/102

    SIMPSON S RU%E

      43,2000

    ( )

    [ (0) 4 (3600) 2 (7200)3

    ... 4 (39, 600) (43, 200)]

    3600[3.2 4(2.7) 2(1.9) 4(1.7)

    3

    2(1.3) 4(1.0) 2(1.1) 4(1.3)

    2(2.8) 4(5.7) 2(7.1) 4(7.7) 7.9] 143,880

     A t dt 

    t  D D D

     D D

    ∆≈ + +

    + + +

    ≈ + + +

    + + + +

    + + + + + =

    ∫ 

    Examp'e -

    The total amount of data transmitted up to noon

    is 2??,444 :bs, or 2?? gigabits.

    SIMPSON/S RU%E *S. MI$POINT RU%E

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    90/102

    SIMPSON S RU%E *S. MI$POINT RU%E

    The table shows how !impsons ule

    compares with the :idpoint ule for

    the integral , whose true value

    is about 4.K

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    91/102

    SIMPSON S RU%E

    This table shows how the error E s 

    in !impsons ule decreases b#

    a factor of about 2K when n is doubled.

    SIMPSON/S RU%E

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    92/102

    SIMPSON S RU%E

    That is consistent with the appearance of n? 

    in the denominator of the following error

    estimate for !impsons ule.

    &t is similar to the estimates given in (;)

    for the Trape8oidal and :idpoint ules.

    owever, it uses the fourth derivative of f .

    ERROR )OUN$ 0SIMPSON/S RU%E1 Etimate ,

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    93/102

    ERROR )OUN$ 0SIMPSON S RU%E1

    !uppose that f (?)( x ) D K  for a D x  D b.

    &f E s is the error involved in using

    !impsons ule, then 5

    4

    ( )

    180 s

     K b a E 

    n

    −≤

    Etimate ,

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 2

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    94/102

    0 1

    ow large should we take n to guarantee

    that the !impsons ule approximation

    for is accurate to within 4.4442H2

    1(1/ ) x dx∫ 

    Examp'e 2

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 2

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    95/102

    0 1

    &f f ( x ) - 2/ x , then f (?)( x ) - 5?/ x ".

    !ince x  3 2, we have 2/ x  D 2, and so

    Thus, we can take K  - 5? in (?).

    (4)

    5

    24( ) 24 f x

     x= ≤

    a p e 2

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 2

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    96/102

    0 1

    !o, for an error less than 4.4442, we should

    choose n so that$

    This gives

    or

    5

    4

    24(1)0.0001

    180n<

    4   24

    180(0.0001)n   >

    41 6.04

    0.00075n > ≈

    p

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 2

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    97/102

    0 1

    Therefore, n - @ (n must be even)

    gives the desired accurac#.

    Compare this with %xample 5, where we obtained

    n - ?2 for the Trape8oidal ule and n - 5< for

    the :idpoint ule.

    p

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 7

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    98/102

    0 1

    a. Ise !impsons ule with n - 24

    to approximate the integral .

    b. %stimate the error involved in thisapproximation.

    21

    0

     xe dx∫ 

    p

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 7 a

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    99/102

    0 1

    &f n -24, then  x  - 4.2 and the rule gives$

    21

    0

    0 0.01 0.04 0.09 0.16

    0.25 0.36 0.49 0.64 0.81 1

    [ (0) 4 (0.1) 2 (0.2) ...3

    2 (0.8) 4 (0.9) (1)]0.1

    [ 4 2 4 23

    4 2 4 2 4 ]

    1.462681

     x   xe f f f    

     f f f  

    e e e e e

    e e e e e e

    ∆≈ + + +

    + + += + + + +

    + + + + + +≈

    ∫ 

    p

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 7 (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    100/102

    0 1

    The fourth derivative of f ( x ) - e x 5 is$

    f (?)( x ) - (25 9 ?@ x 5 9 2K x ?)e x 5

    !o, since 4 D x  D 2, we have$

    4 D f (?)( x ) D (25 9 ?@ 92K)e2 - 7Ke

    p

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 7 (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    101/102

    Lutting K  - 7Ke, a - 4, b - 2, and n - 24

    in (?), we see that the error is at most$

    Compare this with %xample ;.

    5

    4

    76 (1)0.000115

    180(10)

    e

    p

    ERROR )OUN$ 0SIMPSON/S RU%E1 Examp'e 7 (

  • 8/9/2019 Approximation of Integrals Yvonne a. Greenbaun Chap7_Sec7

    102/102

    Thus, correct to three decimal places,

    we have$

    21

    0 1.463 x

    e dx ≈∫