0% found this document useful (0 votes)
123 views

Midpoint Approximation: B A B A

The document discusses different numerical integration methods for approximating integrals, including the midpoint rule and trapezoidal rule. The midpoint rule approximates the integral of a function f(x) from a to b using the average of f at the midpoints of evenly spaced intervals over the range. The trapezoidal rule approximates the integral using trapezoids formed by the function values at the endpoints of each interval. An example applies each rule with n=6 intervals to approximate the integral from 1 to 4 of 1/x, finding the midpoint rule result to be 1.3769 and the trapezoidal rule result to be 1.4054, close to the actual value of ln(4)=1.3863.

Uploaded by

Shahnaz Gazal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
123 views

Midpoint Approximation: B A B A

The document discusses different numerical integration methods for approximating integrals, including the midpoint rule and trapezoidal rule. The midpoint rule approximates the integral of a function f(x) from a to b using the average of f at the midpoints of evenly spaced intervals over the range. The trapezoidal rule approximates the integral using trapezoids formed by the function values at the endpoints of each interval. An example applies each rule with n=6 intervals to approximate the integral from 1 to 4 of 1/x, finding the midpoint rule result to be 1.3769 and the trapezoidal rule result to be 1.4054, close to the actual value of ln(4)=1.3863.

Uploaded by

Shahnaz Gazal
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 44

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Midpoint Approximation
Rb
Sometimes, we need to approximate an integral of the form a f (x)dx and we
cannot find an antiderivative
in order to evaluate the integral. Also we may
Rb
need to evaluate a f (x)dx where we do not have a formula for f (x) but we
have data describing a set of values of the function.
Review
We might approximate the given integral using a Riemann sum. Already we
have looked at theR left end-point approximation and the right end point
b
approximation to a f (x)dx in Calculus 1. We also looked at the midpoint
approximation M:
Midpoint Rule If f is integrable on [a, b], then
Z

f (x)dx Mn =
a

n
X

f (xi )x = x(f (x1 ) + f (x2 ) + + f (xn )),

i=1

where
x =

ba
n

and xi = a+ix and xi =

Annette Pilkington

1
(xi1 +xi ) = midpoint of [xi1 , xi ].
2

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Midpoint Approximation
Example Use the midpoint rule with n = 6 to approximate
(= ln(4) = 1.386294361)
Fill in the tables below:

Annette Pilkington

Approximating an integral

R4

1
dx.
1 x

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Midpoint Approximation
Example Use the midpoint rule with n = 6 to approximate
(= ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

1
2

Annette Pilkington

Approximating an integral

R4

1
dx.
1 x

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Midpoint Approximation
Example Use the midpoint rule with n = 6 to approximate
(= ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

1
2

xi

x0 = 1

x1 = 3/2

x2 = 2

Annette Pilkington

x3 = 5/2

x4 = 3

Approximating an integral

x5 = 7/2

x6 = 4

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Midpoint Approximation
Example Use the midpoint rule with n = 6 to approximate
(= ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

1
2

xi

x0 = 1

x1 = 3/2

x2 = 2

x3 = 5/2

x4 = 3

x5 = 7/2

x6 = 4

I
xi = 1 (xi1 + xi )
2
f (xi ) = 1
xi

x1 = 5/4

x2 = 7/4

4/5

4/7

Annette Pilkington

x3 = 9/4
4/9

x4 = 11/4

x5 = 13/4

x6 = 15/4

4/11

4/13

4/15

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Midpoint Approximation
Example Use the midpoint rule with n = 6 to approximate
(= ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

1
2

xi

x0 = 1

x1 = 3/2

x2 = 2

x3 = 5/2

x4 = 3

x5 = 7/2

x6 = 4

I
xi = 1 (xi1 + xi )
2
f (xi ) = 1
xi

M6 =

P6
1

x1 = 5/4

x2 = 7/4

4/5

4/7

f (xi )x =

1
2

4
5

4
7

Annette Pilkington

4
9

x3 = 9/4
4/9

4
11

4
13

x4 = 11/4

x5 = 13/4

x6 = 15/4

4/11

4/13

4/15

4
15

= 1.376934177

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Rb
We can also approximate a definite integral a f (x)dx using an approximation
by trapezoids as shown in the picture below for f (x) 0

The area of the trapezoid above the interval [xi , xi+1 ] is x

(f (xi )+f (xi+1 )


2

Trapezoidal Rule If f is integrable on [a, b], then


b

f (x)dx Tn =
a

x
(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))
2

where
x =

ba
n

and

Annette Pilkington

xi = a + ix and.
Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
and

x =
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)

Annette Pilkington

Approximating an integral

R4

1
dx.
1 x

(=

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
and

x =
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

41
6

1
2

Annette Pilkington

Approximating an integral

R4

1
dx.
1 x

(=

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
and

x =
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

41
6

R4

1
dx.
1 x

(=

1
2

xi

x0 = 1

x1 = 3/2

x2 = 2

Annette Pilkington

x3 = 5/2

x4 = 3

Approximating an integral

x5 = 7/2

x6 = 4

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
and

x =
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

41
6

R4

1
dx.
1 x

(=

1
2

xi

x0 = 1

x1 = 3/2

x2 = 2

x3 = 5/2

x4 = 3

x5 = 7/2

I
xi
f (xi ) = 1
xi

x0 = 1

x1 = 3/2

x2 = 2

Annette Pilkington

x3 = 5/2

x4 = 3

Approximating an integral

x5 = 7/2

x6 = 4

x6 = 4

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
x =

and
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

xi

41
6

x0 = 1

xi
f (xi ) = 1
xi

R4

1
dx.
1 x

1
2
x1 = 3/2

x0 = 1
1

x2 = 2

x1 = 3/2
2/3

x3 = 5/2

x2 = 2
1/2

Annette Pilkington

x4 = 3

x3 = 5/2
2/5

x5 = 7/2

x4 = 3
1/3

x6 = 4

x5 = 7/2
2/7

Approximating an integral

x6 = 4
1/4

(=

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
x =

and
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

xi

I
I

41
6

x0 = 1

xi
f (xi ) = 1
xi

T6 =

x
(f
2

R4

1
dx.
1 x

(=

1
2
x1 = 3/2

x0 = 1
1

x2 = 2

x1 = 3/2
2/3

x3 = 5/2

x2 = 2
1/2

x4 = 3

x3 = 5/2
2/5

x5 = 7/2

x4 = 3
1/3

x6 = 4

x5 = 7/2
2/7

x6 = 4
1/4

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

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
x =

and
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

xi

I
I
I

41
6

x0 = 1

xi
f (xi ) = 1
xi

T6 =
=

1
dx.
1 x

(=

1
2
x1 = 3/2

x0 = 1
1

x2 = 2

x1 = 3/2
2/3

x3 = 5/2

x2 = 2
1/2

x4 = 3

x3 = 5/2
2/5

x5 = 7/2

x4 = 3
1/3

x6 = 4

x5 = 7/2
2/7

x
(f
2

1
(1
4

R4

x6 = 4
1/4

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







+ 2 32 + 2 21 + 2 52 + 2 13 + 2 27 + 14 )

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Trapezoidal Rule
Z b
a

f (x)dx Tn =

x
2

where

(f (x0 ) + 2f (x1 ) + 2f (x2 ) + + +2f (xn1 ) + f (xn ))

ba
x =

and
n

xi = a + ix and.

Example Use the trapezoidal rule with n = 6 to approximate


ln(4) = 1.386294361)
I

x =

xi

I
I

41
6

x0 = 1

xi
f (xi ) = 1
xi

T6 =

1
dx.
1 x

(=

1
2
x1 = 3/2

x0 = 1
1

x2 = 2

x1 = 3/2
2/3

x3 = 5/2

x2 = 2
1/2

x4 = 3

x3 = 5/2
2/5

x5 = 7/2

x4 = 3
1/3

x6 = 4

x5 = 7/2
2/7

x
(f
2

1
(1
4

R4

x6 = 4
1/4

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







+ 2 32 + 2 21 + 2 52 + 2 13 + 2 27 + 14 )

= 1.405357143.

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
The error when using an approximation is the difference between the true value
of the integral and the approximation.

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
The error when using an approximation is the difference between the true value
of the integral and the approximation.
I

The error for the midpoint approximation above above is


Z 4
1
EM =
dx M6 = 1.386294361 1.376934177 = 0.00936018
1 x
The error for the trapezoidal approximation above is
Z 4
1
ET =
dx T6 = 1.386294361 1.405357143 = 0.0190628
x
1

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
The error when using an approximation is the difference between the true value
of the integral and the approximation.
I

The error for the midpoint approximation above above is


Z 4
1
EM =
dx M6 = 1.386294361 1.376934177 = 0.00936018
1 x
The error for the trapezoidal approximation above is
Z 4
1
ET =
dx T6 = 1.386294361 1.405357143 = 0.0190628
x
1

Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the


errors for the trapezoidal approximation and midpoint approximation
respectively, then
|ET |

K (b a)3
12n2
Annette Pilkington

and

|EM |

K (b a)3
24n2

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the errors
for the trapezoidal approximation and midpoint approximation respectively,
then
3
3
|ET |

K (b a)
12n2

and

|EM |

K (b a)
24n2

Example (a) Give


R 4 an upper bound for the error in the trapezoidal
approximation of 1 x1 dx when n = 10.

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the errors
for the trapezoidal approximation and midpoint approximation respectively,
then
3
3
|ET |

K (b a)
12n2

and

|EM |

K (b a)
24n2

Example (a) Give


R 4 an upper bound for the error in the trapezoidal
approximation of 1 x1 dx when n = 10.
I

f (x) = x1 , f 0 (x) =

1
,
x2

f 00 (x) =

Annette Pilkington

2
x3

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the errors
for the trapezoidal approximation and midpoint approximation respectively,
then
3
3
|ET |

K (b a)
12n2

and

|EM |

K (b a)
24n2

Example (a) Give


R 4 an upper bound for the error in the trapezoidal
approximation of 1 x1 dx when n = 10.
I

f (x) = x1 , f 0 (x) =

We can use the above formula for the error bound with any value of K for
which |f 00 (x)| K for 1 x 4.

1
,
x2

f 00 (x) =

Annette Pilkington

2
x3

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the errors
for the trapezoidal approximation and midpoint approximation respectively,
then
3
3
|ET |

K (b a)
12n2

and

|EM |

K (b a)
24n2

Example (a) Give


R 4 an upper bound for the error in the trapezoidal
approximation of 1 x1 dx when n = 10.
I

f (x) = x1 , f 0 (x) =

We can use the above formula for the error bound with any value of K for
which |f 00 (x)| K for 1 x 4.

Since |f 00 (x)| = f 00 (x) = x23 is a decreasing function on the interval [1, 4],
we have that |f 00 (x)| f 00 (1) = 2 on the interval [1, 4]. So we can use
K = 2 in the formula for the error bound above.

1
,
x2

f 00 (x) =

Annette Pilkington

2
x3

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the errors
for the trapezoidal approximation and midpoint approximation respectively,
then
3
3
|ET |

K (b a)
12n2

and

|EM |

K (b a)
24n2

Example (a) Give


R 4 an upper bound for the error in the trapezoidal
approximation of 1 x1 dx when n = 10.
I

f (x) = x1 , f 0 (x) =

We can use the above formula for the error bound with any value of K for
which |f 00 (x)| K for 1 x 4.

Since |f 00 (x)| = f 00 (x) = x23 is a decreasing function on the interval [1, 4],
we have that |f 00 (x)| f 00 (1) = 2 on the interval [1, 4]. So we can use
K = 2 in the formula for the error bound above.

Therefore when n = 10,


Z 4
K (b a)3
2(4 1)3
1
|T10
dx| = |ET |
=
= 0.045
2
12n
12(10)2
1 x

1
,
x2

f 00 (x) =

Annette Pilkington

2
x3

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
Error Bounds If |f 00 (x)| K for a x b. Let ET and EM denote the errors
for the trapezoidal approximation and midpoint approximation respectively,
then
3
3
|ET |

K (b a)
12n2

and

|EM |

K (b a)
24n2

Example (a) Give


R 4 an upper bound for the error in the trapezoidal
approximation of 1 x1 dx when n = 10.
I

f (x) = x1 , f 0 (x) =

We can use the above formula for the error bound with any value of K for
which |f 00 (x)| K for 1 x 4.

Since |f 00 (x)| = f 00 (x) = x23 is a decreasing function on the interval [1, 4],
we have that |f 00 (x)| f 00 (1) = 2 on the interval [1, 4]. So we can use
K = 2 in the formula for the error bound above.

Therefore when n = 10,


Z 4
K (b a)3
2(4 1)3
1
|T10
dx| = |ET |
=
= 0.045
2
12n
12(10)2
1 x

Note that the bound for the error given by the formula is conservative
since it turns out to give |ET | 0.045 when n = 10, compared to a true
error of |ET | = 0.00696667.

1
,
x2

f 00 (x) =

Annette Pilkington

2
x3

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.
I As above, we can use K = 2 to get
|EM |

K (b a)3
2(3)3
=
= 0.0225.
2
24n
24(10)2

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.
I As above, we can use K = 2 to get
|EM |

K (b a)3
2(3)3
=
= 0.0225.
2
24n
24(10)2

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?
I We want |ET | 106 .

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.
I As above, we can use K = 2 to get
|EM |

K (b a)3
2(3)3
=
= 0.0225.
2
24n
24(10)2

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?
I We want |ET | 106 .
3
I We have |ET | K (ba) , where K = 2 since |f 00 (x)| 2 for 1 x 4.
12n2

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.
I As above, we can use K = 2 to get
|EM |

K (b a)3
2(3)3
=
= 0.0225.
2
24n
24(10)2

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?
I We want |ET | 106 .
3
I We have |ET | K (ba) , where K = 2 since |f 00 (x)| 2 for 1 x 4.
12n2
I

Hence we will certainly have |ET | 106 if we choose a value of n for


3
106 .
which 2(41)
12n2

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.
I As above, we can use K = 2 to get
|EM |

K (b a)3
2(3)3
=
= 0.0225.
2
24n
24(10)2

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?
I We want |ET | 106 .
3
I We have |ET | K (ba) , where K = 2 since |f 00 (x)| 2 for 1 x 4.
12n2
I

Hence we will certainly have |ET | 106 if we choose a value of n for


3
106 .
which 2(41)
12n2

That is

(106 )2(27)
12

n2

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error of Approximation
|ET |

K (b a)3
12n2

and

|EM |

K (b a)3
24n2

Example(b) Give
R 4 an upper bound for the error in the midpoint
approximation of 1 x1 dx when n = 10.
I As above, we can use K = 2 to get
|EM |

K (b a)3
2(3)3
=
= 0.0225.
2
24n
24(10)2

(c) Using the error bounds given above determine how large should n be to
ensure that the trapezoidal approximation is accurate to within 0.000001
= 106 ?
I We want |ET | 106 .
3
I We have |ET | K (ba) , where K = 2 since |f 00 (x)| 2 for 1 x 4.
12n2
I

Hence we will certainly have |ET | 106 if we choose a value of n for


3
106 .
which 2(41)
12n2

That is

or n

(106 )2(27)
12

n2

(106 )2(27)
12

= 2121.32, n = 2122 will work.


Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
We can also approximate a definite integral using parabolas to approximate the
curve as in the picture below. [note n is even].

Three points determine a unique parabola. We draw a parabolic segment using


the three points on the curve above x0 , x1 , x2 . We draw a second parabolic
segment using the three points on the curve above x2 , x3 , x4 etc... The area of
the parabolic region beneath the parabola above the interval [xi1 , xi+1 ] is
x
[f (xi1 ) + 4f (xi ) + f (xi+1 )]. We estimate the integral by summing the areas
3
of the regions below these parabolic segments to get Simpsons Rule for even
n:
Z b
a

f (x)dx Sn =

x
3

where

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

ba
and
n
= 13 Tn + 23 Mn .

x =
In fact we have S2n

Annette Pilkington

xi = a + ix and.

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
Z b
a

f (x)dx Sn =

x
3

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

Example Use Simpsons rule with n = 6 to approximate


ln(4) = 1.386294361)
Fill in the tables below:

Annette Pilkington

R4

Approximating an integral

1
dx.
1 x

(=

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
Z b
a

f (x)dx Sn =

x
3

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

Example Use Simpsons rule with n = 6 to approximate


ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
2

Annette Pilkington

Approximating an integral

1
dx.
1 x

(=

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
Z b
a

f (x)dx Sn =

x
3

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

Example Use Simpsons rule with n = 6 to approximate


ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

(=

1
2

I
xi
f (xi ) = 1
xi

x0 = 1
1

x1 = 3/2
2/3

x2 = 2
1/2

Annette Pilkington

x3 = 5/2
2/5

x4 = 3
1/3

Approximating an integral

x5 = 7/2
2/7

x6 = 4
1/4

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
Z b
a

f (x)dx Sn =

x
3

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

Example Use Simpsons rule with n = 6 to approximate


ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

(=

1
2

I
xi
f (xi ) = 1
xi

S6 =

x
(f
3

x0 = 1
1

x1 = 3/2
2/3

x2 = 2
1/2

x3 = 5/2
2/5

x4 = 3
1/3

x5 = 7/2
2/7

x6 = 4
1/4

(x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + 4f (x5 ) + f (x6 )) =

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
Z b
a

f (x)dx Sn =

x
3

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

Example Use Simpsons rule with n = 6 to approximate


ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

(=

1
2

I
xi
f (xi ) = 1
xi

I
I

x0 = 1
1

x1 = 3/2
2/3

x2 = 2
1/2

x3 = 5/2
2/5

x4 = 3
1/3

x5 = 7/2
2/7

x6 = 4
1/4

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + 4f (x5 ) + f (x6 )) =


S6 = x
3
h
i
8
1
1 + 3 + 1 + 85 + 23 + 78 + 14 = 1.387698413
6

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Simpsons Rule
Z b
a

f (x)dx Sn =

x
3

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + + 2f (xn2 ) + 4f (xn1 ) + f (xn ))

Example Use Simpsons rule with n = 6 to approximate


ln(4) = 1.386294361)
Fill in the tables below:
I

x =

41
6

R4

1
dx.
1 x

(=

1
2

I
xi
f (xi ) = 1
xi

x0 = 1
1

x1 = 3/2
2/3

x2 = 2
1/2

x3 = 5/2
2/5

x4 = 3
1/3

x5 = 7/2
2/7

x6 = 4
1/4

(f (x0 ) + 4f (x1 ) + 2f (x2 ) + 4f (x3 ) + 2f (x4 ) + 4f (x5 ) + f (x6 )) =


S6 = x
3
h
i
8
1
1 + 3 + 1 + 85 + 23 + 78 + 14 = 1.387698413
6

The error in this estimate is

Z
ES =
1

1
dx S6 =
x

1.386294361 1.387698413 = 0.00140405


Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error Bound Simpsons Rule


Error Bound for Simpsons Rule Suppose that |f (4) (x)| K for a x b.
If ES is the error involved in using Simpsons Rule, then
|ES |

K (b a)5
180n4

Example How
R 4large should n be in order to guarantee that the Simpson rule
estimate for 1 x1 dx is accurate to within 0.000001 = 106 ?

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error Bound Simpsons Rule


Error Bound for Simpsons Rule Suppose that |f (4) (x)| K for a x b.
If ES is the error involved in using Simpsons Rule, then
|ES |

K (b a)5
180n4

Example How
R 4large should n be in order to guarantee that the Simpson rule
estimate for 1 x1 dx is accurate to within 0.000001 = 106 ?
I

, f 00 (x) = x23 ,
f (3) (x) =
f (x) = x1 ,
f 0 (x) = 1
x2
(4)
433
f (x) = x 5 24 (for 1 k 4 ) = K

Annette Pilkington

Approximating an integral

(3)2
,
x4

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error Bound Simpsons Rule


Error Bound for Simpsons Rule Suppose that |f (4) (x)| K for a x b.
If ES is the error involved in using Simpsons Rule, then
|ES |

K (b a)5
180n4

Example How
R 4large should n be in order to guarantee that the Simpson rule
estimate for 1 x1 dx is accurate to within 0.000001 = 106 ?
I

, f 00 (x) = x23 ,
f (3) (x) =
f (x) = x1 ,
f 0 (x) = 1
x2
(4)
433
f (x) = x 5 24 (for 1 k 4 ) = K

We have |ES |

24(3)5
180n4

Annette Pilkington

Approximating an integral

(3)2
,
x4

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error Bound Simpsons Rule


Error Bound for Simpsons Rule Suppose that |f (4) (x)| K for a x b.
If ES is the error involved in using Simpsons Rule, then
|ES |

K (b a)5
180n4

Example How
R 4large should n be in order to guarantee that the Simpson rule
estimate for 1 x1 dx is accurate to within 0.000001 = 106 ?
(3)2
,
x4

, f 00 (x) = x23 ,
f (3) (x) =
f (x) = x1 ,
f 0 (x) = 1
x2
(4)
433
f (x) = x 5 24 (for 1 k 4 ) = K

We have |ES |

We want |ES | 10 , hence if we find a value of n for which


24(3)5
106 it is guaranteed that |ES | 106 .
180n4

24(3)5
180n4
6

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error Bound Simpsons Rule


Error Bound for Simpsons Rule Suppose that |f (4) (x)| K for a x b.
If ES is the error involved in using Simpsons Rule, then
|ES |

K (b a)5
180n4

Example How
R 4large should n be in order to guarantee that the Simpson rule
estimate for 1 x1 dx is accurate to within 0.000001 = 106 ?
(3)2
,
x4

, f 00 (x) = x23 ,
f (3) (x) =
f (x) = x1 ,
f 0 (x) = 1
x2
(4)
433
f (x) = x 5 24 (for 1 k 4 ) = K

We have |ES |

We want |ES | 10 , hence if we find a value of n for which


24(3)5
106 it is guaranteed that |ES | 106 .
180n4
q
5
5
5
4
6
6 24(3)
4
From 24(3)

10
we
get
that
10

n
or
n

106 24(3)
= 75.
4
180
180
180n
n = 76 will work.

24(3)5
180n4
6

Annette Pilkington

Approximating an integral

Midpoint Approximation Trapezoidal Rule Error Simpsons Rule

Error Bound Simpsons Rule


Error Bound for Simpsons Rule Suppose that |f (4) (x)| K for a x b.
If ES is the error involved in using Simpsons Rule, then
|ES |

K (b a)5
180n4

Example How
R 4large should n be in order to guarantee that the Simpson rule
estimate for 1 x1 dx is accurate to within 0.000001 = 106 ?
(3)2
,
x4

, f 00 (x) = x23 ,
f (3) (x) =
f (x) = x1 ,
f 0 (x) = 1
x2
(4)
433
f (x) = x 5 24 (for 1 k 4 ) = K

We have |ES |

We want |ES | 10 , hence if we find a value of n for which


24(3)5
106 it is guaranteed that |ES | 106 .
180n4
q
5
5
5
4
6
6 24(3)
4
From 24(3)

10
we
get
that
10

n
or
n

106 24(3)
= 75.
4
180
180
180n
n = 76 will work.

24(3)5
180n4
6

This is a conservative upper bound of the error, the actual error for
n = 76 is 8 10 8
Annette Pilkington

Approximating an integral

You might also like