Top Banner
Solved Problems on Numerical Integration
46

Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Mar 26, 2015

Download

Documents

Alex McDowell
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Solved Problems on Numerical Integration

Page 2: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Review of the Subject

Page 3: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Definite Integrals f t

k( ) Δxk

k=1

n

∑ D→ 0

⏐ →⏐ ⏐ ⏐

f x( )dx

a

b

Page 4: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

NUMERICAL APPROXIMATIONS

Decompose [a,b] into n subintervals.

Length of a subinterval:

Δx =

b −an

.

kth subinterval:

a + k −1( ) Δx, a + kΔx⎡

⎣⎤⎦.

Riemann sum:

f t

k( ) Δxk=1

n∑ .

Tag-points tk can be chosen freely. a + k −1( ) Δx ≤t

k≤a + kΔx.

Page 5: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Left Approx.

f a + k −1( ) Δx( ) Δx

k=1

n

Right Approx.

f a + kΔx( ) Δx

k=1

n

∑APPROXIMATIONS FOR

f x( )dx

a

b

∫ Δx =

b −an

.

Page 6: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Midpoint Approximation

MID(n) =

Trapezoidal Approximation

TRAP n( ) =

LEFT n( ) +RIGHT n( )

2.

APPROXIMATIONS FOR

f x( )dx

a

b

∫ Δx =

b −an

.

Page 7: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

SIMPSON’S APPROXIMATION

In many cases, Simpson’s Approximation gives best results.

SIMPSON n( ) =

2MID n( ) + TRAP n( )

3.

Page 8: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

PROPERTIES

LEFT(n) ≤ f x( )dx ≤

a

b

If f is increasing,Property

RIGHT(n)

Page 9: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

COMPARING APPROXIMATIONS

Property

a b

f

LEFT n( ) ≤MID n( ) ≤ f x( )dxa

b

∫≤TRAP n( ) ≤RIGHT n( )

If f is increasing and concave-up,

Page 10: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problems

Page 11: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problems

1

x +1 − x −1 dx

−2

2

∫ =?

2

f x( )dx

−3

3

∫ =?

Speed given by table. Estimate the distance traveled.

t (s) 0 1 2 34 5 6 7 89 1

0

s (m/s) 01

428

42

55

67

30

30

45

57

703

Page 12: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

4

x3 dx

0

10

∫ .

Approximate the value of the integral

Which method gives the best result?

5

e

−x2

2 dx0

2

∫ .

Approximate the value of the integral

Estimate the errors.

Problems

Page 13: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Integrals from graphs

x +1 − x −1 dx

−2

2

∫ .

Problem Compute the integral

Solution

Draw the graph of the function and compute the integral as the area under the graph.

First get rid of the absolute value signs.

Page 14: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 = x +1, if x ≥−1

−x −1, if x < −1

⎧⎨⎪

⎩⎪

x −1 = x −1, if x ≥1

1 −x, if x <1

⎧⎨⎪

⎩⎪

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

INTEGRALS FROM GRAPHS

Page 15: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 =

x +1 − x −1( ) , if x ≥1

x +1 − 1 −x( ) , if −1 ≤x <1

−x −1 − 1 −x( ) , if x < −1

⎪⎪

⎪⎪

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

INTEGRALS FROM GRAPHS

Page 16: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 =

2, if x ≥1

2 x , if −1 ≤x <1

2, if x < −1

⎨⎪⎪

⎩⎪⎪

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

INTEGRALS FROM GRAPHS

Page 17: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

x +1 − x −1 =

2, if x ≥1

2 x, if 0 ≤x <1−2 x, if −1 ≤x < 0 2, if x < −1

⎪⎪

⎪⎪

INTEGRALS FROM GRAPHS

Page 18: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

y = ||x + 1| - |x - 1||

INTEGRALS FROM GRAPHS

Page 19: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

The integral is the area of

the yellow domain.

-2 21-1

INTEGRALS FROM GRAPHS

Page 20: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 dx

−2

2

∫ =?Problem

Solution

Area =

2 + 1 + 1 + 2

= 6.-2 21-1

INTEGRALS FROM GRAPHS

Page 21: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x +1 − x −1 dx

−2

2

∫ =?Problem

Answer

-2 21-1

x +1 − x −1 dx−2

2

∫ =6 .

INTEGRALS FROM GRAPHS

Page 22: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

1 2 3-3 -2 -1

2

3

1

Estimate using left Riemann sums

with 12 subintervals of equal length.

Problem

f x( )dx−3

3

∫ =?

INTEGRALS FROM GRAPHS

Page 23: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

f x( )dx−3

3

∫ =?

1 2 3-3 -2 -1

1

2

3Solution

Division points:

(-3,-2.5,-2,-1.5,-1,-0.5,0,0.5,1,

1.5,2,2.5,3).

As tag points tk, use the left end-points.

INTEGRALS FROM GRAPHS

Page 24: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

1 2 3-3 -2 -1

2

3

1

Problem

f x( )dx−3

3

∫ =?

tk f(tk)0.5 2.12

1 2.68

1.5 2.75

2 2.48

2.5 1.98

3 1.25

tk f(tk)-3 1.6

-2.5 1.76

-2 1.75

-1.5 1.37

-1 1.0

-0.5 1.0

0 1.5

INTEGRALS FROM GRAPHS

Page 25: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Answer

f x( )dx−3

3

∫ ≈ f tk( ) Δx =0.5 ⋅

k=1

12∑ f tk( )1

12∑tk f(tk)0.5 2.12

1 2.68

1.5 2.75

2 2.48

2.5 1.98

3 1.25

tk f(tk)-3 1.6

-2.5 1.76

-2 1.75

-1.5 1.37

-1 1.0

-0.5 1.0

0 1.5

Left(12) estimate = 0.5∙(1.6 + 1.76 + 1.75 + 1.37 + 1.0 + 1.0 + 1.5 + 2.12 + 2.68 + 2.75 + 2.48 + 1.98)

≈ 11

INTEGRALS FROM GRAPHS

Page 26: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Average Value of a Function

1 2 3-3 -2 -1

2

3

1

Problem

f x( )dx−3

3

∫ ≈11

11

6≈1.8

The average value of the

function f on the interval [-3,3]

is ≈ 1.8.

Page 27: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Functions given by tables

Problem The speed of a racing car during the first 10 second of a race is given in the table below. Estimate the distance traveled during that time.

t (s) 0 1 2 3 4 5 6 7 8 9 10

s (m/s) 0 14 28 42 55 67 30 30 45 57 70

Page 28: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem Estimate the distance traveled.

1234567

1 2 3 4 5 6 7 8 9 10

10 m/s

seconds

FUNCTIONS GIVEN BY TABLES

Page 29: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem Estimate the distance traveled.

t (s) 0 1 2 3 4 5 6 7 8 9 10

s (m/s) 0 14 28 42 55 67 30 30 45 57 70

Time intervals: 1 second, Δt = 1 (s).

k 1 2 3 4 5 6 7 8 9 10

v 7 21 35 48.5 61 48.5 30 37.5 51 63.5

v = the average velocity during time interval.

FUNCTIONS GIVEN BY TABLES

Page 30: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem Estimate the distance traveled.

Time intervals: 1 second, Δt = 1 (s).

k 1 2 3 4 5 6 7 8 9 10

v (m/s) 7 21 35 48.5 61 48.5 30 37.5 61 63.5

v = the average velocity during time interval.

d = distance traveled during time interval.

d (m) 7 21 35 48.5 61 48.5 30 37.5 51 63.5

FUNCTIONS GIVEN BY TABLES

Page 31: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem Estimate the distance traveled.

Time

Speed

Distance traveled =

speed × time

= total area of the rectangles

FUNCTIONS GIVEN BY TABLES

Page 32: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem Estimate the distance traveled.

k 1 2 3 4 5 6 7 8 9 10

v (m/s) 7 21 35 48.5 61 48.5 30 37.5 61 63.5

d (m) 7 21 35 48.5 61 48.5 30 37.5 51 63.5

Distance traveled during 10 seconds = 403 m.

Average speed 40.3 m/s ≈ 90 mph.

FUNCTIONS GIVEN BY TABLES

Page 33: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem Estimate the distance traveled.

Time

Speed

s(t) = speed of an object at time t.

Distance traveled during time interval

[a,b]

= s t( )dt

a

b

∫ .

DISTANCE AS AN INTEGRAL OF SPEED

Page 34: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Time

Speed

FORMULA 1 RACE CAR

Acceleration 0 to 200 km/h (124 mph): 3.8 s.

Deceleration: up to 5-6 g (48-58 m/s2).

Page 35: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

x3 dx

0

10

∫ .

Approximate the value of the integral

Which method gives the best result?

COMPARING METHODS

Problem

Page 36: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

x3 dx0

1

∫ .Approximate

COMPARING METHODS

Solution The integral is easy to compute:

x3 dx

0

1

∫ =x4

40

1

=14.

Page 37: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

COMPARING METHODS

Solution For this integral:

x3 dx0

1

∫ =14.

LEFT(1) = 0 MID(1) =1/8 RIGHT(1) = 1

TRAP(1) = 1/2

RIGHT(1) = 1

Problem

x3 dx0

1

∫ .Approximate

Page 38: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

COMPARING METHODS

Solution For this integral:

x3 dx0

1

∫ =14.

RIGHT(1) = 1

SIMPSON(1)=

2 ⋅MID 1( ) + TRAP 1( )

3=

14+12

3=14.

Problem

x3 dx0

1

∫ .Approximate

Page 39: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

COMPARING METHODS

Conclude

Simpson’s Approximation gives the precise value of the integral.

RIGHT(1) = 1

This is true for integrals of polynomials of degree at most 3.

Problem

x3 dx0

1

∫ .Approximate

Page 40: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e

−x2

2 dx0

2

∫ .

Approximate the integral

Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

-2 2

Page 41: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e−

x2

2 dx0

2

∫ ≈? Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

Solution

f x( ) =e

−x2

2

The function

is decreasing for 0 ≤ x ≤ 1.

Hence

RIGHT n( ) ≤ e

−x2

2 dx0

2

∫ ≤LEFT n( )

for all n.

Page 42: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e−

x2

2 dx0

2

∫ ≈? Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

Solution Computing with a computer we get

RIGHT 10( ) ≈1 .109 ≤ e

−x2

2 dx0

2

∫ ≤LEFT 10( ) ≈1 .282 .

Error < 0.173.

Page 43: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e−

x2

2 dx0

2

∫ ≈? Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

Solution Observe that

f x( ) =e

−x2

2 ⇒ ′′f x( ) =x2 e−

x2

2 −e−

x2

2 .

⇒ ′′f x( ) > 0 for x >1,

and ′′f x( ) < 0 for −1 < x <1 .

Page 44: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e−

x2

2 dx0

2

∫ ≈? Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

Solution Hence the graph of f is concave down for -1 < x < 1, and concave up for x > 1 or x < -1.

TRAP n, 0,1⎡

⎣⎤⎦( ) +MID n, 1, 2⎡

⎣⎤⎦( ) ≤ e

−x2

2 dx0

2

Hence

Page 45: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e−

x2

2 dx0

2

∫ ≈? Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

Solution Likewise

e

−x2

2 dx0

2

∫ ≤MID n, 0 ,1⎡⎣

⎤⎦( ) + TRAP n, 1, 2⎡

⎣⎤⎦( ).

This yields (with n = 10):

Page 46: Solved Problems on Numerical Integration. Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä Review of the Subject.

Integration/Integration Techniques/Solved Problems on Numerical Integration by M. Seppälä

Problem

e−

x2

2 dx0

2

∫ ≈? Estimate the errors.

INTEGRALS OF BELL SHAPED CURVES

Solution We get e

−x2

2 dx0

2

∫ ≈1.1962 .

Computation with a computer algebra system, yields the more accurate estimate: