• Tidak ada hasil yang ditemukan

Matematika

N/A
N/A
Protected

Academic year: 2017

Membagikan "Matematika"

Copied!
114
0
0

Teks penuh

(1)

Section 5.7

Numerical Integration

Math 1a

Introduction to Calculus

April 25, 2008

Announcements

◮ Midterm III is Wednesday 4/30 in class (covers §4.9–5.6) ◮ Friday 5/2 is Movie Day!

(2)

Announcements

◮ Midterm III is Wednesday 4/30 in class (covers §4.9–5.6)

◮ Friday 5/2 is Movie Day!

◮ Final (tentative) 5/23 9:15am

◮ Problem Sessions Sunday, Thursday, 7pm, SC 310

(3)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(4)

Theorem (Integration by Parts)

Let u and v be differentiable functions. Then

u(x)v(x)dx=u(x)v(x)

− ∫

v(x)u(x)dx .

Succinctly,

u dv=uv− ∫

v du.

Theorem (Integration by Parts, definite form)

b

a u dv uv b

(5)

Theorem (Integration by Parts)

Let u and v be differentiable functions. Then

u(x)v(x)dx=u(x)v(x)

− ∫

v(x)u(x)dx .

Succinctly,

u dv=uv− ∫

v du.

Theorem (Integration by Parts, definite form)

b

a u dv= uv

¯ ¯ ¯ ¯

b

a

b

(6)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(7)

Why estimate an integral when we have the FTC?

◮ Antidifferentiation is

“hard”

◮ Sometimes

antidifferentiation is

impossible

◮ Sometimes all we need

is an approximation

◮ These methods actually

(8)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

Why not average them out and make a trapezoid?

A

f xi 1 f xi

2 x

The smaller the

(9)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

Why not average them out and make a trapezoid?

A

f xi 1 f xi

2 x

The smaller the

(10)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A=

f xi 1 f xi

2 x

The smaller the

(11)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A= f(xi−1) +f(xi)

2 ∆x

The smaller the

(12)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A= f(xi−1) +f(xi)

2 ∆x

◮ The smaller the

(13)

The Trapezoidal Rule

Definition

Divide the interval[a,b]up intonpieces. Let∆x=

ba n , xi=a+ix, andyi =f(xi)for eachifrom 1 ton.

The(n+1)-pointTrapezoidal Ruleapproximation to

b

a f(x)dx

is given by

Tn(f) = n

i=1

f(xi−1) +f(xi)

2 ∆x

= ∆x

[y 0+y1

2 +

y1+y2

2 +· · ·+

yn1+yn

2

]

= ∆x

2

(

y0+2y1+2y2+· · ·+2yn−1+yn

(14)

Example

Example Estimate

∫ 1

0 x

2dxwith the Trapezoidal Rule andn=4.

Solution

The set of values is

y0 y1 y2 y3 y4 0 1 4

2 2 4

2 3 4

2 4 4

2

So

Tn f 2 41 0 2 161 2 164 2 169 1616

1 8

2 8 18 16

16 44

(15)

Example

Example Estimate

∫ 1

0 x

2dxwith the Trapezoidal Rule andn=4.

Solution

The set of values is

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

Tn(f) =21

·4 (

0+2·

1

16 +2·

4

16+2·

9 16+ 16 16 ) = 1 8 (2

+8+18+16

16

)

(16)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Trapezoidal Rule andn=8.

(17)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Trapezoidal Rule andn=8.

(18)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(19)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(20)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(21)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(22)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=

f xi 1 xi

2 x

(23)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=f

(x

i−1+xi 2

)

x

(24)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=f

(x

i−1+xi 2

)

x

◮ Again, the smaller the

(25)

The Midpoint Rule

Definition

Divide the interval[a,b]up intonpieces. Let∆x=

ba

n , and

xi=a+ixfor eachifrom 1 ton.

The(n+1)-pointMidpoint Ruleapproximation to

b

a f(x)dxis

given by

Mn(f) = n

i=1

f (x

i−1+xi 2

)

x

= ∆x

( f

(x 0+x1

2

)

+f

(x 1+x2

2

)

+· · ·+f (x

n−1+xn 2

(26)

Example

Example Estimate

∫ 1

0 x

2dxwith the Midpoint Rule andn=4.

Solution

The set of midpoints is

0 18 38 58 78

So

Mn f 14 0 18 2 38 2 58 2 78 2

1 4

1 9 25 49

64 84

(27)

Example

Example Estimate

∫ 1

0 x

2dxwith the Midpoint Rule andn=4.

Solution

The set of midpoints is

{

0,18,

3 8, 5 8, 7 8 } So

Mn(f) =14

(

0+(1 8

)2

+(3

8 )2

+(5

8 )2

+(7

8 )2)

= 1

4

(1

+9+25+49

64

)

(28)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Midpoint Rule andn=8.

(29)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Midpoint Rule andn=8.

(30)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(31)

Parabolas instead of lines

.

◮ Trapezoidal Rule

approximates the function with a line

◮ Why not use a parabola?

◮ A section of a parabola

passing through equally spaced points is

x

3 (y0+4y1+y2)

◮ need an even number of

(32)

Simpson’s Rule

Definition

Divide the interval[a,b]up intonpieces, wherenis even. Let

x= ba

n ,xi=a+ix, andyi =f(xi)for eachifrom 1 ton.

The(n+1)-pointSimpson’s Ruleapproximation to

b

a f(x)dxis

given by

Sn(f) = n/2 ∑

i=1

x

3

(

y2i+4y2i+1+y2i+2

)

= ba

3n (

y0+4y1+2y2+4y3+· · ·+2yn−2+4yn−1+yn

(33)

Meet the Simpsons

Thomas Simpson

(34)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

y0 y1 y2 y3 y4 0 14 2 24 2 34 2 44 2

So

S4 f 3 41 0 4 161 2 164 4 169 1616

1 12

4 8 36 16

16

1 12

64 16

1 3

(35)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

S4(f) =31 ·4

(

0+4·

1

16 +2·

4

16 +4·

9 16+ 16 16 ) = 1 12 (4

+8+36+16

16 ) = 1 12 · 64 16 = 1 3

(36)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

S4(f) =31 ·4

(

0+4·

1

16 +2·

4

16 +4·

9 16+ 16 16 ) = 1 12 (4

+8+36+16

(37)

Your turn

Example

Use Simpson’s Rule withn=8 to estimate ln 2.

(38)

Your turn

Example

Use Simpson’s Rule withn=8 to estimate ln 2.

(39)

Section 5.7

Numerical Integration

Math 1a

Introduction to Calculus

April 25, 2008

Announcements

◮ Midterm III is Wednesday 4/30 in class (covers §4.9–5.6) ◮ Friday 5/2 is Movie Day!

(40)

Announcements

◮ Midterm III is Wednesday 4/30 in class (covers §4.9–5.6)

◮ Friday 5/2 is Movie Day!

◮ Final (tentative) 5/23 9:15am

◮ Problem Sessions Sunday, Thursday, 7pm, SC 310

(41)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(42)

Theorem (Integration by Parts)

Let u and v be differentiable functions. Then

u(x)v(x)dx=u(x)v(x)

− ∫

v(x)u(x)dx .

Succinctly,

u dv=uv− ∫

v du.

Theorem (Integration by Parts, definite form)

b

a u dv uv b

(43)

Theorem (Integration by Parts)

Let u and v be differentiable functions. Then

u(x)v(x)dx=u(x)v(x)

− ∫

v(x)u(x)dx .

Succinctly,

u dv=uv− ∫

v du.

Theorem (Integration by Parts, definite form)

b

a u dv= uv

¯ ¯ ¯ ¯

b

a

b

(44)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(45)

Why estimate an integral when we have the FTC?

◮ Antidifferentiation is

“hard”

◮ Sometimes

antidifferentiation is

impossible

◮ Sometimes all we need

is an approximation

◮ These methods actually

(46)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

Why not average them out and make a trapezoid?

A

f xi 1 f xi

2 x

The smaller the

(47)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

Why not average them out and make a trapezoid?

A

f xi 1 f xi

2 x

The smaller the

(48)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A=

f xi 1 f xi

2 x

The smaller the

(49)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A= f(xi−1) +f(xi)

2 ∆x

The smaller the

(50)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A= f(xi−1) +f(xi)

2 ∆x

◮ The smaller the

(51)

The Trapezoidal Rule

Definition

Divide the interval[a,b]up intonpieces. Let∆x=

ba n , xi=a+ix, andyi =f(xi)for eachifrom 1 ton.

The(n+1)-pointTrapezoidal Ruleapproximation to

b

a f(x)dx

is given by

Tn(f) = n

i=1

f(xi−1) +f(xi)

2 ∆x

= ∆x

[y 0+y1

2 +

y1+y2

2 +· · ·+

yn1+yn

2

]

= ∆x

2

(

y0+2y1+2y2+· · ·+2yn−1+yn

(52)

Example

Example Estimate

∫ 1

0 x

2dxwith the Trapezoidal Rule andn=4.

Solution

The set of values is

y0 y1 y2 y3 y4 0 1 4

2 2 4

2 3 4

2 4 4

2

So

Tn f 2 41 0 2 161 2 164 2 169 1616

1 8

2 8 18 16

16 44

(53)

Example

Example Estimate

∫ 1

0 x

2dxwith the Trapezoidal Rule andn=4.

Solution

The set of values is

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

Tn(f) =21

·4 (

0+2·

1

16 +2·

4

16+2·

9 16+ 16 16 ) = 1 8 (2

+8+18+16

16

)

(54)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Trapezoidal Rule andn=8.

(55)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Trapezoidal Rule andn=8.

(56)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(57)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(58)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(59)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(60)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=

f xi 1 xi

2 x

(61)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=f

(x

i−1+xi 2

)

x

(62)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=f

(x

i−1+xi 2

)

x

◮ Again, the smaller the

(63)

The Midpoint Rule

Definition

Divide the interval[a,b]up intonpieces. Let∆x=

ba

n , and

xi=a+ixfor eachifrom 1 ton.

The(n+1)-pointMidpoint Ruleapproximation to

b

a f(x)dxis

given by

Mn(f) = n

i=1

f (x

i−1+xi 2

)

x

= ∆x

( f

(x 0+x1

2

)

+f

(x 1+x2

2

)

+· · ·+f (x

n−1+xn 2

(64)

Example

Example Estimate

∫ 1

0 x

2dxwith the Midpoint Rule andn=4.

Solution

The set of midpoints is

0 18 38 58 78

So

Mn f 14 0 18 2 38 2 58 2 78 2

1 4

1 9 25 49

64 84

(65)

Example

Example Estimate

∫ 1

0 x

2dxwith the Midpoint Rule andn=4.

Solution

The set of midpoints is

{

0,18,

3 8, 5 8, 7 8 } So

Mn(f) =14

(

0+(1 8

)2

+(3

8 )2

+(5

8 )2

+(7

8 )2)

= 1

4

(1

+9+25+49

64

)

(66)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Midpoint Rule andn=8.

(67)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Midpoint Rule andn=8.

(68)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(69)

Parabolas instead of lines

.

◮ Trapezoidal Rule

approximates the function with a line

◮ Why not use a parabola?

◮ A section of a parabola

passing through equally spaced points is

x

3 (y0+4y1+y2)

◮ need an even number of

(70)

Simpson’s Rule

Definition

Divide the interval[a,b]up intonpieces, wherenis even. Let

x= ba

n ,xi=a+ix, andyi =f(xi)for eachifrom 1 ton.

The(n+1)-pointSimpson’s Ruleapproximation to

b

a f(x)dxis

given by

Sn(f) = n/2 ∑

i=1

x

3

(

y2i+4y2i+1+y2i+2

)

= ba

3n (

y0+4y1+2y2+4y3+· · ·+2yn−2+4yn−1+yn

(71)

Meet the Simpsons

Thomas Simpson

(72)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

y0 y1 y2 y3 y4 0 14 2 24 2 34 2 44 2

So

S4 f 3 41 0 4 161 2 164 4 169 1616

1 12

4 8 36 16

16

1 12

64 16

1 3

(73)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

S4(f) =31 ·4

(

0+4·

1

16 +2·

4

16 +4·

9 16+ 16 16 ) = 1 12 (4

+8+36+16

16 ) = 1 12 · 64 16 = 1 3

(74)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

S4(f) =31 ·4

(

0+4·

1

16 +2·

4

16 +4·

9 16+ 16 16 ) = 1 12 (4

+8+36+16

(75)

Your turn

Example

Use Simpson’s Rule withn=8 to estimate ln 2.

(76)

Your turn

Example

Use Simpson’s Rule withn=8 to estimate ln 2.

(77)

Section 5.7

Numerical Integration

Math 1a

Introduction to Calculus

April 25, 2008

Announcements

◮ Midterm III is Wednesday 4/30 in class (covers §4.9–5.6) ◮ Friday 5/2 is Movie Day!

(78)

Announcements

◮ Midterm III is Wednesday 4/30 in class (covers §4.9–5.6)

◮ Friday 5/2 is Movie Day!

◮ Final (tentative) 5/23 9:15am

◮ Problem Sessions Sunday, Thursday, 7pm, SC 310

(79)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(80)

Theorem (Integration by Parts)

Let u and v be differentiable functions. Then

u(x)v(x)dx=u(x)v(x)

− ∫

v(x)u(x)dx .

Succinctly,

u dv=uv− ∫

v du.

Theorem (Integration by Parts, definite form)

b

a u dv uv b

(81)

Theorem (Integration by Parts)

Let u and v be differentiable functions. Then

u(x)v(x)dx=u(x)v(x)

− ∫

v(x)u(x)dx .

Succinctly,

u dv=uv− ∫

v du.

Theorem (Integration by Parts, definite form)

b

a u dv= uv

¯ ¯ ¯ ¯

b

a

b

(82)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(83)

Why estimate an integral when we have the FTC?

◮ Antidifferentiation is

“hard”

◮ Sometimes

antidifferentiation is

impossible

◮ Sometimes all we need

is an approximation

◮ These methods actually

(84)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

Why not average them out and make a trapezoid?

A

f xi 1 f xi

2 x

The smaller the

(85)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

Why not average them out and make a trapezoid?

A

f xi 1 f xi

2 x

The smaller the

(86)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A=

f xi 1 f xi

2 x

The smaller the

(87)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A= f(xi−1) +f(xi)

2 ∆x

The smaller the

(88)

Trapezoids instead of rectangles

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ In the case of a simple

decreasing function like this one, clearlyLnis too

much andRnis not

enough.

◮ Why not average them

out and make a trapezoid?

A= f(xi−1) +f(xi)

2 ∆x

◮ The smaller the

(89)

The Trapezoidal Rule

Definition

Divide the interval[a,b]up intonpieces. Let∆x=

ba n , xi=a+ix, andyi =f(xi)for eachifrom 1 ton.

The(n+1)-pointTrapezoidal Ruleapproximation to

b

a f(x)dx

is given by

Tn(f) = n

i=1

f(xi−1) +f(xi)

2 ∆x

= ∆x

[y 0+y1

2 +

y1+y2

2 +· · ·+

yn1+yn

2

]

= ∆x

2

(

y0+2y1+2y2+· · ·+2yn−1+yn

(90)

Example

Example Estimate

∫ 1

0 x

2dxwith the Trapezoidal Rule andn=4.

Solution

The set of values is

y0 y1 y2 y3 y4 0 1 4

2 2 4

2 3 4

2 4 4

2

So

Tn f 2 41 0 2 161 2 164 2 169 1616

1 8

2 8 18 16

16 44

(91)

Example

Example Estimate

∫ 1

0 x

2dxwith the Trapezoidal Rule andn=4.

Solution

The set of values is

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

Tn(f) =21

·4 (

0+2·

1

16 +2·

4

16+2·

9 16+ 16 16 ) = 1 8 (2

+8+18+16

16

)

(92)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Trapezoidal Rule andn=8.

(93)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Trapezoidal Rule andn=8.

(94)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(95)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(96)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(97)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

Another possibility would be to average the

points.

A

f xi 1 xi

2 x

(98)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=

f xi 1 xi

2 x

(99)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=f

(x

i−1+xi 2

)

x

(100)

Midpoints to cancel out the slop

. .

xi−1 .xi .

f(xi−1)

.

f(xi)

◮ The Trapezoidal Rule

averages the values

◮ Another possibility

would be to average the

points.

A=f

(x

i−1+xi 2

)

x

◮ Again, the smaller the

(101)

The Midpoint Rule

Definition

Divide the interval[a,b]up intonpieces. Let∆x=

ba

n , and

xi=a+ixfor eachifrom 1 ton.

The(n+1)-pointMidpoint Ruleapproximation to

b

a f(x)dxis

given by

Mn(f) = n

i=1

f (x

i−1+xi 2

)

x

= ∆x

( f

(x 0+x1

2

)

+f

(x 1+x2

2

)

+· · ·+f (x

n−1+xn 2

(102)

Example

Example Estimate

∫ 1

0 x

2dxwith the Midpoint Rule andn=4.

Solution

The set of midpoints is

0 18 38 58 78

So

Mn f 14 0 18 2 38 2 58 2 78 2

1 4

1 9 25 49

64 84

(103)

Example

Example Estimate

∫ 1

0 x

2dxwith the Midpoint Rule andn=4.

Solution

The set of midpoints is

{

0,18,

3 8, 5 8, 7 8 } So

Mn(f) =14

(

0+(1 8

)2

+(3

8 )2

+(5

8 )2

+(7

8 )2)

= 1

4

(1

+9+25+49

64

)

(104)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Midpoint Rule andn=8.

(105)

Your Turn

Example Estimate

ln 2=

∫ 2

1

1

xdx

with the Midpoint Rule andn=8.

(106)

Outline

Last Time: Integration by Parts

The Trapezoidal Rule

Trapezoids instead of rectangles

The Midpoint Rule

Simpson’s Rule

Error estimates for the Trapezoidal and Midpoint Rules

(107)

Parabolas instead of lines

.

◮ Trapezoidal Rule

approximates the function with a line

◮ Why not use a parabola?

◮ A section of a parabola

passing through equally spaced points is

x

3 (y0+4y1+y2)

◮ need an even number of

(108)

Simpson’s Rule

Definition

Divide the interval[a,b]up intonpieces, wherenis even. Let

x= ba

n ,xi=a+ix, andyi =f(xi)for eachifrom 1 ton.

The(n+1)-pointSimpson’s Ruleapproximation to

b

a f(x)dxis

given by

Sn(f) = n/2 ∑

i=1

x

3

(

y2i+4y2i+1+y2i+2

)

= ba

3n (

y0+4y1+2y2+4y3+· · ·+2yn−2+4yn−1+yn

(109)

Meet the Simpsons

Thomas Simpson

(110)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

y0 y1 y2 y3 y4 0 14 2 24 2 34 2 44 2

So

S4 f 3 41 0 4 161 2 164 4 169 1616

1 12

4 8 36 16

16

1 12

64 16

1 3

(111)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

S4(f) =31 ·4

(

0+4·

1

16 +2·

4

16 +4·

9 16+ 16 16 ) = 1 12 (4

+8+36+16

16 ) = 1 12 · 64 16 = 1 3

(112)

Examples

Example

Use Simpson’s rule withn=4 to estimate

∫ 1

0 x 2dx

Solution

{

y0,y1,y2,y3,y4

}

={0,(1

4 )2 , (2 4 )2 , (3 4 )2 , (4 4

)2}

So

S4(f) =31 ·4

(

0+4·

1

16 +2·

4

16 +4·

9 16+ 16 16 ) = 1 12 (4

+8+36+16

(113)

Your turn

Example

Use Simpson’s Rule withn=8 to estimate ln 2.

(114)

Your turn

Example

Use Simpson’s Rule withn=8 to estimate ln 2.

Referensi

Garis besar

Dokumen terkait

20 Otonomi Daerah, Pemerintahan Umum, Administrasi Keuangan Daerah, Perangkat Daerah, Kepegawaian dan Persandian. Unit Organisasi

[r]

[r]

Dengan melihat kerugian di atas, maka dibuat sebuah alat yang dapat menghitung. besar energi listrik yang di pakai konsumen dan mengirim data tersebut

penampilan karyawan agar lebih rapi. Peningkatan kepuasan konsumen akan meningkat seiring dengan meningkatnya keandalan yang ditawarkan. Kepuasan konsumen Good Deal

Chi-Square Distribution Test Results for Frequencies of Bloom's Taxonomy of Cognitive Domain Contained in the Chemistry Questions for the General Secondary Examination in Jordan

Dipilihnya Koran Tempo sebagai obyek penelitian disebabkan karena kekhasan yang dimilikinya dengan menampilkan gambar visual pada halaman depan terkait dengan berita utama,

[r]