Composite Numerical Integration: Overcoming Large Intervals with Piecewise & Simpson's, Lecture notes of Calculus

The challenges of using Newton-Cotes methods, specifically Simpson's Rule, for large integration intervals. The text suggests a piecewise approach, dividing the interval into several subintervals and applying Simpson's Rule to each one. The document also introduces the concept of Generalized Simpson's Rule and provides a summary of the method's application.

Typology: Lecture notes

2021/2022

Uploaded on 09/12/2022

aaroncastle1
aaroncastle1 🇬🇧

4.3

(8)

223 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
4.4: Composite Numerical
Integration
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Composite Numerical Integration: Overcoming Large Intervals with Piecewise & Simpson's and more Lecture notes Calculus in PDF only on Docsity!

4.4: Composite Numerical

Integration

Problem arising from large

integration interval

)]

( ) ( 4 ) ( [ 3 ) (

2

1

0

(^20)

x f x f x f h

dx x

f x x^

Use Simpson’s Rule

76958 .

56

)

4

(

2 3

4

2

0

(^40)

1

=

=

=

e

e

e

dx

e

f

x

Analytical Solution:

f

59819 .

53

0

4

(^40)

2

=

=

=

e

e

dx

e

x

1714

3

.

3

|

|

2

1

=

=

f

f

error

Solution:
piecewise
technique (divide [0,4] into
several subinterval) e.g. [0,4]= [0,1]+ [1,2]+ [2,3]+ [3,4]and use Simpson’ rule (

i.e. low-order

Newton-Cotes

) in each subinterval.

)]

( ) ( 4 ) ( [ 3 )

(^

2

1

0

(^20)

x f x f x f h

dx x f x x^

2

3 2

1 2

4 0 0

(^10)

2 1

(^32)

(^43)

3

e e e e e e

dx
e
dx
e
dx
e
dx
e
dx
e
f

x

x

x

x

x

01807 .

0

|

|

2

3

=

=

f

f

error

Generalized Simpson’s rule using
piecewise
(composite)
method

y

y=f(x)

jh

a

x

n

a

b

h

n

j

j^

=

=

=

/ )

(

1

) 2 /

,....( (^1) , 0 x

0 x

a

=

1 x

... 2 x

n x

b

=

2 2

j

x

1 2

j

x

... 2

j x

Remarks for the method: z

Application at each subinterval. So

n

has to be

even, i.e. total number of points is

n+

.

z

Points at

j=2, 4,…2j

are used twice.

)

(

90

)

(

2 / 1

) 4 (

5

j

n j

f

h

f

E

ζ

=

=

Based on

Extreme Value Theorem,

thus

) ( ) ( 2 ) (

) ( 2 ) ( ) ( 2

) ( ) ( ) ( 4

] , [

(^2) /^1

4

4

] , [

4

] , [

(^2) /^1

4

4

] , [

4 ] , [ 4 4 ] , [

max
min
max
min
max
min

x f f n x f

x f n f x f n

x

f

f

x

f

b a x

j

n j

b a x

b a x

j

n j

b a x

b a x j b a x

=

=

ζ ζ

ζ

Or

Use

Intermediate Value Theorem, (if

there exists

a

μ

for which f(

μ

)=K)

), (

)

(

b

f

K

a

f

=

=

2 /

1

4

4

)

(

2

)

(

n j

j

f

n

f

ζ

μ

)

(

2

90

)

(

4

5

μ f n h f E

×

=

)

(

180

)

(

4

4

μ

f

h

a

b

=

n

a

b

h

)

(

=

or
Algorithm (for Composite Simpson’s Rule) Input: Output:

)]

( ) ( 4 ) ( 2 ) ( [ 3

2

1

1

2

1 2

1

2

0

n

n j^

j

n j

j^

x f x f x f x f h I

  • ∑ + ∑ + =

=

− =

n

b

a

,

,

e

SUM

0

SUM

n

a

b

h

)

(

=

Step 1: set

0

=

e

SUM

Step 2:

initialize

0

0

=

SUM

Piecewise
for Trapezoida (2points,

)]

( ) ( [ 2 ) (

1

0

(^20)

x f

x f

h

dx x f x x^

  • ≈ ∫ 0 x a

=

1

x

1 − j

x

j

x

n x

b

=

[

]

n

a

b

h

jh

a

xj

n

j

b

a

=

= ∈ =

,... 1 ,

0

,

μ

can be even or odd (using 2 points instead of 3 points like
Simpson’s rule which requires
n
to be even or total
data points are odd )

n

2

1 1

μ f h a b b f x f a f h

dx

x

f

b a

n j

j^

− =

[ To be derived by students, including Algorithm]•
Piecewise
for
open
Newton-cotes formula:
Composite Midpoint Rule

=

=

2 1

2

0

2

3

)

)...( 1

(

) 2

(

) ( ) ( ) (

n

b a

n i

n

n

i

i^

dt

n

t

t

t

n

f

h

x

f

a

dx

x

f

ζ

,

1

a

x

=

,

1

b

x

n

=

2

)

(

−^ +

=

n

a

b

h

) ( 3 ) ( 2 ) (

3

1

0

f

h

x

hf

dx

x

f

x x^

′ ′

=

1

1

x

x

<

<

ζ

Midpoint rule.

For

open Newton-cote is

n

if

n

is even

The generalized piecewise formula can be proved

(by student)

as

) ( 6 ) ( 2 ) (

2

2 /

0

2

μ f h a b x f h

dx

x

f

b a

n j

j^

′ ′

=

=

,

2

)

(

− +

=

n

a

b

h

where

,

) 1

(

h

j

a

x

j^

=

)

,

(

b a ∈ μ , 1

,......

0 ,

1

=

n

j Remarks: 1: Required

n

must be even, or total number of data point

(node) must be odd in order to use Midpoint (e.g. at least

n

=0,

x

-

=a,

x

1

=b and x

0

=x

0

.)

2: Since only a single point is used among three points at eachsubinterval in the

open integrals

, only points at

2j

are used.

3: Total subintervals are

n+

over which only n/2 points are used.

•Example: Use both Composite Simpson’s rule
and Composite Trapezoidal rule to
approximate
with an absolute
error less than 0.00002.

π 0

sin

xdx

Conclusion: (1) with piecewise approach, computation
increases, but not round–off error.
(2) error doesn’t depend on

h