23 Hand-out on Romberg Integration and Improper Integrals

Embed Size (px)

Citation preview

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    1/7

    MATH 174

    Numerical Analysis I

    Section SSecond Semester A.Y. 2013-2014

    Mathematics DivisionInstitute of Mathematical Sciences and Physics

    University of the Philippines Los Banos

    March 18, 2014

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 1 / 26

    So far.... the Quadrature Rules

    Newton Cotes QuadraturesThe abscissas are fixed and the weights are from the auxiliary

    polynomials used in interpolation of the integrandGaussian QuadraturesA fixed number of abscissas and weights are chosen to ensure theachievement of the maximum degree of precision possible

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 2 / 26

    Problems with the Quadrature Rules:

    Finding the number of sub-intervals to achieve better accuracy maybe cumbersome.

    The error terms are quite pessimistic, thus they tend to require morework than needed.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 3 / 26

    Romberg Integration

    Romberg Integration is simply repetitive extrapolation of the TrapezoidalRule.

    We start with applying the Trapezoidal Rule using halved step sizes.Denote byRk,j the Romberg approximations where k controls thestep size whilej indicates the level of extrapolation.

    Usually, the approximations are organized in a tableau whereRk,j isin the kth row andj th column.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 4 / 26

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    2/7

    Thus, Rk,1= Traph(f), whereh = b a2k 1 .

    For the succeeding column entries, we use the extrapolation formula:

    Rk,j =4j1Rk,j1 Rk1,j1

    4j1 1 .

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 5 / 26

    Try to recreate this!!

    Lets approximate ln 2 by using a5 row Romberg Integration tableau.

    Solution: Since ln2 =

    2

    1

    1

    xdx then we apply Rombergs method on this

    integral. Doing so will yield the tableau:

    0.7500000000

    0.7083333333 0.6944444444

    0.6970238095 0.6932539683 0.6931746032

    0.6941218504 0.6931545307 0.6931479015 0.6931474776

    0.6933912022 0.6931476528 0.6931471943 0.6931471831

    The last column gives the approximate value 0.6931471819ofln 2.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 6 / 26

    Shortcomings of the Quadrature rules Addressed

    Estimation of the errors will result for the following termination rule.

    Romberg Integration Algorithm Termination Rule

    Let be the specified convergence tolerance. IfRn,n Rn1,n12n1 <

    then halt the algorithm. Else, proceed with iteration.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 7 / 26

    Row by Row Computation

    Suppose we set the convergence tolerance to = 2 108

    R2,2 R1,121 0.0277777778.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 8 / 26

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    3/7

    Row by Row Computation

    Suppose we set the convergence tolerance to = 2 108

    R3,3 R2,222 0.0003174603.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 9 / 26

    Row by Row Computation

    Suppose we set the convergence tolerance to = 2 108

    R4,4 R3,323 0.0000033907.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 10 / 26

    Row by Row Computation

    Suppose we set the convergence tolerance to = 2 108

    R5,5 R4,424 0.00000001848125.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 11 / 26

    Another Integration Anomaly!!!!!

    Even in practical situations we encounter integrals like

    11

    ex 1x

    dx,

    that can make the formulas we derived fail.

    In general, improper integrals can still be successfully approximated by our

    developed techniques, but more caution and care is required.

    Recall from elementary calculus, a definite integral isimproperif any oneof the following occurs:

    the integrand is discontinuous at a number in the integration interval;or

    the integration interval is unbounded.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 12 / 26

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    4/7

    Consider the (NOT-so improper) integral

    10

    x2/3dx. If some basic

    quadrature rules, we can get the following tally of errors per varyingnumber of nodes.

    n Trapezoidal Simpsons Midpoint 2-pt Gaussian

    2 3.502 102 1.336 102 1.117 102 1.338 1024 1.193 102 4.229 103 3.963 103 4.225 104

    8 3.982 103

    1.334 103

    1.361 103

    1.331 104

    16 1.311 103 4.202 104 4.568 104 4.194 10532 4.269 104 1.324 104 1.509 104 1.321 10564 1.380 104 4.169 105 4.930 105 4.161 106EOC 1.5986 1.6651 1.5667 1.6659

    TOC 2 4 2 4

    Cause of under performance: discontinuity of the derivatives of theintegrand at x = 0.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 13 / 26

    Solution: Remove the Fractional Exponent

    ConsiderA =

    1

    0

    x2/3d. Notice that the integrand is not sufficiently

    differentiable, that is, it lacks sufficient smoothness to guarantee

    achievement of convergence.

    To remedy this, let x = u3 = A= 1

    0

    3u4du. Re-performing the

    quadrature rules earlier with this new form for A yields the following errordata:

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 14 / 26

    n Trapezoidal Simpsons Midpoint 2-pt Gaussian

    2 2.438 101 2.500 102 1.195 101 1.042 1034 6.211 102 1.563 103 3.091 102 6.510 1058 1.560 102 9.766 105 7.791 103 4.069 10616 3.905 103 6.104 106 1.952 103 2.543 107

    32 9.765 104

    3.815 107

    4.882 104

    1.589 108

    64 2.441 104 2.384 108 1.221 104 9.934 1010EOC 1.9939 4.0000 1.9894 4.000

    TOC 2 4 2 4

    Lesson: Make your integrand as smooth as possible.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 15 / 26

    Improper Integrals: Removable Discontinuities

    Removable DiscontinuityRecall that f(x) has aremovable discontinuityat x = a if lim

    xaf(x) exists

    but is not equal to f(a).

    1. 11

    ex

    1

    x dx. Note that the integrand f(x) =

    ex

    1

    x is

    discontinuous atx = 0 sincef(0) is undefined. Further, limx0

    f(x) = 1, so

    the discontinuity is removable. Also, note that

    f(x) =1 + 1 + x + x

    2

    2 +

    x3

    6 + ...

    x = 1 +

    x

    2+

    x2

    6 + ....

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 16 / 26

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    5/7

    Thus, f is infinitely differentiable, which will make any quadrature rulework optimally in the integrands current form, except when 0 is used asan abscissa. Thus, we may replace the integrand with

    f(x) =

    ex

    1

    x , x = 01, x= 0

    .

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 17 / 26

    2. B =

    1

    0

    sin xx

    dx . Notice that even iff(x) =sin x

    x is undefined at

    x= 0, limx0

    f(x) = 0. So f has a removable discontinuity at x = 0.

    Checking the McLaurin expansion off yields:

    f(x) =xx

    3

    3! +x

    5

    5! + ...

    x1/22 =x1/2 x

    5/2

    3! +

    x9/2

    5! + ....

    This shows that quadrature rules may not perform optimally with thecurrent integrand. Hence, a change in variable is in place.

    Letx = u2 = B= 1

    0

    2 sin(u2)du.

    Using the (adaptive) three-point Gaussian quadrature rule will require 87function evaluations to get an approximate using tolerance 5 1011. Hadthe change in variable not been done, 677 function evaluations arerequired instead.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 18 / 26

    Improper Integrals: Essential Discontinuities

    Case 1: Algebraic Discontinuity

    f(x) tends to behave like (x a) for some >0, as x a

    3. C= 1

    0

    (cos( 5x 1))ex3

    x2(1 + 3

    x)dx.

    Letfbe the integrand. Then

    limx0+

    f(x) = .

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 19 / 26

    Further, notice that

    f(x) = x2/3+k=1

    (1)k x2k/5

    (2k)!

    +k=1

    xk/2

    k!

    +k=1

    (1)kxk/3

    = x4/15

    2 +

    x1/15

    2 +

    x2/15

    24 x

    7/30

    2 + ....

    Thus, to assure convergence of quadrature rules, we letx = u30 and usethe quadrature rules on

    C=

    1

    0

    30u9(cos u6 1)eu15

    1 + u10 du.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 20 / 26

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    6/7

    Case 2: Logarithmic Discontinuity

    f(x) tends to behave like ln(x a) as x a

    4. D=

    1

    0

    ln x

    1 + x2dx. Let fbe the integrand.

    Notice thatlimx0

    f(x) = thusf has an essential discontinuity. Further,

    f(x) = (1 x2 + x4 x6 + ...) ln x= ln xx2 ln x + x4 ln xx6 ln x + ...

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 21 / 26

    However, for >0,

    limx0

    x ln x= 0.

    Hence, it would be more stable to write the integral as

    D= 1

    0 ln x

    1 + x2

    lnx dx +

    1

    0

    ln x

    = 1

    0

    x2 ln x

    1 + x2dx +

    1

    0

    ln x

    The first summand has a removable discontinuity, while the second caneasily be computed manually.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 22 / 26

    Improper Integrals: Unbounded Integration Intervals

    Here, we consider two substitution rules that will project an infiniteintegration interval to a finite one.Case 1: The integration interval does not contain zero.

    Substitution Rule

    x= 1

    u

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 23 / 26

    5. E=

    +1

    ex

    x dx.

    If we let x = 1

    u = E=

    0

    1

    e1/u

    1/u du

    u2Hence,

    E=

    1

    0

    e1/u

    u du.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 24 / 26

  • 8/10/2019 23 Hand-out on Romberg Integration and Improper Integrals

    7/7

    6. F=

    +

    0

    t2et2

    dt.

    First split the integration interval to separate 0 and as:

    F =

    1

    0

    t2et2

    dt +

    1

    t2et2

    dt.

    In the second integral, let x = 1

    u. Then

    F =

    1

    0

    t2et2

    dt +

    1

    0

    e1/u2

    u4 du.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 25 / 26

    7. G=

    +

    ex2

    1 + x + x2dx.

    To apply the previous substitution, we need to separate the infinities andzero and come up with three integrals with bounds such as,1, 1,.Another way to solve this improper integral is via the substitution rule

    x= tan .

    Doing so will give

    G=

    2

    2

    e tan2

    1 + sin cos d.

    NJA Egarguin (IMSP, UPLB) MATH 174 March 18, 2014 26 / 26