6
4.6 Numerical Integration Trapezoidal Rule Area of a Trapezoid h b 1 b 2 ( ) 2 1 2 1 b b h Area + = h 1 b 2

4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

Embed Size (px)

Citation preview

Page 1: 4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

4.6Numerical Integration

Trapezoidal Rule Area of a Trapezoid

h

b1

b2

( )212

1bbhArea +=

h

b1 b2

Page 2: 4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

We are going to sum upn trapezoids from a to b.

a b

Let’s let n = 4 (4 trapezoids)

x0 x1 x2 x3 x4

h

n

abh

−=

Now we need to find thesums of the area of these four trapezoids.

( ) ( )( )102xfxf

n

abA +

−=

( ) ( )( )212xfxf

n

ab+

−+ ( ) ( )( )432

... xfxfn

ab+

−++

simplified to

Page 3: 4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

( ) ( ) ( ) ( ) ( )( )nn xfxfxfxfxfn

ab+++++

−= −1210 2...22

2

∫∞→≈

b

an

dxxf )(lim

The bigger n you use, the more accurate your answerwill be.

Page 4: 4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

Use the Trapezoidal Rule to approximate

4sin0

=∫ nLetxdxπ

π

1

04

π2

π4

3π4

0−=

−=

πnab

h

( ) ( )⎟⎟⎠

⎞⎜⎜⎝

⎛+⎟⎠

⎞⎜⎝

⎛+⎟⎠

⎞⎜⎝

⎛+⎟⎠

⎞⎜⎝

⎛+= πππππfffffArea

4

32

22

420

4)2(

( ) ⎟⎟⎠

⎞⎜⎜⎝

⎛+⎟⎟⎠

⎞⎜⎜⎝

⎛++⎟⎟

⎞⎜⎜⎝

⎛+= 0

2

2212

2

220

8

π 896.1≈

Page 5: 4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

Simpson’s Rule

n is even

⎥⎦

⎤⎢⎣

++++++−

=−

∫ )()(4...

)(4)(2)(4)(

3)(

1

3210

nn

b

a xfxf

xfxfxfxf

n

abdxxf

Note: The coefficients in Simpson’s Rule have the followingpattern

1 4 2 4 2 4 … 4 2 4 2 4 1

Page 6: 4.6 Numerical Integration Trapezoidal RuleArea of a Trapezoid h b1b1 b2b2 h b 1 b 2

Ex. dxx∫π

0

sin

Let n = 4

0 π4

π2

π4

=∫ dxxπ

0

sin ( ) ⎥⎦

⎤⎢⎣

⎡ ++++ πππππsin

4

3sin4

2sin2

4sin40sin

43

=π12

0 + 2 2 + 2 + 2 2 + 0[ ] 005.2≈

if n = 8 0003.2.≈Ans

sin x0

π

∫ dx = −cos x]0

π= 2