Docsity

Numerical Integration: Riemann Sums and Rectangle Approximations - Prof. Jiwen He, Study notes of Calculus

Toggle sidebar
bg1
Lecture 11Section 8.7 Numerical Integration
Jiwen He
1 Riemann Sums
1.1 Area Problem
Area Problem
Partition of [a, b]
Take a partition P={x0, x1,· · · , xn}of [a, b]. Then Psplits up the interval
[a, b] into a finite number of subintervals [x0, x1], · · · , [xn−1, xn] with a=x0<
x1<· · · < xn=b. We have [a, b] = [x0, x1]∪ · ·· ∪ [xi−1, xi]∪ · ·· ∪ [xn−1, xn]
Remark
This breaks up the region Ω into nsubregions Ω1,· · · ,Ωn: Ω = Ω1∪ · ·· ∪ Ωi∪ · ·· ∪ Ωn
We can estimate the total area of Ωby estimating the area of each subregion Ωi
and adding up the results.
1.2 Lower and Upper Sums
Lower and Upper Sums
Let ∆xi=xi−xi−1,mi= min
x∈[xi−1,xi]f(x), Mi= max
x∈[xi−1,xi]f(x)mi∆xi= area of ri≤area of Ωi≤area of Ri=Mi∆xi
1
pf3
pf4
pf5
pf8
pf9

Partial preview of the text

Download Numerical Integration: Riemann Sums and Rectangle Approximations - Prof. Jiwen He and more Study notes Calculus in PDF only on Docsity!

Lecture 11Section 8.7 Numerical Integration

Jiwen He

1 Riemann Sums

1.1 Area Problem

Area Problem

Partition of [a, b]

Take a partition P = {x 0 , x 1 , · · · , xn} of [a, b]. Then P splits up the interval

[a, b] into a finite number of subintervals [x 0 , x 1 ], · · · , [xn− 1 , xn] with a = x 0 <

x 1 < · · · < xn = b. We have [a, b] = [x 0 , x 1 ] ∪ · · · ∪ [xi− 1 , xi] ∪ · · · ∪ [xn− 1 , xn]

Remark

This breaks up the region Ω into n subregions Ω 1 ,· · · ,Ωn: Ω = Ω 1 ∪ · · · ∪ Ωi ∪ · · · ∪ Ωn

We can estimate the total area of Ω by estimating the area of each subregion Ωi

and adding up the results.

1.2 Lower and Upper Sums

Lower and Upper Sums

Let ∆xi = xi−xi− 1 , mi = min x∈[xi− 1 ,xi]

f (x), Mi = max x∈[xi− 1 ,xi]

f (x) mi∆xi = area of ri ≤ area of Ωi ≤

Lf (P ) :=

n ∑

i=

mi∆xi ≤ I =

∫ (^) b

a

f (x) dx ≤

n ∑

i=

Mi∆xi =: Uf (P )

1.3 Riemann Sum

Riemann Sum

Riemann Sum

S ∗ (P ) = f (x ∗ 1 )∆x 1 + f (x ∗ 2 )∆x 2 + · · · + f (x ∗ n )∆xn

where x ∗ i is any point picked in [xi− 1 , xi] for i = 1 , · · · , n. We have

Lf (P ) :=

n ∑

i=

mi∆xi ≤ S

∗ (P ) :=

n ∑

i=

f (x

∗ i )∆xi ≤

n ∑

i=

Mi∆xi =: Uf (P )

Limit of Riemann Sums ∫ b

a

f (x) dx = lim |P |→ 0

[f (x

∗ 1 )∆x^1 +^ f^ (x

∗ 2 )∆x^2 +^ · · ·^ +^ f^ (x

∗ n)∆xn]

2 Rectangle Approximations

2.1 Regular Partition

Regular Partition

n ∑

i=

f (xi− 1 )∆x,

n ∑

i=

f (xi)∆x,

n ∑

i=

f

xi− 1 + xi

∆x

left-endpoints right-endpoints midpoints

Rectangle Rules

Rectangle Rule for Approximating

∫ (^) b

a f (x) dx

  • Left-endpoint rule: Ln =

b − a

n

[f (x 0 ) + f (x 1 ) + · · · + f (xn− 1 )]

  • Right-endpoint rule: Rn =

b − a

n

[f (x 1 ) + f (x 2 ) + · · · + f (xn)]

  • Midpoint rule: Mn =

b − a

n

[

f

x 0 + x 1

  • · · · + f

xn− 1 + xn

)]

Problem

Find the approximate value of ln 2 =

1

dx x using only the values of f (x) =

1 x

at 1, 6 5

7 5

8 5

9 5

Approximating ln 2 = 0. 69314718 · · ·

L 5 = 1 5

5 6

5 7

5 8

5 9

R 5 =

1 5

5 6

5 7

5 8

5 9

1 2

M 5 =

1 5

10 11

10 13

10 15

10 17

10 19

2.3 Error Estimates

Error Estimates

b

a

f (x) dx − Ln

b − a

n

[f (b) − f (a)]

Error Estimates

  • Left-endpoint rule: E

L n =

b

a

f (x) dx − Ln =

(b − a) 2

n

f

′ (c) = O(∆x)

  • Right-endpoint rule: E

R n =

b

a

f (x) dx − Rn =

(b − a) 2

n

f

′ (c) = O(∆x)

  • Midpoint rule: E

M n =

b

a

f (x) dx − Mn =

(b − a) 3

n 2

f

′′ (c) = O((∆x)

2 )

Error Estimates: Example

Error Estimates

  • Left-endpoint rule: E

L n

∫ (^) b

a

f (x) dx − Ln =

(b − a) 2

n

f

′ (c) = O(∆x)

  • Right-endpoint rule: E

R n

∫ (^) b

a

f (x) dx − Rn =

(b − a) 2

n

f

′ (c) = O(∆x)

  • Midpoint rule: E

M n

∫ (^) b

a

f (x) dx − Mn =

(b − a) 3

n 2

f

′′ (c) = O((∆x)

2 )

Trapeziodal and Simpson’s Rules

Trapeziodal and Simpson’s Rules for Approximating

∫ (^) b

a f (x) dx

  • Trapeziodal Rule: Tn =

b − a

2 n

[f (x 0 ) + 2f (x 1 ) + · · · + 2f (xn− 1 ) + f (xn)]

  • Simpson’s Rule (Parabolic): Sn =

b − a

6 n

f (x 0 ) + f (xn) + 2

[

f (x 1 ) + · · · + 2f (xn− 1 )

]

[

f

x 0 + x 1

  • · · · + f

xn− 1 + xn

)]}

Problem

Find the approximate value of ln 2 =

1

dx x using only the values of f (x) =

1 x

at 1,

6 5

7 5

8 5

9 5

Approximating ln 2 = 0. 69314718 · · ·

T 5 =

1 10

10 6

10 7

10 8

10 9

1 2

S 5 =

1 30

1 2

5 6

5 7

5 8

5 9

[

10 11

10 13

10 15

10 17

10 19

]

3.2 Error Estimates

Error Estimates

b

a

f (x) dx − Tn

b − a

n

[f (b) − f (a)]

Error Estimates

  • Trapeziodal Rule: E

T n =

b

a

f (x) dx−Tn = −

(b − a) 3

n 2

f

′′ (c) = O((∆x)

2 )

  • Simpson’s Rule: E

S n =

b

a

f (x) dx−Sn = −

(b − a) 5

n 4

f

(4) (c) = O((∆x)

4 )

Error Estimates: Example

Error Estimates

  • Trapeziodal Rule: E

T n

∫ (^) b

a

f (x) dx−Tn = −

(b − a) 3

n 2

f

′′ (c) = O((∆x)

2 )

  • Simpson’s Rule: E

S n

∫ (^) b

a

f (x) dx−Sn = −

(b − a) 5

n 4

f

(4) (c) = O((∆x)

4 )