+ All Categories
Home > Documents > Approximate IntegrationApproximate Integration Carmen Bruni February 13, 2012 De nite Integrals...

Approximate IntegrationApproximate Integration Carmen Bruni February 13, 2012 De nite Integrals...

Date post: 13-Feb-2021
Category:
Upload: others
View: 0 times
Download: 0 times
Share this document with a friend
73
Approximate Integration Carmen Bruni February 13, 2012
Transcript
  • Approximate Integration

    Carmen Bruni

    February 13, 2012

  • Definite Integrals

    Sometimes its impossible to compute the indefinite integral of afunction.

    For example, if

    f (x) =√

    1 + x3 sin(6x) + 14

    then ∫f (x)dx

    has no nice formula.However, we should be able to compute or atleast approximate definite integrals of f (x), for example∫ 5

    1f (x)dx .

    After all, definite integrals just represent area.

  • Definite Integrals

    Sometimes its impossible to compute the indefinite integral of afunction. For example, if

    f (x) =√

    1 + x3 sin(6x) + 14

    then

    ∫f (x)dx

    has no nice formula.However, we should be able to compute or atleast approximate definite integrals of f (x), for example∫ 5

    1f (x)dx .

    After all, definite integrals just represent area.

  • Definite Integrals

    Sometimes its impossible to compute the indefinite integral of afunction. For example, if

    f (x) =√

    1 + x3 sin(6x) + 14

    then ∫f (x)dx

    has no nice formula.

    However, we should be able to compute or atleast approximate definite integrals of f (x), for example∫ 5

    1f (x)dx .

    After all, definite integrals just represent area.

  • Definite Integrals

    Sometimes its impossible to compute the indefinite integral of afunction. For example, if

    f (x) =√

    1 + x3 sin(6x) + 14

    then ∫f (x)dx

    has no nice formula.However, we should be able to compute or atleast approximate definite integrals of f (x), for example∫ 5

    1f (x)dx .

    After all, definite integrals just represent area.

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Definite Integral of f (x) =√

    1 + x3 sin(6x) + 14

    How do we approximate definite integrals?

    We have already seen 3 ways. Let x0, x1, .., xn be a partition of[a, b] and let ∆x = b−an .

    1. Left Endpoints Ln =n∑

    i=0

    f (xi−1)∆x .

    2. Right Endpoints Rn =n∑

    i=0

    f (xi )∆x .

    3. Midpoint Rule Mn =n∑

    i=0

    f (x̄i )∆x , where x̄i =xi−1+xi

    2 .

    We will learn two additional ways today

    1. Trapezoid Rule

    2. Simpson’s Rule

  • Left Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14Let’s try each of these methods with our function f (x) on [1, 5]and using a partition of four subintervals. In these cases,∆x = 5−14 = 1.

  • Left Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14Let’s try each of these methods with our function f (x) on [1, 5]and using a partition of four subintervals. In these cases,∆x = 5−14 = 1.

  • Left Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ L4 = f (1)∆x + f (2)∆x + f (3)∆x + f (4)∆x

    = (√

    1 + (1)3 sin(6(1)) + 14)(1)

    +(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +(√

    1 + (4)3 sin(6(4)) + 14)(1)

    = 42.72027090

  • Left Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ L4 = f (1)∆x + f (2)∆x + f (3)∆x + f (4)∆x

    = (√

    1 + (1)3 sin(6(1)) + 14)(1)

    +(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +(√

    1 + (4)3 sin(6(4)) + 14)(1)

    = 42.72027090

  • Left Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ L4 = f (1)∆x + f (2)∆x + f (3)∆x + f (4)∆x

    = (√

    1 + (1)3 sin(6(1)) + 14)(1)

    +(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +(√

    1 + (4)3 sin(6(4)) + 14)(1)

    = 42.72027090

  • Right Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Right endpoint rule now.

  • Right Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Right endpoint rule now.

  • Right Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ R4 = f (2)∆x + f (3)∆x + f (4)∆x + f (5)∆x

    = (√

    1 + (2)3 sin(6(2)) + 14)(1)

    +(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1)

    = 32.02479662

  • Right Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ R4 = f (2)∆x + f (3)∆x + f (4)∆x + f (5)∆x

    = (√

    1 + (2)3 sin(6(2)) + 14)(1)

    +(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1)

    = 32.02479662

  • Right Endpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ R4 = f (2)∆x + f (3)∆x + f (4)∆x + f (5)∆x

    = (√

    1 + (2)3 sin(6(2)) + 14)(1)

    +(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1)

    = 32.02479662

  • Midpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Midpoint rule now.

  • Midpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Midpoint rule now.

  • Midpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ M4 = f (1.5)∆x + f (2.5)∆x + f (3.5)∆x + f (4.5)∆x

    = (√

    1 + (1.5)3 sin(6(1.5)) + 14)(1)

    +(√

    1 + (2.5)3 sin(6(2.5)) + 14)(1)

    +(√

    1 + (3.5)3 sin(6(3.5)) + 14)(1)

    +(√

    1 + (4.5)3 sin(6(4.5)) + 14)(1)

    = 74.23479834

  • Midpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ M4 = f (1.5)∆x + f (2.5)∆x + f (3.5)∆x + f (4.5)∆x

    = (√

    1 + (1.5)3 sin(6(1.5)) + 14)(1)

    +(√

    1 + (2.5)3 sin(6(2.5)) + 14)(1)

    +(√

    1 + (3.5)3 sin(6(3.5)) + 14)(1)

    +(√

    1 + (4.5)3 sin(6(4.5)) + 14)(1)

    = 74.23479834

  • Midpoint Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ M4 = f (1.5)∆x + f (2.5)∆x + f (3.5)∆x + f (4.5)∆x

    = (√

    1 + (1.5)3 sin(6(1.5)) + 14)(1)

    +(√

    1 + (2.5)3 sin(6(2.5)) + 14)(1)

    +(√

    1 + (3.5)3 sin(6(3.5)) + 14)(1)

    +(√

    1 + (4.5)3 sin(6(4.5)) + 14)(1)

    = 74.23479834

  • Other Rules? The Trapezoid Rule.

    How do we get new rules?

    One way is to take combinations of theabove rules. For example, lets try taking half the left endpoint ruleand half the right endpoint rule. This gives us the trapezoid rule.

    Tn =1

    2Ln +

    1

    2Rn

    =1

    2

    n∑i=0

    f (xi−1)∆x +1

    2

    n∑i=0

    f (xi−1)∆x

    =1

    2

    ((f (x0)∆x + f (x1)∆x + ... + f (xn−1)∆x)

    +(f (x1)∆x + ... + f (xn−1)∆x + f (xn)∆x))

    =∆x

    2(f (x0) + 2f (x1) + ... + 2f (xn−1) + f (xn))

  • Other Rules? The Trapezoid Rule.

    How do we get new rules? One way is to take combinations of theabove rules. For example, lets try taking half the left endpoint ruleand half the right endpoint rule. This gives us the trapezoid rule.

    Tn =1

    2Ln +

    1

    2Rn

    =1

    2

    n∑i=0

    f (xi−1)∆x +1

    2

    n∑i=0

    f (xi−1)∆x

    =1

    2

    ((f (x0)∆x + f (x1)∆x + ... + f (xn−1)∆x)

    +(f (x1)∆x + ... + f (xn−1)∆x + f (xn)∆x))

    =∆x

    2(f (x0) + 2f (x1) + ... + 2f (xn−1) + f (xn))

  • Other Rules? The Trapezoid Rule.

    How do we get new rules? One way is to take combinations of theabove rules. For example, lets try taking half the left endpoint ruleand half the right endpoint rule. This gives us the trapezoid rule.

    Tn =1

    2Ln +

    1

    2Rn

    =1

    2

    n∑i=0

    f (xi−1)∆x +1

    2

    n∑i=0

    f (xi−1)∆x

    =1

    2

    ((f (x0)∆x + f (x1)∆x + ... + f (xn−1)∆x)

    +(f (x1)∆x + ... + f (xn−1)∆x + f (xn)∆x))

    =∆x

    2(f (x0) + 2f (x1) + ... + 2f (xn−1) + f (xn))

  • Other Rules? The Trapezoid Rule.

    How do we get new rules? One way is to take combinations of theabove rules. For example, lets try taking half the left endpoint ruleand half the right endpoint rule. This gives us the trapezoid rule.

    Tn =1

    2Ln +

    1

    2Rn

    =1

    2

    n∑i=0

    f (xi−1)∆x +1

    2

    n∑i=0

    f (xi−1)∆x

    =1

    2

    ((f (x0)∆x + f (x1)∆x + ... + f (xn−1)∆x)

    +(f (x1)∆x + ... + f (xn−1)∆x + f (xn)∆x))

    =∆x

    2(f (x0) + 2f (x1) + ... + 2f (xn−1) + f (xn))

  • Other Rules? The Trapezoid Rule.

    How do we get new rules? One way is to take combinations of theabove rules. For example, lets try taking half the left endpoint ruleand half the right endpoint rule. This gives us the trapezoid rule.

    Tn =1

    2Ln +

    1

    2Rn

    =1

    2

    n∑i=0

    f (xi−1)∆x +1

    2

    n∑i=0

    f (xi−1)∆x

    =1

    2

    ((f (x0)∆x + f (x1)∆x + ... + f (xn−1)∆x)

    +(f (x1)∆x + ... + f (xn−1)∆x + f (xn)∆x))

    =∆x

    2(f (x0) + 2f (x1) + ... + 2f (xn−1) + f (xn))

  • Trapezoid Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Why is it called the trapezoid rule? Well,

  • Trapezoid Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Why is it called the trapezoid rule? Well,

  • Trapezoid Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ T4 =∆x

    2(f (x0) + 2f (x1) + 2f (x2) + 2f (x3) + f (x4))

    = 0.5(

    (√

    1 + (1)3 sin(6(1)) + 14)(1)

    +2(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +2(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +2(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1))

    = 37.37253376

  • Trapezoid Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ T4 =∆x

    2(f (x0) + 2f (x1) + 2f (x2) + 2f (x3) + f (x4))

    = 0.5(

    (√

    1 + (1)3 sin(6(1)) + 14)(1)

    +2(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +2(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +2(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1))

    = 37.37253376

  • Trapezoid Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ T4 =∆x

    2(f (x0) + 2f (x1) + 2f (x2) + 2f (x3) + f (x4))

    = 0.5(

    (√

    1 + (1)3 sin(6(1)) + 14)(1)

    +2(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +2(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +2(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1))

    = 37.37253376

  • How good are these rules?

    How close do these rules get to the actual answer?

    It turns outthat the left and right endpoint rules do not give us a goodestimate on how far we are from the actual answer. The midpointand trapezoid rules however do lend themselves to good errorbounds. To describe this, we define the error of the trapezoid ruleto be

    ET =

    ∫ ba

    f (x)dx − Tn

    and the error of the midpoint rule to be

    EM =

    ∫ ba

    f (x)dx −Mn.

    Note that we could only compute the error term exactly if we knewthe value of the integral already (and if we knew that then what’sthe point of doing this!) However, it turns out that we can boundthe error.

  • How good are these rules?

    How close do these rules get to the actual answer? It turns outthat the left and right endpoint rules do not give us a goodestimate on how far we are from the actual answer. The midpointand trapezoid rules however do lend themselves to good errorbounds.

    To describe this, we define the error of the trapezoid ruleto be

    ET =

    ∫ ba

    f (x)dx − Tn

    and the error of the midpoint rule to be

    EM =

    ∫ ba

    f (x)dx −Mn.

    Note that we could only compute the error term exactly if we knewthe value of the integral already (and if we knew that then what’sthe point of doing this!) However, it turns out that we can boundthe error.

  • How good are these rules?

    How close do these rules get to the actual answer? It turns outthat the left and right endpoint rules do not give us a goodestimate on how far we are from the actual answer. The midpointand trapezoid rules however do lend themselves to good errorbounds. To describe this, we define the error of the trapezoid ruleto be

    ET =

    ∫ ba

    f (x)dx − Tn

    and the error of the midpoint rule to be

    EM =

    ∫ ba

    f (x)dx −Mn.

    Note that we could only compute the error term exactly if we knewthe value of the integral already (and if we knew that then what’sthe point of doing this!) However, it turns out that we can boundthe error.

  • How good are these rules?

    How close do these rules get to the actual answer? It turns outthat the left and right endpoint rules do not give us a goodestimate on how far we are from the actual answer. The midpointand trapezoid rules however do lend themselves to good errorbounds. To describe this, we define the error of the trapezoid ruleto be

    ET =

    ∫ ba

    f (x)dx − Tn

    and the error of the midpoint rule to be

    EM =

    ∫ ba

    f (x)dx −Mn.

    Note that we could only compute the error term exactly if we knewthe value of the integral already (and if we knew that then what’sthe point of doing this!) However, it turns out that we can boundthe error.

  • How good are these rules?

    How close do these rules get to the actual answer? It turns outthat the left and right endpoint rules do not give us a goodestimate on how far we are from the actual answer. The midpointand trapezoid rules however do lend themselves to good errorbounds. To describe this, we define the error of the trapezoid ruleto be

    ET =

    ∫ ba

    f (x)dx − Tn

    and the error of the midpoint rule to be

    EM =

    ∫ ba

    f (x)dx −Mn.

    Note that we could only compute the error term exactly if we knewthe value of the integral already (and if we knew that then what’sthe point of doing this!) However, it turns out that we can boundthe error.

  • A Bound on the Error

    Theorem: Suppose that |f ′′(x)| ≤ K for all x ∈ [a, b] and forsome constant K ∈ R. If ET and EM are the errors in thetrapezoid and midpoint rules respectively, then

    |ET | ≤K (b − a)3

    12n2

    and

    |EM | ≤K (b − a)3

    24n2.

    Notice that the bound for EM is twice as good as the bound forET .

  • A Bound on the Error

    Theorem: Suppose that |f ′′(x)| ≤ K for all x ∈ [a, b] and forsome constant K ∈ R. If ET and EM are the errors in thetrapezoid and midpoint rules respectively, then

    |ET | ≤K (b − a)3

    12n2

    and

    |EM | ≤K (b − a)3

    24n2.

    Notice that the bound for EM is twice as good as the bound forET .

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?

    Solution: Set f (x) = e−x2. Then f ′(x) = −2xe−x2 and

    f ′′(x) = −2e−x2 + 4x2e−x2 = e−x2(4x2 − 2).

    I claim that this function is increasing form 0 to 1. To see this,notice that the third derivative is

    f ′′′(x) = e−x2(12x − 8x3) = 4xe−x2(3− 2x2)

    and this function is greater than or equal to 0 between 0 and 1.Hence the derivative is positive on [0, 1] and so the function isincreasing there. Hence the maximum value of f ′′(x) on [0, 1]occurs at x = 1 which gives the value

    K = f ′′(1) = e−(1)2(4(1)2 − 2) = 2

    e= 0.7357588824

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?

    Solution: Set f (x) = e−x2.

    Then f ′(x) = −2xe−x2 and

    f ′′(x) = −2e−x2 + 4x2e−x2 = e−x2(4x2 − 2).

    I claim that this function is increasing form 0 to 1. To see this,notice that the third derivative is

    f ′′′(x) = e−x2(12x − 8x3) = 4xe−x2(3− 2x2)

    and this function is greater than or equal to 0 between 0 and 1.Hence the derivative is positive on [0, 1] and so the function isincreasing there. Hence the maximum value of f ′′(x) on [0, 1]occurs at x = 1 which gives the value

    K = f ′′(1) = e−(1)2(4(1)2 − 2) = 2

    e= 0.7357588824

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?

    Solution: Set f (x) = e−x2. Then f ′(x) = −2xe−x2 and

    f ′′(x) = −2e−x2 + 4x2e−x2 = e−x2(4x2 − 2).

    I claim that this function is increasing form 0 to 1. To see this,notice that the third derivative is

    f ′′′(x) = e−x2(12x − 8x3) = 4xe−x2(3− 2x2)

    and this function is greater than or equal to 0 between 0 and 1.Hence the derivative is positive on [0, 1] and so the function isincreasing there. Hence the maximum value of f ′′(x) on [0, 1]occurs at x = 1 which gives the value

    K = f ′′(1) = e−(1)2(4(1)2 − 2) = 2

    e= 0.7357588824

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?

    Solution: Set f (x) = e−x2. Then f ′(x) = −2xe−x2 and

    f ′′(x) = −2e−x2 + 4x2e−x2 = e−x2(4x2 − 2).

    I claim that this function is increasing form 0 to 1. To see this,notice that the third derivative is

    f ′′′(x) = e−x2(12x − 8x3) = 4xe−x2(3− 2x2)

    and this function is greater than or equal to 0 between 0 and 1.Hence the derivative is positive on [0, 1] and so the function isincreasing there. Hence the maximum value of f ′′(x) on [0, 1]occurs at x = 1 which gives the value

    K = f ′′(1) = e−(1)2(4(1)2 − 2) = 2

    e= 0.7357588824

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?

    Solution: Set f (x) = e−x2. Then f ′(x) = −2xe−x2 and

    f ′′(x) = −2e−x2 + 4x2e−x2 = e−x2(4x2 − 2).

    I claim that this function is increasing form 0 to 1. To see this,notice that the third derivative is

    f ′′′(x) = e−x2(12x − 8x3) = 4xe−x2(3− 2x2)

    and this function is greater than or equal to 0 between 0 and 1.

    Hence the derivative is positive on [0, 1] and so the function isincreasing there. Hence the maximum value of f ′′(x) on [0, 1]occurs at x = 1 which gives the value

    K = f ′′(1) = e−(1)2(4(1)2 − 2) = 2

    e= 0.7357588824

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?

    Solution: Set f (x) = e−x2. Then f ′(x) = −2xe−x2 and

    f ′′(x) = −2e−x2 + 4x2e−x2 = e−x2(4x2 − 2).

    I claim that this function is increasing form 0 to 1. To see this,notice that the third derivative is

    f ′′′(x) = e−x2(12x − 8x3) = 4xe−x2(3− 2x2)

    and this function is greater than or equal to 0 between 0 and 1.Hence the derivative is positive on [0, 1] and so the function isincreasing there. Hence the maximum value of f ′′(x) on [0, 1]occurs at x = 1 which gives the value

    K = f ′′(1) = e−(1)2(4(1)2 − 2) = 2

    e= 0.7357588824

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about

    with the midpoint rule?Solution: With K = 0.7357588824, we use the error boundingtheorem and note that

    ET ≤ 0.001 wheneverK (b − a)3

    12n2≤ 0.001.

    Plugging in our K , a = 0 and b = 1 values and solving for n, wesee that we need n at least as large as

    K (b − a)3

    12n2≤ 0.001 ⇒ (0.7357588824)(1− 0)3 ≤ 12(0.001)n2

    √0.7357588824

    12(0.001)≤ n

    ⇒ 7.830277147 ≤ n

    So we need n to be at least 8.

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about

    with the midpoint rule?Solution: With K = 0.7357588824, we use the error boundingtheorem and note that

    ET ≤ 0.001 wheneverK (b − a)3

    12n2≤ 0.001.

    Plugging in our K , a = 0 and b = 1 values and solving for n, wesee that we need n at least as large as

    K (b − a)3

    12n2≤ 0.001 ⇒ (0.7357588824)(1− 0)3 ≤ 12(0.001)n2

    √0.7357588824

    12(0.001)≤ n

    ⇒ 7.830277147 ≤ n

    So we need n to be at least 8.

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?Solution: For the midpoint rule, we use the error boundingtheorem and note that

    EM ≤ 0.001 wheneverK (b − a)3

    24n2≤ 0.001.

    Plugging in our K = 0.7357588824, a = 0 and b = 1 values andsolving for n, we see that we need n at least as large as

    K (b − a)3

    24n2≤ 0.001 ⇒ (0.7357588824)(1− 0)3 ≤ 24(0.001)n2

    √0.7357588824

    24(0.001)≤ n

    ⇒ 5.536842069 ≤ n

    So we need n to be at least 6. Notice that this n is smaller than theone needed for the trapezoid rule because its a better estimation.

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?Solution: For the midpoint rule, we use the error boundingtheorem and note that

    EM ≤ 0.001 wheneverK (b − a)3

    24n2≤ 0.001.

    Plugging in our K = 0.7357588824, a = 0 and b = 1 values andsolving for n, we see that we need n at least as large as

    K (b − a)3

    24n2≤ 0.001 ⇒ (0.7357588824)(1− 0)3 ≤ 24(0.001)n2

    √0.7357588824

    24(0.001)≤ n

    ⇒ 5.536842069 ≤ n

    So we need n to be at least 6.

    Notice that this n is smaller than theone needed for the trapezoid rule because its a better estimation.

  • Example Question using the error boundQuestion: How large does n have to be in order to estimate∫ 10 e−x2 dx within 0.001 using the trapezoid rule? How about with

    the midpoint rule?Solution: For the midpoint rule, we use the error boundingtheorem and note that

    EM ≤ 0.001 wheneverK (b − a)3

    24n2≤ 0.001.

    Plugging in our K = 0.7357588824, a = 0 and b = 1 values andsolving for n, we see that we need n at least as large as

    K (b − a)3

    24n2≤ 0.001 ⇒ (0.7357588824)(1− 0)3 ≤ 24(0.001)n2

    √0.7357588824

    24(0.001)≤ n

    ⇒ 5.536842069 ≤ n

    So we need n to be at least 6. Notice that this n is smaller than theone needed for the trapezoid rule because its a better estimation.

  • Other Rules? Simpson’s Rule.

    Named after English mathematician Thomas Simpson(1710-1761). For this rule, we can only apply it with an evennumber of sub intervals. We try to combine the left, right, andmidpoint rules. We start by trying a third of each.

    1

    3Ln +

    1

    3Rn +

    1

    3Mn =

    1

    3(Ln + Rn) +

    1

    3Mn =

    2

    3Tn +

    1

    3Mn

    Remember the error bounds? We said that Mn was twice as goodas Tn and so these fractions are the wrong way. To change this,we weigh the Mn piece twice as much. This gives

    S2n =1

    6Ln +

    1

    6Rn +

    2

    3Mn =

    1

    3Tn +

    2

    3Mn.

  • Other Rules? Simpson’s Rule.

    Named after English mathematician Thomas Simpson(1710-1761). For this rule, we can only apply it with an evennumber of sub intervals. We try to combine the left, right, andmidpoint rules. We start by trying a third of each.

    1

    3Ln +

    1

    3Rn +

    1

    3Mn =

    1

    3(Ln + Rn) +

    1

    3Mn =

    2

    3Tn +

    1

    3Mn

    Remember the error bounds? We said that Mn was twice as goodas Tn and so these fractions are the wrong way. To change this,we weigh the Mn piece twice as much. This gives

    S2n =1

    6Ln +

    1

    6Rn +

    2

    3Mn =

    1

    3Tn +

    2

    3Mn.

  • Simpson’s Rule expanded

    Let’s expand this rule. We need a diagram.

    So notice that yi = x2i , ȳi = x2i−1 and

    ∆y =b − an

    = 2b − a

    2n= 2∆x

  • Simpson’s Rule expanded

    Let’s expand this rule. We need a diagram.

    So notice that yi = x2i , ȳi = x2i−1 and

    ∆y =b − an

    = 2b − a

    2n= 2∆x

  • A Formula for Simpson’s RuleHence,

    S2n =1

    3Tn +

    2

    3Mn

    =1

    3· ∆y

    2(f (y0) + 2f (y1) + ... + 2f (yn−1) + f (yn))

    +2

    3·∆y (f (ȳ1) + f (ȳ2) + ... + f (ȳn))

    =∆x

    3

    (f (x2(0)) + 2f (x2(1)) + ... + 2f (x2(n−1)) + f (x2(n))

    )+

    4∆x

    3

    (f (x2(1)−1) + f (x2(2)−1) + ... + f (x2(n)−1)

    )=

    ∆x

    3

    ((f (x0) + 2f (x2) + ... + 2f (x2n−2) + f (x2n))

    +(4f (x1) + 4f (x3) + ... + 4f (x2n−1)))

    =∆x

    3

    (f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + 2f (x4) + ...

    +2f (x2n−2) + 4f (x2n−1) + f (x2n))

  • A Formula for Simpson’s RuleHence,

    S2n =1

    3Tn +

    2

    3Mn

    =1

    3· ∆y

    2(f (y0) + 2f (y1) + ... + 2f (yn−1) + f (yn))

    +2

    3·∆y (f (ȳ1) + f (ȳ2) + ... + f (ȳn))

    =∆x

    3

    (f (x2(0)) + 2f (x2(1)) + ... + 2f (x2(n−1)) + f (x2(n))

    )+

    4∆x

    3

    (f (x2(1)−1) + f (x2(2)−1) + ... + f (x2(n)−1)

    )=

    ∆x

    3

    ((f (x0) + 2f (x2) + ... + 2f (x2n−2) + f (x2n))

    +(4f (x1) + 4f (x3) + ... + 4f (x2n−1)))

    =∆x

    3

    (f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + 2f (x4) + ...

    +2f (x2n−2) + 4f (x2n−1) + f (x2n))

  • A Formula for Simpson’s RuleHence,

    S2n =1

    3Tn +

    2

    3Mn

    =1

    3· ∆y

    2(f (y0) + 2f (y1) + ... + 2f (yn−1) + f (yn))

    +2

    3·∆y (f (ȳ1) + f (ȳ2) + ... + f (ȳn))

    =∆x

    3

    (f (x2(0)) + 2f (x2(1)) + ... + 2f (x2(n−1)) + f (x2(n))

    )+

    4∆x

    3

    (f (x2(1)−1) + f (x2(2)−1) + ... + f (x2(n)−1)

    )

    =∆x

    3

    ((f (x0) + 2f (x2) + ... + 2f (x2n−2) + f (x2n))

    +(4f (x1) + 4f (x3) + ... + 4f (x2n−1)))

    =∆x

    3

    (f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + 2f (x4) + ...

    +2f (x2n−2) + 4f (x2n−1) + f (x2n))

  • A Formula for Simpson’s RuleHence,

    S2n =1

    3Tn +

    2

    3Mn

    =1

    3· ∆y

    2(f (y0) + 2f (y1) + ... + 2f (yn−1) + f (yn))

    +2

    3·∆y (f (ȳ1) + f (ȳ2) + ... + f (ȳn))

    =∆x

    3

    (f (x2(0)) + 2f (x2(1)) + ... + 2f (x2(n−1)) + f (x2(n))

    )+

    4∆x

    3

    (f (x2(1)−1) + f (x2(2)−1) + ... + f (x2(n)−1)

    )=

    ∆x

    3

    ((f (x0) + 2f (x2) + ... + 2f (x2n−2) + f (x2n))

    +(4f (x1) + 4f (x3) + ... + 4f (x2n−1)))

    =∆x

    3

    (f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + 2f (x4) + ...

    +2f (x2n−2) + 4f (x2n−1) + f (x2n))

  • A Formula for Simpson’s RuleHence,

    S2n =1

    3Tn +

    2

    3Mn

    =1

    3· ∆y

    2(f (y0) + 2f (y1) + ... + 2f (yn−1) + f (yn))

    +2

    3·∆y (f (ȳ1) + f (ȳ2) + ... + f (ȳn))

    =∆x

    3

    (f (x2(0)) + 2f (x2(1)) + ... + 2f (x2(n−1)) + f (x2(n))

    )+

    4∆x

    3

    (f (x2(1)−1) + f (x2(2)−1) + ... + f (x2(n)−1)

    )=

    ∆x

    3

    ((f (x0) + 2f (x2) + ... + 2f (x2n−2) + f (x2n))

    +(4f (x1) + 4f (x3) + ... + 4f (x2n−1)))

    =∆x

    3

    (f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + 2f (x4) + ...

    +2f (x2n−2) + 4f (x2n−1) + f (x2n))

  • Simpson’s Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Our last example,

  • Simpson’s Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Our last example,

  • Simpson’s Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ S4 =∆x

    3(f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + f (x4))

    = 13

    ((√

    1 + (1)3 sin(6(1)) + 14)(1)

    +4(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +2(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +4(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1))

    = 37.04120590

  • Simpson’s Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ S4 =∆x

    3(f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + f (x4))

    = 13

    ((√

    1 + (1)3 sin(6(1)) + 14)(1)

    +4(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +2(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +4(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1))

    = 37.04120590

  • Simpson’s Rule for f (x) =√

    1 + x3 sin(6x) + 14

    Using the formula, we see that∫ 51

    f (x)dx ≈ S4 =∆x

    3(f (x0) + 4f (x1) + 2f (x2) + 4f (x3) + f (x4))

    = 13

    ((√

    1 + (1)3 sin(6(1)) + 14)(1)

    +4(√

    1 + (2)3 sin(6(2)) + 14)(1)

    +2(√

    1 + (3)3 sin(6(3)) + 14)(1)

    +4(√

    1 + (4)3 sin(6(4)) + 14)(1)

    +(√

    1 + (5)3 sin(6(5)) + 14)(1))

    = 37.04120590

  • A Bound on the Error

    Let m be an even integer. As before, let

    ES =

    ∫ ba

    f (x)dx − Sm.

    Then

    Theorem: Suppose that |f ′′′′(x)| ≤ K for all x ∈ [a, b] and forsome constant K ∈ R. Then

    |ES | ≤K (b − a)5

    180m4.

  • A Bound on the Error

    Let m be an even integer. As before, let

    ES =

    ∫ ba

    f (x)dx − Sm.

    Then

    Theorem: Suppose that |f ′′′′(x)| ≤ K for all x ∈ [a, b] and forsome constant K ∈ R. Then

    |ES | ≤K (b − a)5

    180m4.

    Definite Integrals


Recommended