3
4.6 Numerical Integration Sometimes we run into integrals that appear easy but just do not have “easy” antiderivatives. In cases such as this, we turn to numerical integration to approximate the definite integral. The Trapezoidal Rule – Let f be continuous on [a,b]. The Trapezoidal Rule for approximating b a f x dx is given by 0 1 2 1 2 2 ... 2 2 b n n a b a f x dx f x f x f x f x f x n Moreover, as n , the right hand side approaches the definite integral. Example: Use the Trapezoidal Rule to approximate 0 sin xdx using n = 4 and n = 8. Compare this to the actual value. Solution: When n = 4, /4 x , and you obtain 0 3 sin sin 0 2sin 2sin 2sin sin 8 4 2 4 1 2 0 2 2 2 0 1.896 8 4 xdx Similarly, when n = 8, 8 x , and you obtain 0 7 sin sin 0 2sin 2sin ... 2sin sin 16 8 4 8 3 2 2 2 4sin 4sin 1.974 16 8 8 xdx Since this is an integral we can actually find, we compare the actual value to find 0 0 sin cos cos cos 0 1 1 2 xdx x

Sometimes we run into integrals that appear easy but just ...Sometimes we run into integrals that appear easy but just do not have “easy” antiderivatives. In cases such as this,

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Sometimes we run into integrals that appear easy but just ...Sometimes we run into integrals that appear easy but just do not have “easy” antiderivatives. In cases such as this,

4.6 Numerical Integration

Sometimes we run into integrals that appear easy but just do not have “easy” antiderivatives. In cases

such as this, we turn to numerical integration to approximate the definite integral.

The Trapezoidal Rule – Let f be continuous on [a,b]. The Trapezoidal Rule for approximating

b

af x dx

is given by

0 1 2 12 2 ... 22

b

n na

b af x dx f x f x f x f x f x

n

Moreover, as n

, the right hand side approaches the definite integral.

Example: Use the Trapezoidal Rule to approximate 0sin xdx

using n = 4 and n = 8. Compare this to the

actual value.

Solution: When n = 4, / 4x

, and you obtain

0

3sin sin 0 2sin 2sin 2sin sin

8 4 2 4

1 20 2 2 2 0 1.896

8 4

xdx

Similarly, when n = 8, 8x

, and you obtain

0

7sin sin 0 2sin 2sin ... 2sin sin

16 8 4 8

32 2 2 4sin 4sin 1.974

16 8 8

xdx

Since this is an integral we can actually find, we compare the actual value to find

00sin cos cos cos0 1 1 2xdx x

Page 2: Sometimes we run into integrals that appear easy but just ...Sometimes we run into integrals that appear easy but just do not have “easy” antiderivatives. In cases such as this,

We see that as n became larger, and we had more subintervals for approximation, our solution was

closer to the actual value of the integral.

A second method for approximating is called Simpson’s Rule and is named after the English

mathematician Thomas Simpson.

Simpson’s Rule – Let f be continuous on [a,b] and let n be an even integer. Simpson’s Rule for

approximating

b

af x dx is

0 1 2 3 14 2 4 ... 43

b

n na

b af x dx f x f x f x f x f x f x

n

Moreover, as n

, the right hand side approaches the definite integral.

As these are just approximations, it would be nice to know how close we are to being correct. We do

have an error analysis available, but if you want to know more about that take a numerical analysis class

where that is the focus. Here at UTEP that is Math 4329 and Math 5329.

Example: Use Simpson’s Rule and the Trapezoidal Rule to estimate the derivative then compare it to the

actual value. Round all answers to four decimal places.

1. 3

22

2, 4dx n

x

Page 3: Sometimes we run into integrals that appear easy but just ...Sometimes we run into integrals that appear easy but just do not have “easy” antiderivatives. In cases such as this,

2. /2

sin , 4x xdx n