Sie sind auf Seite 1von 23

Sec:4.

Elements of Numerical
Integration
Sec:4.3 Elements of Numerical Integration

How to integrate a definite integral of a Example


function that has no explicit antiderivative Approximate the integral
or whose antiderivative is not easy to using the Trapezoidal
obtain. rule
𝒃 2

න 𝒇 𝒙 𝒅𝒙 න 𝑥 2 𝑑𝑥
𝒂 0

𝑓 𝑥 = 𝑥 2 , ℎ = 2, 𝑎 = 0, 𝑏 = 2

2
The Trapezoidal Rule 𝟏
න 𝑥 2 𝑑𝑥 ≈ 𝒉 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏
𝑏 𝟐
1 0
න 𝑓 𝑥 𝑑𝑥 ≈ ℎ 𝒇 𝒂 + 𝒇 𝒃
2 𝟏
𝑎 ≈ 𝒉 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏
ℎ =b−a 𝟐

𝟏
≈ (𝟐) 𝟎 + 𝟒
𝟐
≈𝟒
Sec:4.3 Elements of Numerical Integration Derivation for The Trapezoidal Rule

using first Lagrange polynomials 𝑥0 = 𝑎 ℎ = 𝑏−𝑎 𝑥1 = 𝑏

𝑓 𝑥 = 𝒑𝟏 𝒙 + 𝑹𝟏 (𝒙)

𝒇′′ 𝝃
𝑓 𝑥 = 𝒇 𝒙𝟎 𝑳𝟎 (𝒙) + 𝒇 𝒙𝟏 𝑳𝟏 (𝒙) + (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )
𝟐!

𝒙 − 𝒙𝟏 𝒙 − 𝒙𝟎 𝒇′′ 𝝃
𝑓 𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 + (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )
𝒙𝟎 − 𝒙𝟏 𝒙 𝟏 − 𝒙𝟎 𝟐!

𝑏 𝒙𝟏 𝒙𝟏 𝒙𝟏
𝒇′′ 𝝃
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 න 𝑳𝟎 𝒙 𝒅𝒙 + 𝒇 𝒙𝟏 න 𝑳𝟏 𝒙 𝒅𝒙 + න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) dx
𝟐!
𝑎 𝒙𝟎 𝒙𝟎 𝒙𝟎
𝑏 𝒙𝟏
1 𝒇′′ 𝝃
න 𝑓 𝑥 𝑑𝑥 = ℎ 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 + න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) dx
2 𝟐!
𝑎 𝒙𝟎
𝒙𝟏 𝒙𝟏 𝒙𝟏
𝟐 𝒙𝟏
𝒙 − 𝒙𝟏 𝟏 𝟏 𝒙 − 𝒙𝟏 𝟏 𝟏 𝟏
න 𝑳𝟎 𝒙 𝒅𝒙 = න 𝒅𝒙 = න 𝒙 − 𝒙𝟏 𝒅𝒙 = − = − 𝟎 − 𝒉𝟐 = 𝒉
𝒙𝟎 − 𝒙𝟏 −𝒉 𝒉 𝟐 𝒙𝟎
𝒉 𝟐 𝟐
𝒙𝟎 𝒙𝟎 𝒙𝟎

𝒙𝟏 𝒙𝟏 𝒙𝟏
𝟐 𝒙𝟏
𝒙 − 𝒙𝟎 𝟏 𝟏 𝒙 − 𝒙𝟎 𝟏 𝟏 𝟐 𝟏
න 𝑳𝟏 𝒙 𝒅𝒙 = න 𝒅𝒙 = න 𝒙 − 𝒙𝟎 𝒅𝒙 = = 𝒉 −𝟎 = 𝒉
𝒙𝟏 − 𝒙𝟎 𝒉 𝒉 𝟐 𝒙𝟎
𝒉 𝟐 𝟐
𝒙𝟎 𝒙𝟎 𝒙𝟎
Sec:4.3 Elements of Numerical Integration Error for The Trapezoidal Rule

The Trapezoidal Rule


Weighted Mean Value Theorem
𝑏 𝒙𝟏 for Integrals
1 𝒇′′ 𝝃 Suppose f ∈ C[a, b], the
න 𝑓 𝑥 𝑑𝑥 = ℎ 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 + න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) dx Riemann integral of g exists on
2 𝟐!
𝑎 𝒙𝟎 [a, b], and g(x) does not change
sign on [a, b]. Then there exists
a number c in (a, b) with
𝒙𝟏 𝒙𝟏
𝒇′′ 𝝃 𝟏 𝑏 𝑏
න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) dx = න 𝒇′′ 𝝃(𝒙) (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) dx න 𝑓 𝑥 𝑔 𝑥 𝑑𝑥 = 𝑓(𝑐) න 𝑔 𝑥 𝑑𝑥
𝟐! 𝟐 𝑎 𝑎
𝒙𝟎 𝒙𝟎

The Weighted Mean Value Theorem for Integrals


𝒙𝟏
𝒇′′ 𝝃 𝒇′′ 𝝃 𝒉𝟑 𝒉𝟑 ′′
= න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) dx = − == − 𝒇 𝝃
𝟐 𝟐 𝟔 𝟏𝟐
𝒙𝟎

The Trapezoidal Rule

𝑏
1 𝒉𝟑 ′′
න 𝑓 𝑥 𝑑𝑥 = ℎ 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 − 𝒇 𝝃
2 𝟏𝟐
𝑎
Sec:4.3 Elements of Numerical Integration

Simpson’s Rule Example


𝑏
𝒉 Approximate the integral
න 𝑓 𝑥 𝑑𝑥 ≈ 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇 𝒙𝟐 using the Simpson’s rule
𝟑
𝑎
2
b−a
ℎ= න 𝑥 2 𝑑𝑥
2
0

𝑥0 = 𝑎 𝑥1 = 𝑥0 + ℎ 𝑥2 = 𝑏 𝑓 𝑥 = 𝑥 2 , ℎ = 1, 𝑥0 = 0, 𝑥1 = 1, 𝑥2 = 2

2
𝒉
න 𝑥 2 𝑑𝑥 ≈ 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇 𝒙𝟐
0
𝟑
𝟏
≈ 𝒇 𝟎 + 𝟒𝒇 𝟏 + 𝒇 𝟐
𝟑
𝟏
≈ 𝟎+𝟒+𝟒
𝟑

𝟖
≈ It is exact
𝟑
Sec:4.3 Elements of Numerical Integration Simpson’s Rule Derivation

using second Lagrange polynomials 𝑥0 = 𝑎 𝑥1 = 𝑥0 + ℎ 𝑥2 = 𝑏

𝑓 𝑥 = 𝒑𝟏 𝒙 + 𝑹𝟏 (𝒙)

𝒇′′′ 𝝃
𝑓 𝑥 = 𝒇 𝒙𝟎 𝑳𝟎 (𝒙) + 𝒇 𝒙𝟏 𝑳𝟏 (𝒙) + 𝒇 𝒙𝟐 𝑳𝟐 (𝒙) + (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 ) (𝒙 − 𝒙𝟐 )
𝟑!

𝑏 𝒙𝟐 𝒙𝟐 𝒙𝟐 𝒙𝟐
𝒇′′′ 𝝃
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 න 𝑳𝟎 𝒙 𝒅𝒙 + 𝒇 𝒙𝟏 න 𝑳𝟏 𝒙 𝒅𝑥 + 𝒇 𝒙𝟐 න 𝑳𝟐 𝒙 𝒅𝒙 + න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 )dx
𝟑!
𝑎 𝒙𝟎 𝒙𝟎 𝒙𝟎 𝒙𝟎
𝒙𝟐
𝒇′′′ 𝝃
= 𝒂𝟎 𝒇 𝒙𝟎 + 𝒂𝟏 𝒇 𝒙𝟏 + 𝒂𝟐 𝒇 𝒙𝟐 + න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 )dx
𝟑!
𝒙𝟎
𝒙𝟐 𝒙𝟐 𝒙𝟐
𝒉 𝟒𝒉 𝒉
𝒂𝟎 = න 𝑳𝟎 𝒙 𝒅𝒙 = 𝒂𝟏 = න 𝑳𝟏 𝒙 𝒅𝒙 = 𝒂𝟐 = න 𝑳𝟐 𝒙 𝒅𝒙 =
𝟑 𝟑 𝟑
𝒙𝟎 𝒙𝟎 𝒙𝟎

Simpson’s Rule
𝑏 𝒙𝟐
𝒉 𝒇′′′ 𝝃
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇 𝒙𝟐 + න (𝒙 − 𝒙𝟎 )(𝒙 − 𝒙𝟏 )(𝒙 − 𝒙𝟐 )dx
𝟑 𝟑!
𝑎 𝒙𝟎

Deriving Simpson’s rule in this manner, however, provides only an 𝑂(ℎ4 ) error term involving 𝒇′′′ (𝝃).
Sec:4.3 Elements of Numerical Integration

approaching the problem in another way, a higher-order term


𝑥0 = 𝑎 𝑥1 = 𝑥0 + ℎ 𝑥2 = 𝑏

Third Taylor polynomial


𝑓 ′ ′(𝑥1 ) 2
𝑓 ′ ′′(𝑥1 ) 3
𝒇(𝟒) (𝝃) 𝟒
𝑓 𝑥 = 𝑓 𝑥1 + 𝑓 (𝑥1 ) 𝑥 − 𝑥1 + 𝑥 − 𝑥1 + 𝑥 − 𝑥1 + 𝒙 − 𝒙𝟏
2 6 𝟐𝟒

𝑥2 𝑥2

𝑓 ′ ′(𝑥1 ) 2
𝑓 ′ ′′(𝑥1 ) 3
න 𝑓 𝑥 𝑑𝑥 = න 𝑓 𝑥1 + 𝑓 (𝑥1 ) 𝑥 − 𝑥1 + 𝑥 − 𝑥1 + 𝑥 − 𝑥1 𝑑𝑥
𝑥0 𝑥0 2 6
𝒙𝟐
𝒇(𝟒) (𝝃)
+න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
𝒙𝟎 𝟐𝟒

𝒙𝟐 𝑥2
′ 𝑓 ′ ′′(𝑥1 ) 3
න 𝒇 (𝒙𝟏 ) 𝒙 − 𝒙𝟏 𝒅𝒙 = 𝟎 න 𝑥 − 𝑥1 𝑑𝑥 = 0
𝒙𝟎 𝑥0 6

𝑥2 𝑥2 𝒙𝟐
𝑓 ′ ′(𝑥1 ) 2
𝒇(𝟒) (𝝃)
න 𝑓 𝑥 𝑑𝑥 = න 𝑓 𝑥1 + 𝑥 − 𝑥1 𝑑𝑥 + න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
𝑥0 𝑥0 2 𝒙𝟎 𝟐𝟒
Sec:4.3 Elements of Numerical Integration

𝑥2 𝑥2 𝒙𝟐
𝑓 ′ ′(𝑥1 ) 2
𝒇(𝟒) (𝝃)
න 𝑓 𝑥 𝑑𝑥 = න 𝑓 𝑥1 + 𝑥 − 𝑥1 𝑑𝑥 + න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
𝑥0 𝑥0 2 𝒙𝟎 𝟐𝟒
𝒙𝟐 (𝟒)
ℎ3 𝒇 (𝝃)
= 2ℎ𝑓 𝑥1 + 𝑓′′ 𝑥1 + න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
3 𝒙𝟎 𝟐𝟒
′′
𝒇 𝒙𝟎 − 𝟐𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) 𝒉𝟐 𝟒
Using centered difference formaula for 𝒇 𝒙𝟏 = − 𝒇 (𝝃𝟐 )
𝒉𝟐 𝟏𝟐

ℎ3 𝒇 𝒙𝟎 − 𝟐𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) 𝒉𝟐 𝟒 𝒙𝟐
𝒇(𝟒) (𝝃)
= 2ℎ𝑓 𝑥1 + − 𝒇 (𝝃𝟐 ) + න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
3 𝒉𝟐 𝟏𝟐 𝒙𝟎 𝟐𝟒

ℎ ℎ 𝒉𝟒 𝟒 𝒙𝟐
𝒇(𝟒) (𝝃)
= 2ℎ𝑓 𝑥1 + 𝒇 𝒙𝟎 − 𝟐𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 (𝝃𝟐 ) + න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
3 3 𝟏𝟐 𝒙𝟎 𝟐𝟒

ℎ 𝒉𝟓 𝟒
𝒙𝟐
𝒇(𝟒) (𝝃)
= 𝟔𝒇 𝒙𝟏 + 𝒇 𝒙𝟎 − 𝟐𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 (𝝃𝟐 ) + න 𝒙 − 𝒙𝟏 𝟒 𝒅𝒙
3 𝟑𝟔 𝒙𝟎 𝟐𝟒
𝑥2
The Weighted Mean Value Theorem for Integrals න 𝑥 − 𝑥1 4 𝑑𝑥 =
𝑥0
ℎ 𝟓 (𝟒) 5 𝑥2
𝒉 𝒇 (𝝃) 𝒙𝟐 𝑥 − 𝑥1 2ℎ5
= 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 𝟒 (𝝃𝟐 ) + න 𝒙 − 𝒙𝟏 𝒅𝒙 𝟒
= =
3 𝟑𝟔 𝟐𝟒 𝒙𝟎 5 𝑥0
5
𝟓 𝟓
ℎ 𝒉 𝟒
𝒉
= 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 𝝃𝟐 + 𝒇𝟒 𝝃
3 𝟑𝟔 𝟔𝟎
ℎ 𝒉𝟓 𝟒
= 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 𝝃∗
3 𝟗𝟎
Sec:4.3 Elements of Numerical Integration

Simpson’s Rule The Trapezoidal Rule


𝑏 𝑏
𝒉 𝒉
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏
𝟑 𝟐
𝑎 𝑎
𝒉 𝟓
𝟒
𝒉𝟑 ′′
− 𝒇 𝝃∗ − 𝒇 𝝃
𝟗𝟎 𝟏𝟐

f = @(x) x^2;
f = @(x) x^2;
a=0; b=2;
a=0; b=2;
h=(b-a)/2;
h=b-a;
x=a:h:b;
integ = (h/2)*(f(a)+f(b))
integ = (h/3)*(f(x(1))+4*f(x(2))+f(x(3)))
Sec:4.3 Elements of Numerical Integration

Notice that in each instance Simpson’s Rule is significantly superior.

Simpson’s Rule The Trapezoidal Rule


𝑏 𝑏
𝒉 𝒉
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏
𝟑 𝟐
𝑎 𝑎
𝒉𝟓
𝟒
𝒉𝟑 ′′
− 𝒇 𝝃∗ − 𝒇 𝝃
𝟗𝟎 𝟏𝟐
Sec:4.3 Elements of Numerical Integration

Definition

The degree of precision of a quadrature formula is n if and only if


the error is zero for all polynomials

𝑞0 𝑥 = 1, 𝑞1 𝑥 = 𝑥, 𝑞2 𝑥 = 𝑥 2 , ⋯ , 𝑞𝑛 𝑥 = 𝑥 𝑛

but is not zero for the polynomial

𝑞𝑛+1 𝑥 = 𝑥 𝑛+1

1
The Trapezoidal Rule න 1 𝑑𝑥 = 1
the Trapezoidal has
exact degree of precision one
𝑏 0
𝒉
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏
𝟐 1
𝑎 1 Also, it is clear from the
𝒉𝟑 ′′ න 𝑥 𝑑𝑥 = exact
− 𝒇 𝝃 2 error term (i.e 𝑓′′(𝜉)
𝟏𝟐 0

1
1
න 𝑥 2 𝑑𝑥 = not exact
2
0
Sec:4.3 Elements of Numerical Integration

Definition

The degree of precision of a quadrature formula is n if and only if


the error is zero for all polynomials

𝑞0 𝑥 = 1, 𝑞1 𝑥 = 𝑥, 𝑞2 𝑥 = 𝑥 2 , ⋯ , 𝑞𝑛 𝑥 = 𝑥 𝑛

but is not zero for the polynomial

𝑞𝑛+1 𝑥 = 𝑥 𝑛+1

Simpson’s Rule
𝑏
𝒉
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) Simpson’s Rule has degree
𝟑
𝑎
of precision three 𝑓′′′′(𝜉)
𝒉𝟓 𝟒
− 𝒇 𝝃∗
𝟗𝟎
Sec:4.3 Elements of Numerical Integration

Definition

The degree of precision of a quadrature formula is n if and only if


the error is zero for all polynomials

𝑞0 𝑥 = 1, 𝑞1 𝑥 = 𝑥, 𝑞2 𝑥 = 𝑥 2 , ⋯ , 𝑞𝑛 𝑥 = 𝑥 𝑛

but is not zero for the polynomial

𝑞𝑛+1 𝑥 = 𝑥 𝑛+1
Sec:4.3 Elements of Numerical Integration

The Trapezoidal Rule (2pts) Simpson’s Rule (3pts)


𝑏 𝑏
𝒉 𝒉𝟑 ′′ 𝒉 𝒉𝟓 𝟒
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 − 𝒇 𝝃 න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 𝝃∗
𝟐 𝟏𝟐 𝟑 𝟗𝟎
𝑎 𝑎

𝒃−𝒂
𝑓 𝑥 ≈ 𝒇 𝒙𝟎 𝑳𝟎 (𝒙) + ⋯ + 𝒇 𝒙𝒏 𝑳𝒏 (𝒙) 𝒉=
𝒏

𝑓 𝑥 ≈ ෍ 𝒇 𝒙𝒊 𝑳𝒊 (𝒙)
𝑖=0

𝑥𝑛 𝑛 𝒙𝒏
න 𝑓 𝑥 𝑑𝑥 ≈ ෍ 𝒇 𝒙𝒊 න 𝑳𝒊 (𝒙)𝒅𝒙
𝑥0 𝑖=0 𝒙𝟎

𝑥𝑛 𝑛

න 𝑓 𝑥 𝑑𝑥 ≈ ෍ 𝒂𝒊 𝒇 𝒙𝒊
𝑥0 𝑖=0

Closed Newton-Cotes Formulas


The (n+1)-point closed Newton-Cotes formula
Sec:4.3 Elements of Numerical Integration

Closed Newton-Cotes Formulas


The (n+1)-point closed Newton-Cotes formula

𝑥𝑛 𝑛
𝒙𝒏 𝒙𝒏 𝒏 (𝒙 − 𝒙𝒋 )
න 𝑓 𝑥 𝑑𝑥 = ෍ 𝒂𝒊 𝒇 𝒙𝒊 +
𝑥0
𝑹 where 𝒂𝒊 = න 𝑳𝒊 (𝒙)𝒅𝒙 = න ෑ
𝒙𝟎 𝒙𝟎 𝒋=𝟎 (𝒙𝒊 − 𝒙𝒋 )
𝒅𝒙
𝑖=0
𝒋≠𝒊

Theorem 4.2 There exists 𝜉 ∈ 𝑎, 𝑏 such that

𝒏 is odd 𝒏 is even
ℎ𝑛+2 𝑓 𝑛+1 (𝜉) 𝑛 ℎ𝑛+3 𝑓 𝑛+2 (𝜉) 𝑛 2
𝑹 =
𝑛+1 !
න 𝑡 (𝑡 − 1) ⋯ 𝑡 − 𝑛 𝑑𝑡
0
𝑹 =
𝑛+2 !
න 𝑡 (𝑡 − 1) ⋯ 𝑡 − 𝑛 𝑑𝑡
0

the degree of precision is 𝑛 the degree of precision is 𝑛 + 1

The Trapezoidal Rule (2pts, n=1) Simpson’s Rule (3pts, n=2)

𝑏 𝑏
𝒉 𝒉𝟑 ′′ 𝒉 𝒉𝟓 𝟒
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 − 𝒇 𝝃 න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 𝝃∗
𝟐 𝟏𝟐 𝟑 𝟗𝟎
𝑎 𝑎
Sec:4.3 Elements of Numerical Integration

n=1 : The Trapezoidal Rule


The (n+1)-point closed Newton-Cotes formula
𝑏 𝑛
𝒉 𝒉𝟑 ′′ 𝑥𝑛
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 − 𝒇 𝝃
𝑎
𝟐 𝟏𝟐 න 𝑓 𝑥 𝑑𝑥 = ෍ 𝒂𝒊 𝒇 𝒙𝒊 +
𝑥0
𝑹
𝑖=0

n=2 : Simpson’s Rule It is called closed because the


endpoints are included as nodes.
𝑏
𝒉 𝒉𝟓 𝟒
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟒𝒇 𝒙𝟏 + 𝒇(𝒙𝟐 ) − 𝒇 𝝃
𝟑 𝟗𝟎
𝑎

n = 3: Simpson’s Three-Eighths rule

𝑏
𝟑𝒉 𝟑𝒉𝟓 𝟒
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝟑𝒇 𝒙𝟏 + 𝟑𝒇 𝒙𝟐 + 𝒇(𝒙𝟑 ) − 𝒇 𝝃
𝟖 𝟖𝟎
𝑎

n = 4:

𝑏
𝟐𝒉 𝟖𝒉𝟕 𝟔
න 𝑓 𝑥 𝑑𝑥 = 𝟕𝒇 𝒙𝟎 + 𝟑𝟐𝒇 𝒙𝟏 + 𝟏𝟐𝒇 𝒙𝟐 + 𝟑𝟐𝒇 𝒙𝟑 + 𝟕𝒇(𝒙𝟒 ) − 𝒇 𝝃
𝟒𝟓 𝟗𝟒𝟓
𝑎
Sec:4.3 Elements of Numerical Integration

Open Newton-Cotes Formulas 𝒃−𝒂


𝒉=
𝒏+𝟐

The open Newton-Cotes formulas do


not include the endpoints as nodes.

Open Newton-Cotes Formulas

𝑛
𝑥𝑛+1 𝒙𝒏+𝟏 𝒙𝒏+𝟏 𝒏 (𝒙 − 𝒙𝒋 )

𝑥−1
𝑓 𝑥 𝑑𝑥 = ෍ 𝒂𝒊 𝒇 𝒙𝒊 + 𝑹 where 𝒂𝒊 = න
𝒙−𝟏
𝑳𝒊 (𝒙)𝒅𝒙 = න
𝒙−𝟏

𝒋=𝟎
(𝒙𝒊 − 𝒙𝒋 )
𝒅𝒙
𝑖=0
𝒋≠𝒊
Sec:4.3 Elements of Numerical Integration

Open Newton-Cotes Formulas


𝑛
𝑥𝑛+1 𝒙𝒏+𝟏 𝒙𝒏+𝟏 𝒏 (𝒙 − 𝒙𝒋 )

𝑥−1
𝑓 𝑥 𝑑𝑥 = ෍ 𝒂𝒊 𝒇 𝒙𝒊 + 𝑹 where 𝒂𝒊 = න
𝒙−𝟏
𝑳𝒊 (𝒙)𝒅𝒙 = න
𝒙−𝟏

𝒋=𝟎
(𝒙𝒊 − 𝒙𝒋 )
𝒅𝒙
𝑖=0
𝒋≠𝒊

Theorem 4.2 There exists 𝜉 ∈ 𝑎, 𝑏 such that

𝒏 is odd 𝒏 is even
ℎ𝑛+2 𝑓 𝑛+1 (𝜉) 𝑛+1 ℎ𝑛+3 𝑓 𝑛+2 (𝜉) 𝑛+1 2
𝑹 =
𝑛+1 !
න 𝑡 (𝑡 − 1) ⋯ 𝑡 − 𝑛 𝑑𝑡
−1
𝑹 =
𝑛+2 !
න 𝑡 (𝑡 − 1) ⋯ 𝑡 − 𝑛 𝑑𝑡
−1

n=1 : n=0 : The midpoint Rule

𝑏 𝑏
𝟑𝒉 𝟑𝒉𝟑 ′′ 𝒉𝟑 ′′
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 − 𝒇 𝝃 න 𝑓 𝑥 𝑑𝑥 = 𝟐𝒉𝒇 𝒙𝟎 + 𝒇 𝝃
𝟐 𝟒 𝟑
𝑎 𝑎
Sec:4.3 Elements of Numerical Integration

n=0 : The midpoint Rule Open Newton-Cotes Formulas


𝑏 𝑥𝑛+1 𝑛
𝟑
𝒉 ′′
න 𝑓 𝑥 𝑑𝑥 = 𝟐𝒉𝒇 𝒙𝟎 +
𝑎
𝟑
𝒇 𝝃 න
𝑥−1
𝑹
𝑓 𝑥 𝑑𝑥 = ෍ 𝒂𝒊 𝒇 𝒙𝒊 +
𝑖=0

n=1 :

𝑏
𝟑𝒉 𝟑𝒉𝟑 ′′
න 𝑓 𝑥 𝑑𝑥 = 𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 − 𝒇 𝝃
𝟐 𝟒
𝑎

n = 2:

𝑏
𝟒𝒉 𝟏𝟒𝒉𝟓 𝟒
න 𝑓 𝑥 𝑑𝑥 = 𝟐𝒇 𝒙𝟎 − 𝒇 𝒙𝟏 + 𝟐𝒇 𝒙𝟐 − 𝒇 𝝃
𝟑 𝟒𝟓
𝑎

n = 3:

𝑏
𝟓𝒉 𝟗𝟓𝒉𝟕 𝟔
න 𝑓 𝑥 𝑑𝑥 = 𝟏𝟏𝒇 𝒙𝟎 + 𝒇 𝒙𝟏 + 𝒇 𝒙𝟐 + 𝟏𝟏𝒇 𝒙𝟑 − 𝒇 𝝃
𝟐𝟒 𝟏𝟒𝟒
𝑎
Sec:4.3 Elements of Numerical Integration

Example
Sec:4.3 Elements of Numerical Integration

Example
Sec:4.3 Elements of Numerical Integration
Sec:4.3 Elements of Numerical Integration

summary

Das könnte Ihnen auch gefallen