calculus 01 numerical integration

Upload: eliseudesafate

Post on 29-May-2018

225 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/9/2019 Calculus 01 Numerical Integration

    1/20

    135

    11. NUMERICAL INTEGRATION

    11.1 The Trapezium RuleIt often happens that we need to find the value of a definite integral for a function whose

    indefinite integral cannot be found in terms of the elementary functions we know about already.

    Since a definite integral represents an area between the graph of the function and the x-axis, all we

    need to do is to find some way of approximating this area.Of course we could sketch the curve on graph paper and estimate the area by counting

    squares. But not only is this rather inconvenient, theres no way we could get a high degree of

    precision.

    Lets suppose that we have a function y = f(x) and we wish to estimate

    a

    b

    y dx . If we divide

    the interval from a to b into n strips of equal width h these strips are basically rectangles. We

    can easily find the area of each rectangle and the total the areas of these n strips.

    ..However a much better approximation can be obtained if we join the points on the curve by straight

    lines:

    ..

    Sometimes the straight line goes above the curve and we include a little more area than we should.

    Sometimes it goes below and we underestimate the strip of area. On average these tend to balance

    each other but not completely. We rarely get the exact value in this way. But the more strips we

    take the more closely the lines will follow the curve and the better the approximation.

    One strip:

    Two strips:

  • 8/9/2019 Calculus 01 Numerical Integration

    2/20

    136

    Nine strips:

    The area of a trapezium is the average length of the parallel sides multiplied by the distance

    between them.

    a b

    h

    Area =

    a + b

    2h.

    Suppose we want to estimate

    a

    b

    y dx and we use n strips, each of width h. Suppose the y-

    values at the end-points of the strips are y0, y1, , yn.

    The total area of the strips, approximating each of them by a trapezium, is:h

    2(y0 + y1) +

    h

    2(y1 + y2) +

    h

    2(y2 + y3) + +

    h

    2(yn1 + yn)

    =h

    2[y0 + yn + 2(y1 + y2 + yn1)].

    (We can remember this ash

    2[First + Last + Twice the others].)

    Trapezium Rule

    a

    by dx

    width

    2[First + Last+ 2 Sum of others

    Example 1: Estimate

    0

    10

    x2

    dx by the Trapezium Rule, using 5 strips.

    Solution: The width of each strip is h = 2.

    x y y = x

    2

    0 y0 0

    2 y1 4

    4 y2 16

    6 y3 36

    8 y4 64

    10 y5 100

  • 8/9/2019 Calculus 01 Numerical Integration

    3/20

    137

    So

    0

    10

    x2

    dx 2

    2.[0 + 100 + 2(4 + 16 + 36 + 64)] = 340.

    The exact value is

    0

    10

    x2

    dx =

    1

    3x

    310

    0=

    1000

    3 333.3.

    We can improve the accuracy of our estimate by fitting quadratic functions to our points

    rather than straight lines.

    11.2 The Cubic Fit MethodThe problem with the Trapezium Method is that if the curve is concave downwards, and the

    slope is decreasing, the trapeziums all lose some of the area and the Trapezium Rule gives an

    underestimate.

    On the other hand if the curve is concave upwards, and the slope is increasing, theTrapezium Rule gives an overestimate.

    Perhaps we can get greater accuracy by fitting a quadratic in each strip. A quadratic has a

    formula y = ax2

    + bx + c. The values of a, b and c would have to be found using information from

    the graph.

    But a strip has only two y-values, one at each end and wed need three pieces of information

    to solve for the three values. But what if we used the slopes at the end points? That would give us

    four bits of information which would be more than enough. In fact we could fit a cubic:

    y = ax3

    + bx2

    + cx + d.y1

    y0

    y0 y1

    0 h

  • 8/9/2019 Calculus 01 Numerical Integration

    4/20

    138

    In general a cubic would be able to fit a given curve more closely than a quadratic and so

    give a more accurate estimate of the area. And even if a quadratic was better in a particular case we

    could always have a = 0 and our cubic would collapse to a quadratic.

    For convenience well relocate the origin so that the strip goes from x = 0 to x = h. Suppose

    that the cubic y = ax3

    + bx2

    + cx + d passes through (0, y0) and (h, y1) and that its derivatives at

    x = 0 and x = h are y0 and y1 respectively. Then since y = 3ax2

    + 2bx + c we have:

    y0 = d

    y0 = cy1 = ah

    3+ bh

    2+ ch + d

    y1 = 3ah2

    + 2bh + c

    Solving the last two equations for a, b in terms of c, d and h we get:

    3y1 hy1 = bh2

    + 2ch + 3d which gives:

    b =1

    h2 [3y1 hy1 2ch 3d] =

    1

    h2 [3y1 hy1 2y0h 3y0]

    Eliminating b we get:

    2y1 y1h = ah3

    + ch + 2d which gives:

    a = 1

    h3 (2y1 y1h ch 2d) = 1

    h3 (2y1 y1h y0h 2y0).

    Assembling these coefficients we have:

    a = 1

    h3 (2y1 y1h y0h 2y0).

    b =1

    h2 [3y1 hy1 2y0h 3y0]

    c = y0

    d = y0.

    Now the area under the cubic is

    0

    h

    (ax3

    + bx2

    + cx + d) dx =

    a

    4x

    4+

    b

    3x

    3+

    c

    2x

    2+ dx

    h

    0

    =ah4

    4+

    bh3

    3+

    ch2

    2+ dh =

    h

    12(3ah

    3+ 4bh

    2+ 6ch + 12d)

    From the above equations:

    3ah2

    = 6y1 3y1 3y0 + 6y0

    4bh2

    = 12y1 4hy1 8y0 12y0

    6ch = 6y0h

    12d = 12y0

    All this looks pretty frightening, but watch how it all simplifies.

    0

    h

    (ax3

    + bx2

    + cx + d) dx

    =h

    12(6y1 + 3y1h + 3y0h + 6y0 + 12y1 4hy1 8y0h 12y0 + 6y0h + 12y0)

    =h

    12(6y1 + 6y0 + y0h y1h).

  • 8/9/2019 Calculus 01 Numerical Integration

    5/20

    139

    Suppose we repeat the above on n strips. The sum of the areas of the strips will be:h

    12(6y0 + 6y1 + y0h y1h)

    +h

    12(6y1 + 6y2 + y1h y2h)

    +h

    12(6y2 + 6y3 + y2h y3h)

    + .

    +h

    12(6yn1 + 6yn + yn1h ynh)

    =h

    12[6y0 + 6yn + 12(y1 + y2 + + yn1) + y0h ynh]

    =h

    2[y0 + yn + 2(y1 + y2 + + yn1)] +

    h2

    12[y0 yn].

    Notice the way the derivatives telescope so that we only need to evaluate them at the

    endpoints. Also, you may recognise the first part as simply the Trapezium Rule. The last term can

    be thought of as a correction to the Trapezium Rule. Moreover, y0 is the value of y when x = a

    and yn is the value of y when x = b, so this correction term is simply ash

    2

    12

    [ ]yb

    a

    Cubic Fit Rule

    a

    b

    y dx h

    2[y0 + yn + 2(y1 + y2 + + yn1)] +

    h2

    12[ ]y

    b

    a.

    Trapezium Rule Correction

    Example 4: Use the Cubic Fit Rule with 3 strips to estimate

    14 x dx .

    Solution: If y = x then y = 12 x

    x y y

    1 1 0.5

    2 1.4142

    3 1.7320

    4 2 0.25

    TRAPEZIUM RULE =1

    2[1 + 2(1.4142 + 1.7320) + 2] = 4.6462

    CORRECTION =1

    12[0.5 0.25] = 0.0208

    CUBIC FIT ESTIMATE = 4.6670NOTE: The exact value (to 4 decimal places) is 4.6667. The Cubic Fit rule with 3 strips is a better

    approximation than Simpsons Rule with 4 strips (4.6662).

  • 8/9/2019 Calculus 01 Numerical Integration

    6/20

    140

    Example 5: Use the Cubic Fit Rule with 5 strips to estimate 27logx dx .

    Solution: If y = logx then y =1

    x.

    x y y

    2 0.6931 0.5

    3 1.0986

    4 1.38635 1.6094

    6 1.7918

    7 1.9459 0.1429

    TRAPEZIUM RULE =1

    2[0.6931 + 2(1.0986 + 1.3863 + 1.6094 + 1.7918) + 1.9459] = 7.2056

    CORRECTION =1

    12[0.5 0.1429] = 0.0298

    CUBIC FIT ESTIMATE = 7.2354

    The only disadvantage of the Cubic Fit Method is that it requires the derivatives at the

    endpoints. This means that we have to be given the function and we have to be able to differentiate

    it. The difficulty arises in cases where all were given is the table of values. We could use theTrapezium Rule but thats not particularly accurate. Fortunately theres a technique that gets

    around this problem.

    11.3 ParabolasA parabola is the shape of the graph of a quadratic. The basic parabola is y = x2.

    We can vary the shape by changing the coefficient of x2. The graph of y = ax

    2is very similar to that

    of y = x2. If a is positive then larger values of a give a tall, skinny parabola while small values of

    a give short, fat parabolas.

    Well, thats perhaps a bit misleading. Parabolas are all infinitely tall and infinitely wide,

    because as x takes larger and larger values so does ax2. Its just that we only ever draw a finite

    portion of the infinite parabola that makes it look this way.

    A better way to describe the effect of increasing the value of a is to magnify the graph.

    Suppose you were to cut out the central portion of the parabola y = x2

    and magnify it to double its

    size in each direction. The point (x, x2) would become (2x, 2x

    2) and 2x

    2= (2x)

    2so, relative to the

    original scale, the graph would have the shape of y = x2.

  • 8/9/2019 Calculus 01 Numerical Integration

    7/20

    141

    Thus decreasing the value of a (as long as it remains positive) has the effect of enlarging

    the graph. Or from another point of view it flattens the parabola. Increasing the value of a makes

    the graph look thinner, as if we are looking at it from further away.

    Changing the sign of a reflects the graph in the x-axis. The graph of y = ax2 is exactly

    like the graph of y= ax2

    except that it is turned upside down.

    The graph y = ax2

    + c is also a parabola. The only difference between it and y = ax2

    is that

    the y values are increased by c. (If c is negative this is a decrease.) This has the effect of

    moving the graph up or down in a vertical direction.

    Including an x term has the effect of moving the graph left or right. If we have y = x2

    + x

    we can write this as y = (x2

    + x + ) = (x + )2 . The vertex of the parabola now occurs

    when x = and y = . So the effect is to move the graph unit to the left and unit down.

    The general quadratic y = ax2

    + bx + c represents a parabola, like y = x2

    except that it may

    be magnified or reduced, may be turned upside down, and may be moved about horizontally or

    vertically.

    The parabola is a versatile shape. Parabolic mirrors are used as reflectors in car headlights

    and in reflective telescopes because they have the property of producing a parallel beam of light, or

    focussing a parallel beam at a single point. Parabolas are very useful in approximating other curves.

    While a parabola and some other curve may differ, over a small enough interval, the approximation

    can be quite good. What we do therefore is to break up an arbitrary curve into small sections and

    approximate each section by a different parabola.

    And why might we wish to approximate a general curve by a series of parabolas? Well, so

    that we can estimate the area under the curve for functions that we cant integrate.

    11.4 Area Under a ParabolaWere going to develop a formula for the area under a parabola (strictly speaking, between

    the parabola, the x-axis and two vertical lines) in terms of just 3 points on that parabola.

    Lets take the parabola y = x2 and a point at x = u on it. Now lets move a small distance tothe left and the same distance to the right, giving two other points at x = u h and x = u + h. So we

    have three points, equally spaced horizontally, a distance h apart. Lets call the corresponding y-

    values y0, y1 and y2.

  • 8/9/2019 Calculus 01 Numerical Integration

    8/20

    142

    So:

    y0 = (u h)2,

    y1= u2 and

    y2 = (u + h)2.

    y2y1

    y0

    u h u u + h

    The area of these two strips is uh

    u+h

    x2

    dx =

    1

    3x

    3

    u+h

    uh=

    1

    3[(u + h)

    3 (u h)

    3].

    Now (u + h)3

    can be expanded by the Binomial Theorem as u3

    + 3u2h + 3uh

    2+ h

    3. If you havent

    learnt the Binomial Theorem you can work it out by squaring u + h and then multiplying by a

    further u + h:

    (u + h)

    3

    = (u + h)

    2

    (u + h) = (u

    2

    + 2uh + h

    2

    )(u + h) = u

    3

    + 2u

    2

    h + uh

    2

    + u

    2

    h + 2uh

    2

    + h

    3

    = u3

    + 3u2h + 3uh

    2+ h

    3.

    (u h)3

    can be now found by replacing h by h.

    (u h)3

    = u3

    + 3u2(h) + 3u(h)

    2+ (h)

    3= u

    3 3u

    2h + 3uh

    2 h

    3.

    (The effect is to introduce alternating signs.)

    So (u + h)3

    = u3

    + 3u2h + 3uh

    2+ h

    3and

    (u h)3

    = u3 3u

    2h + 3uh

    2 h

    3.

    So (u + h)3 (u h)

    3= 6u

    2h + 2h

    3and so the area is

    1

    3[6u

    2h + 2h

    3] =

    h

    3[6u

    2+ 2h

    2].

    Now we write everything in terms of y0, y1 and y2.

    Remember that y1 = u2.

    Also y0 = (u h)2 = u2 2uh + h2 and y2 = (u + h)2 = u2 + 2uh + h2.So y0 + y2 = 2u

    2+ 2h

    2and hence h

    2= (y0 + y2) 2u

    2= (y0 + y2) 2y1.

    This means that we can write the area of these two strips is

    h

    3[6y1 + (y0 + y2) 2y1] =

    h

    3[y0 + 4y1 + y2].

    Because this formula expresses the area in terms of horizontal and vertical distances it will

    still work if we change the scale or move the parabola around or even turn it upside down. In other

    words it works for the area between any quadratic function and the x-axis. All we have to do is to

    split the area into two strips and use the width of the strips h and the three y-values y0, y1 and y2

    corresponding to the endpoints of these strips.

    y2y1

    y0

    h h

  • 8/9/2019 Calculus 01 Numerical Integration

    9/20

    143

    a

    b

    (any quadratic) =h

    3[y0 + 4y1 + y2]

    where h =b a

    2, the width of the 2 strips and y0, y1, y2 are

    the y-values of the three endpoints of these two strips.

    11.5 Approximating Areas Under Other CurvesThe above formula is exact for quadratics. But if we approximate another function by a

    quadratic we can use the same formula to approximate the area for that other function.

    y2

    y1

    y0

    h h

    The dotted graph represents some function y = f(x) which we have approximated by the quadraticthat passes through the three points shown. The solid curve represents that quadratic. The area

    under the dotted curve will be approximately equal to that under the quadratic, so the formula:

    h

    3[y0 + 4y1 + y2]

    will give an estimate for the area under y = f(x).

    The closeness of the approximation depends on how closely the quadratic follows the given

    curve. If the strips are narrow the approximation will be very good. The narrower the strips, the

    better the approximation.

    The trouble is that if we want the area from a to b, the width h = b a2

    may not be very

    small. The trick is to divide the interval [a, b] into an even number of strips andfit a different

    quadratic to each pair of strips.

    y0 y1 y2 y3 y4 y5 y6 y7 y8

    a a+h a+2h a+3h a+4h a+5h a+6h a+7h a+8h = b

    The y-values of all of these points are called ordinates and if we denote them by y0, y1, y2,

    y3, y2n (where there are 2n strips) then we can use the basich

    3[y0 + 4y1 + y2] formula for each

    pair of strips and add the results together.

  • 8/9/2019 Calculus 01 Numerical Integration

    10/20

    144

    For the first pair of strips we can use the formula exactly, to giveh

    3[y0 + 4y1 + y2]. For the

    second pair of strips we have ordinates y2, y3, y4 and so the area becomesh

    3[y2 + 4y3 + y4].

    The total area for 8 strips is therefore (the spacing puts the same y is underneath one

    another) ish

    3times

    [y0 + 4y1 + y2]+ [y2 + 4y3 + y4]

    + [y4 + 4y5 + y6]

    + [y6 + 4y7 + y8]

    =h

    3[y0 + 4y1 + 2y2 + 4y3 + 2y4 + 4y5 + 2y6 + 4y7 + y8].

    A similar formula holds for any (even) number of strips. Never attempt to use an odd

    number of strips. The easiest way to remember this is to call ordinates odd or even according to the

    subscript. So y0, y2, .. are the even ordinates and y1, y3, are the odd ones. Notice that the odd

    ordinates have a weighting of 4 in the formula while the even ones have a weighting of 2, except for

    the first and last which while even, only have a weighting of 1. Simpsons Rule, can thus be

    expressed as:

    a

    b(any function)

    width

    3[first + last + 2(sum of other evens) + 4(sum of odds)]

    11.6 Simpsons SpreadsheetLike Newtons Method, Simpsons Rule is best done in a spreadsheet, even if you are doing

    it by hand with the aid of a calculator. Setting the working out in table form makes for fewer errors.

    Like Newtons Spreadsheet, this one has 4 columns. The headings are x, y, w and wy. The ws are

    the weights. These are 1s 2s and 4s as appropriate. The wy column contains the product of the

    ws and the ys. The ys are the ordinates, got by substituting the xs into the function. And the xs

    are evenly spaced over the interval over which we are integrating.

    x y w wy

    The first thing to do is to decide how many strips youre going to use. You must use an

    even number of strips. The more strips you use the more work youll have to do. But, up to a

    point, the more strips the more accurate will be the answer, but not always. Well discuss the

    number of strips you should use later.

    Having decided on the number of strips, you work out the width of each. If youre

    integrating from a to b and have 2n strips then the width is h =b a

    2n.

    In the first row, in the x column, you put down the bottom limit of integration. You then

    add h to each x to get the next, and keep stepping out until you reach the top limit, b. With

    2n strips this should give 2n + 1 rows. (Theres always one more endpoint than strips.)

    x y w wy

  • 8/9/2019 Calculus 01 Numerical Integration

    11/20

    145

    a

    a + h

    a + 2h

    a + 3h

    ..

    b

    The next step is to substitute each of these values of x into the function and write down thecorresponding y-values into the y-column.

    x y w wy

    a y0

    a + h y1a + 2h y2a + 3h y3

    .. ..

    b y2n

    The weights always follow the same pattern. The first is a 1, and then they alternate 4, 2, 4,2, until the second last is a 4 and then the last is a 1.

    x y w wy

    a y0 1

    a + h y1 4

    a + 2h y2 2

    a + 3h y3 4

    .. .. ..

    b y2n 1

    The wy column is now computed by multiplying each y-value by the appropriate weight:

    x y w wy

    a y0 1 y0a + h y1 4 4y1

    a + 2h y2 2 2y2a + 3h y3 4 4y3

    .. .. ..

    b y2n 1 y2n

    You then total the wy column.

    x y w wya y0 1 y0

    a + h y1 4 4y1a + 2h y2 2 2y2a + 3h y3 4 4y3

    .. .. ..

    b y2n 1 y2nTOTAL

  • 8/9/2019 Calculus 01 Numerical Integration

    12/20

    146

    Underneath this you write the width divided by 3:

    x y w wy

    a y0 1 y0a + h y1 4 4y1

    a + 2h y2 2 2y2a + 3h y3 4 4y3

    .. .. ..b y2n 1 y2n

    TOTAL

    h/3

    You then multiply these last two figures to get the approximation for the integral.

    x y w wy

    a y0 1 y0a + h y1 4 4y1

    a + 2h y2 2 2y2

    a + 3h y3 4 4y3.. .. ..

    b y2n 1 y2nTOTAL

    h/3

    INTEGRAL

    Example 2: Use Simpsons Rule to approximate

    14 x dx using 6 strips. Compare this with the

    exact value.Solution: The width is h = 0.5

    x y w wy

    1 1 1 11.5 1.2247 4 4.8988

    2 1.4142 2 2.8284

    2.5 1.5811 4 6.3244

    3 1.7320 2 3.4640

    3.5 1.8708 4 7.4832

    4 2 1 2.0000

    TOTAL 27.9988

    h/3 1/6

    INTEGRAL 4.6665

    Performing the exact integration we get:

    14 x dx =

    14x

    1/2dx =

    2

    3x

    3/24

    1=

    2

    3[4

    3/2 1

    3/2] =

    2

    3[2

    3 1] =

    14

    3 4.6667

    So even with as few strips as 6 we have achieved a very good approximation by Simpsons Rule.

  • 8/9/2019 Calculus 01 Numerical Integration

    13/20

    147

    11.7 How Many Strips?Remember:

    You must use an even number of strips with Simpsons Rule.

    Secondly, if you use Simpsons Rule to integrate a quadratic you need only two strips.

    Naturally if you approximate a quadratic by a quadratic youll come up with the exact value, no

    matter how many strips you use. So in this case you may as well use as few strips as possible, that

    is, two strips.

    When integrating a cubic Simpsons Rule is exact, even with as few as 2 strips. Although

    the quadratic approximation doesnt match the cubic, the bits where the quadratic goes above the

    cubic are compensated exactly by the bits where it goes underneath.

    Of course theres no reason why you should be attempting to use Simpsons rule for a

    quadratic, or a cubic or any function that you can integrate. In the above example we used

    Simpsons Rule to integrate x from 1 to 4. But we can integrate x and this will give the exact

    value with much less work.

    Dont use Simpsons Rule if you can integrate the function.

    Usually Simpsons Rule is not exact. But the more strips you take (only ever an even

    number) the more accurate the answer, at least in theory.

    In practice theres the phenomenon of round-off errors. Your calculator will calculate the

    ordinates to so many decimal places but there are usually tiny errors for each ordinate. If you were

    to take an enormous number of strips, these round-off errors might very well build up and

    counteract the better accuracy because the parabolas are fitting better.

    Example 3: Simpsons Rule was used to estimate

    14 x dx using more and more strips. Keep in

    mind that the exact value is 4.66666.

    # strips estimate # places of accuracy2 4.662277660 2

    4 4.666220710 3

    6 4.666563053 3

    8 4.666631374 4

    10 4.666651629 4

    20 4.666665668 5

    30 4.666666467 6

    50 4.666666642 7

    100 4.666666668 8

    1000 4.666666656 7

    Youll see from this that you get quite a lot of accuracy with relatively few strips. A good

    rule of thumb, when using Simpsons Rule with hand calculation, is to use 6, 8 or 10 strips. Your

    decision as to how many strips you choose may be based on convenience as much as accuracy. For

    example integrating from 1 to 4 using 6 strips gives a width of 0.5 while 8 strips gives a width of

    0.375 which is less convenient. Ten strips may be a good choice in that it combines convenience

    with a fairly good degree of accuracy.

    But small improvements in accuracy come at a very great price in amount of computation.

    If you were doing the calculations on a computer you might decide that 1000 strips would be your

  • 8/9/2019 Calculus 01 Numerical Integration

    14/20

    148

    choice. But notice that, working to 9 decimal places, gave a little less accuracy with 1000 strips

    than what was achieved with only 100. More is not always better.

    We have three rules: the Trapezium Rule, the Cubic Fit Rule and Simpsons Rule. Which

    one is the best to use? For a start, never use the Trapezium Rule. Its not as accurate as the other

    two and was only introduced as an introduction to them.

    If you have no function but only a table of values you mustuse Simpsons Rule. But if you

    have the function, and can readily differentiate it, the Cubic Fit Rule gives a fair bit more accuracyfor the same amount of work.

    RULE ACCURACY NEEDS # STRIPS USE WHEN

    Trapezium least table of values any number never

    Simpsons good table of values even number you only have a table of values

    Cubic Fit better the function any number you have a formula

    EXERCISES FOR CHAPTER 11In the following exercises use the Cubic Fit Rule with 6 or 7 strips to approximate the given

    definite integrals. Use your calculator to evaluate the function at each of the points. Work to4 decimal places.

    Exercise 1: 1

    8x

    2dx . Exercise 2:

    0

    12

    2x + 1 dx .

    Exercise 3:

    1

    4dx

    3x 2. Exercise 4:

    10

    40log x dx .

    Exercise 5: 0

    1.4

    ex2

    dx .

    Use Simpsons Rule with 8 strips to approximate the following definite integrals.

    [Normally one would use the Cubic Fit Rule when given a function but rather than providing you

    with tables of values it saves space if you are asked to produce your own.]

    Exercise 6: 0

    8x2 dx . Exercise 7:

    0

    8

    x dx .

    Exercise 8:

    1

    5dx

    x. Exercise 9:

    2

    3

    x2 x dx .

    Exercise 10: 10

    30log t dt . Exercise 11:

    0

    22

    tdt .

    Exercise 12:

    0

    11

    1 + u2 du . Exercise 13:

    0

    6

    36 x2

    dx .

  • 8/9/2019 Calculus 01 Numerical Integration

    15/20

    149

    SOLUTIONS FOR CHAPTER 11Exercise 1: If y = x

    2then y = 2x. Dividing the interval from 1 to 8 into 7 strips the width of each

    strip is h = 1.

    x y y

    1 1 2

    2 4

    3 94 16

    5 25

    6 36

    7 49

    8 64 16

    TRAPEZIUM RULE =1

    2[1 + 2(4 + 9 + 16 + 25 + 36 + 49) + 64] = 171.5

    CORRECTION =1

    12[2 16] = 1.1667

    CUBIC FIT ESTIMATE = 170.3333 [The Cubic Fit Rule gives the exact value in this case.]

    Exercise 2: If y = 2x + 1 then y =1

    2 2x + 1.2 (by the Chain Rule) =

    1

    2x + 1.

    Dividing the interval from 0 to 12 into 6 strips the width of each strip is h = 2.

    x y y

    0 1 1

    2 2.2361

    4 3

    6 3.6056

    8 4.1231

    10 4.5826

    12 5 0.2

    TRAPEZIUM RULE =2

    2[1 + 2(2.2361 + 3 + 3.6056 + 4.1231 + 4.5826) + 5] = 41.0948

    CORRECTION =4

    12[1 0.2] = 0.2667

    CUBIC FIT ESTIMATE = 41.3615 [The exact value to 4 decimal places is 41.3333.]

    Exercise 3: If y =1

    3x 2then y =

    3

    (3x 2)2 (by the Chain Rule).

    Dividing the interval from 1 to 4 into 6 strips the width of each strip is h = 0.5.

    x y y

    1 1 3

    1.5 0.4

    2 0.25

    2.5 0.1818

    3 0.1429

    3.5 0.1176

    4 0.1 0.03

  • 8/9/2019 Calculus 01 Numerical Integration

    16/20

    150

    TRAPEZIUM RULE =0.5

    2[1 + 2(0.4 + 0.25 + 0.1818 + 0.1429 + 0.1176) + 0.1] = 0.8211

    CORRECTION =0.25

    12[(3) (0.03)] = 0.0619

    CUBIC FIT ESTIMATE = 0.7592

    [The exact value to 4 decimal places is 0.7675. While this isnt particularly it is somewhat better

    than Simpsons Rule with 6 strips.]

    Exercise 4: If y = log x then y =1

    x.

    Dividing the interval from 10 to 40 into 6 strips the width of each strip is h = 5.

    x y y

    10 2.3026 0.1

    15 2.7081

    20 2.9957

    25 3.2189

    30 3.4012

    35 3.555340 3.6889 0.025

    TRAPEZIUM RULE =5

    2[2.3026 + 2(2.7081 + 2.9957 + 3.2189 + 3.4012 + 3.5553) + 3.6889]

    = 94.37475

    CORRECTION =25

    12[0.1 0.025] = 0.1562

    CUBIC FIT ESTIMATE = 94.5309

    [The exact value to 4 decimal places is 94.5293. To get a better estimate than this by Simpsons

    Rule would require using 10 strips.]

    Exercise 5: If y = ex2 then y = 2x. ex2 (by the Chain Rule)

    Dividing the interval from 0 to 1.4 into 7 strips the width of each strip is h = 0.2.

    x y y

    0 1 0

    0.2 1.0408

    0.4 1.1735

    0.6 1.4333

    0.8 1.8965

    1 2.7183

    1.2 4.2207

    1.4 7.0993 19.8781

    TRAPEZIUM RULE

    =0.2

    2[1 + 2(1.0408 + 1.1735 + 1.4333 + 1.8965 + 2.7183 + 4.2207) + 7.0993]

    = 3.3065

    CORRECTION =0.04

    12[0 19.8781] = 0.0663

    CUBIC FIT ESTIMATE = 3.2402

  • 8/9/2019 Calculus 01 Numerical Integration

    17/20

    151

    [The exact value to 4 decimal places is 3.2409. To get a better estimate than this by Simpsons

    Rule would require using 10 strips.]

    Exercise 6: 0

    8x

    2dx 170.6667.

    x y w wy

    0 0 1 0

    1 1 4 4

    2 4 2 8

    3 9 4 36

    4 16 2 32

    5 25 4 100

    6 36 2 72

    7 49 4 196

    8 64 1 64

    TOTAL 512

    INTEGRAL 170.6667

    Exercise 7:0

    8

    x dx 15.0039. x y w wy

    0 0 1 0.0000

    1 1 4 4.0000

    2 1.4142 2 2.8284

    3 1.7321 4 6.9284

    4 2 2 4.0000

    5 2.2361 4 8.9444

    6 2.4495 2 4.8990

    7 2.6458 4 10.5832

    8 2.8284 1 2.8284

    TOTAL 45.0118

    INTEGRAL 15.0039

    Exercise 8:

    1

    5dx

    x 1.6108.

    x y w wy

    1 1 1 1

    1.5 0.6667 4 2.6668

    2 0.5 2 1.0000

    2.5 0.4 4 1.6000

    3 0.3333 2 0.6666

    3.5 0.2857 4 1.1428

    4 0.25 2 0.5000

    4.5 0.2222 4 0.8888

    5 0.2 1 0.2000

    TOTAL 9.6650

    INTEGRAL 1.6108

  • 8/9/2019 Calculus 01 Numerical Integration

    18/20

    152

    Exercise 9:2

    3

    x2 x dx 1.5785.

    x y w wy

    2 1.4142 1 1.4142

    2.125 1.4577 4 5.8308

    2.25 1.5 2 3.0000

    2.375 1.5411 4 6.1644

    2.5 1.5811 2 3.1622

    2.625 1.6202 4 6.4808

    2.75 1.6583 2 3.3166

    2.875 1.6956 4 6.7824

    3 1.7320 1 1.7320

    TOTAL 37.8834

    INTEGRAL 1.5785

    Exercise 10: 10

    30log t dt 59.0095.

    x y w wy

    10 2.3026 1 2.3026

    12.5 2.5257 4 10.1028

    15 2.7080 2 5.4160

    17.5 2.8622 4 11.4488

    20 2.9957 2 5.9914

    22.5 3.1135 4 12.4540

    25 3.2189 2 6.4378

    27.5 3.3142 4 13.2568

    30 3.4012 1 3.4012

    TOTAL 70.8114

    INTEGRAL 59.0095

    Exercise 11:0

    22

    xdt 4.3281. x y w wy

    0 1 1 1.0000

    0.25 1.1892 4 4.7568

    0.5 1.4142 2 2.8284

    0.75 1.6818 4 6.7272

    1 2 2 4.0000

    1.25 2.3784 4 9.5136

    1.5 2.8284 2 5.6568

    1.75 3.3636 4 13.4544

    2 4 1 4.0000

    TOTAL 51.9372

    INTEGRAL 4.3281

  • 8/9/2019 Calculus 01 Numerical Integration

    19/20

    153

    Exercise 12:

    0

    11

    1 + u2 du 0.7854.

    u y w wy

    0 1 1 1.000

    0.125 0.9846 4 3.9384

    0.25 0.9412 2 1.8824

    0.375 0.8767 4 3.5068

    0.5 0.8 2 1.6000

    0.625 0.7191 4 2.8764

    0.75 0.64 2 1.2800

    0.875 0.5664 4 2.2656

    1 0.5 1 0.5000

    TOTAL 18.8496

    INTEGRAL 0.7854

    Exercise 13:

    0

    6

    36 x2

    dx 28.0905. x y w wy

    0 6 1 6.00000.75 5.9529 4 23.8116

    1.5 5.8095 2 11.6190

    2.25 5.5622 4 22.2488

    3 5.1962 2 10.3924

    3.75 4.6838 4 18.7342

    4.5 3.9686 2 7.9372

    5.25 2.9047 4 11.6188

    6 0 1 0.0000

    TOTAL 112.3620

    INTEGRAL 28.0905

  • 8/9/2019 Calculus 01 Numerical Integration

    20/20