Download presentation
Presentation is loading. Please wait.
1
Elements of Numerical Integration
Sec:4.3 Elements of Numerical Integration
2
Sec:4.3 Elements of Numerical Integration
How to integrate a definite integral of a function that has no explicit antiderivative or whose antiderivative is not easy to obtain. Example Approximate the integral using the Trapezoidal rule 𝒂 𝒃 𝒇 𝒙 𝒅𝒙 0 2 𝑥 2 𝑑𝑥 𝑓 𝑥 = 𝑥 2 ,ℎ=2, 𝑎=0,𝑏=2 The Trapezoidal Rule 0 2 𝑥 2 𝑑𝑥 ≈ 𝟏 𝟐 𝒉 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 ≈ 1 2 ℎ 𝒇 𝒂 +𝒇 𝒃 ≈ 𝟏 𝟐 𝒉 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 ℎ=b−a ≈ 𝟏 𝟐 (𝟐) 𝟎+𝟒 ≈𝟒
3
Sec:4.3 Elements of Numerical Integration
Derivation for The Trapezoidal Rule using first Lagrange polynomials 𝑥 0 =𝑎 𝑥 1 =𝑏 ℎ=𝑏−𝑎 𝑓 𝑥 = 𝒑 𝟏 𝒙 + 𝑹 𝟏 (𝒙) 𝑓 𝑥 =𝒇 𝒙 𝟎 𝑳 𝟎 (𝒙)+𝒇 𝒙 𝟏 𝑳 𝟏 (𝒙)+ 𝒇 ′′ 𝝃 𝟐! (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) 𝑓 𝑥 =𝒇 𝒙 𝟎 𝒙− 𝒙 𝟏 𝒙 𝟎 − 𝒙 𝟏 +𝒇 𝒙 𝟏 𝒙− 𝒙 𝟎 𝒙 𝟏 − 𝒙 𝟎 + 𝒇 ′′ 𝝃 𝟐! (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 =𝒇 𝒙 𝟎 𝒙 𝟎 𝒙 𝟏 𝑳 𝟎 𝒙 𝒅𝒙 +𝒇 𝒙 𝟏 𝒙 𝟎 𝒙 𝟏 𝑳 𝟏 𝒙 𝒅𝒙+ 𝒙 𝟎 𝒙 𝟏 𝒇 ′′ 𝝃 𝟐! (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) dx 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 1 2 ℎ 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 + 𝒙 𝟎 𝒙 𝟏 𝒇 ′′ 𝝃 𝟐! (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) dx 𝒙 𝟎 𝒙 𝟏 𝑳 𝟎 𝒙 𝒅𝒙= 𝒙 𝟎 𝒙 𝟏 𝒙− 𝒙 𝟏 𝒙 𝟎 − 𝒙 𝟏 𝒅𝒙= 𝟏 −𝒉 𝒙 𝟎 𝒙 𝟏 𝒙− 𝒙 𝟏 𝒅𝒙= − 𝟏 𝒉 𝒙− 𝒙 𝟏 𝟐 𝟐 𝒙 𝟎 𝒙 𝟏 = − 𝟏 𝒉 𝟎− 𝟏 𝟐 𝒉 𝟐 = 𝟏 𝟐 𝒉 𝒙 𝟎 𝒙 𝟏 𝑳 𝟏 𝒙 𝒅𝒙= 𝒙 𝟎 𝒙 𝟏 𝒙− 𝒙 𝟎 𝒙 𝟏 − 𝒙 𝟎 𝒅𝒙= 𝟏 𝒉 𝒙 𝟎 𝒙 𝟏 𝒙− 𝒙 𝟎 𝒅𝒙= 𝟏 𝒉 𝒙− 𝒙 𝟎 𝟐 𝟐 𝒙 𝟎 𝒙 𝟏 = 𝟏 𝒉 𝟏 𝟐 𝒉 𝟐 −𝟎 = 𝟏 𝟐 𝒉
4
Sec:4.3 Elements of Numerical Integration
Error for The Trapezoidal Rule The Trapezoidal Rule Weighted Mean Value Theorem for Integrals Suppose f ∈ C[a, b], the Riemann integral of g exists on [a, b], and g(x) does not change sign on [a, b]. Then there exists a number c in (a, b) with 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 1 2 ℎ 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 + 𝒙 𝟎 𝒙 𝟏 𝒇 ′′ 𝝃 𝟐! (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) dx 𝒙 𝟎 𝒙 𝟏 𝒇 ′′ 𝝃 𝟐! (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) dx = 𝟏 𝟐 𝒙 𝟎 𝒙 𝟏 𝒇 ′′ 𝝃(𝒙) (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) dx 𝑎 𝑏 𝑓 𝑥 𝑔 𝑥 𝑑𝑥=𝑓(𝑐) 𝑎 𝑏 𝑔 𝑥 𝑑𝑥 The Weighted Mean Value Theorem for Integrals = 𝒇 ′′ 𝝃 𝟐 𝒙 𝟎 𝒙 𝟏 (𝒙− 𝒙 𝟎 )(𝒙− 𝒙 𝟏 ) dx = 𝒇 ′′ 𝝃 𝟐 − 𝒉 𝟑 𝟔 ==− 𝒉 𝟑 𝟏𝟐 𝒇 ′′ 𝝃 The Trapezoidal Rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 1 2 ℎ 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝒉 𝟑 𝟏𝟐 𝒇 ′′ 𝝃
5
Sec:4.3 Elements of Numerical Integration
Simpson’s Rule Example 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 ≈ 𝒉 𝟑 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇 𝒙 𝟐 Approximate the integral using the Simpson’s rule ℎ= b−a 2 0 2 𝑥 2 𝑑𝑥 𝑓 𝑥 = 𝑥 2 ,ℎ=1, 𝑥 0 =0, 𝑥 1 =1, 𝑥 2 =2 𝑥 0 =𝑎 𝑥 1 = 𝑥 0 +ℎ 𝑥 2 =𝑏 0 2 𝑥 2 𝑑𝑥 ≈ 𝒉 𝟑 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇 𝒙 𝟐 ≈ 𝟏 𝟑 𝒇 𝟎 +𝟒𝒇 𝟏 +𝒇 𝟐 ≈ 𝟏 𝟑 𝟎+𝟒+𝟒 ≈ 𝟖 𝟑 It is exact
6
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 𝒇′′′ (𝝃).
7
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 + 𝑓 ′ ( 𝑥 1 ) 𝑥− 𝑥 𝑓 ′ ′( 𝑥 1 ) 2 𝑥− 𝑥 𝑓 ′ ′′( 𝑥 1 ) 6 𝑥− 𝑥 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝑥 0 𝑥 2 𝑓 𝑥 𝑑𝑥 = 𝑥 0 𝑥 2 𝑓 𝑥 1 + 𝑓 ′ ( 𝑥 1 ) 𝑥− 𝑥 𝑓 ′ ′( 𝑥 1 ) 2 𝑥− 𝑥 𝑓 ′ ′′( 𝑥 1 ) 6 𝑥− 𝑥 𝑑𝑥 + 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 𝒙 𝟎 𝒙 𝟐 𝒇 ′ ( 𝒙 𝟏 ) 𝒙− 𝒙 𝟏 𝒅𝒙 =𝟎 𝑥 0 𝑥 𝑓 ′ ′′( 𝑥 1 ) 6 𝑥− 𝑥 𝑑𝑥=0 𝑥 0 𝑥 2 𝑓 𝑥 𝑑𝑥 = 𝑥 0 𝑥 2 𝑓 𝑥 𝑓 ′ ′( 𝑥 1 ) 2 𝑥− 𝑥 𝑑𝑥 + 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙
8
Sec:4.3 Elements of Numerical Integration
𝑥 0 𝑥 2 𝑓 𝑥 𝑑𝑥 = 𝑥 0 𝑥 2 𝑓 𝑥 𝑓 ′ ′( 𝑥 1 ) 2 𝑥− 𝑥 𝑑𝑥 + 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 =2ℎ𝑓 𝑥 ℎ 3 3 𝑓′′ 𝑥 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 𝒇 ′′ 𝒙 𝟏 = 𝒇 𝒙 𝟎 −𝟐𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) 𝒉 𝟐 − 𝒉 𝟐 𝟏𝟐 𝒇 𝟒 ( 𝝃 𝟐 ) Using centered difference formaula for =2ℎ𝑓 𝑥 ℎ 𝒇 𝒙 𝟎 −𝟐𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) 𝒉 𝟐 − 𝒉 𝟐 𝟏𝟐 𝒇 𝟒 ( 𝝃 𝟐 ) + 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 =2ℎ𝑓 𝑥 1 + ℎ 3 𝒇 𝒙 𝟎 −𝟐𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − ℎ 3 𝒉 𝟒 𝟏𝟐 𝒇 𝟒 ( 𝝃 𝟐 ) + 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 = ℎ 3 𝟔𝒇 𝒙 𝟏 +𝒇 𝒙 𝟎 −𝟐𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟑𝟔 𝒇 𝟒 ( 𝝃 𝟐 ) + 𝒙 𝟎 𝒙 𝟐 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 𝑥 0 𝑥 2 𝑥− 𝑥 𝑑𝑥 = = 𝑥− 𝑥 𝑥 0 𝑥 2 = 2 ℎ 5 5 The Weighted Mean Value Theorem for Integrals = ℎ 3 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟑𝟔 𝒇 𝟒 ( 𝝃 𝟐 ) + 𝒇 (𝟒) (𝝃) 𝟐𝟒 𝒙 𝟎 𝒙 𝟐 𝒙− 𝒙 𝟏 𝟒 𝒅𝒙 = ℎ 3 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟑𝟔 𝒇 𝟒 𝝃 𝟐 + 𝒉 𝟓 𝟔𝟎 𝒇 𝟒 𝝃 = ℎ 3 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟗𝟎 𝒇 𝟒 𝝃 ∗
9
Sec:4.3 Elements of Numerical Integration
Simpson’s Rule The Trapezoidal Rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟑 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟗𝟎 𝒇 𝟒 𝝃 ∗ 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟐 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝒉 𝟑 𝟏𝟐 𝒇 ′′ 𝝃 f x^2; a=0; b=2; h=(b-a)/2; x=a:h:b; integ = (h/3)*(f(x(1))+4*f(x(2))+f(x(3))) f x^2; a=0; b=2; h=b-a; integ = (h/2)*(f(a)+f(b))
10
Sec:4.3 Elements of Numerical Integration
Notice that in each instance Simpson’s Rule is significantly superior. Simpson’s Rule The Trapezoidal Rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟑 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟗𝟎 𝒇 𝟒 𝝃 ∗ 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟐 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝒉 𝟑 𝟏𝟐 𝒇 ′′ 𝝃
11
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 0 1 1 𝑑𝑥 =1 The Trapezoidal Rule the Trapezoidal has degree of precision one exact 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟐 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝒉 𝟑 𝟏𝟐 𝒇 ′′ 𝝃 0 1 𝑥 𝑑𝑥 = 1 2 Also, it is clear from the error term (i.e 𝑓′′(𝜉) exact 0 1 𝑥 2 𝑑𝑥 = 1 2 not exact
12
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 𝑓′′′′(𝜉)
13
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
14
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
15
𝑹 𝑹 𝑹 Sec:4.3 Elements of Numerical Integration
Closed Newton-Cotes Formulas The (n+1)-point closed Newton-Cotes formula 𝑥 0 𝑥 𝑛 𝑓 𝑥 𝑑𝑥 = 𝑖=0 𝑛 𝒂 𝒊 𝒇 𝒙 𝒊 + 𝑹 𝒂 𝒊 = 𝒙 𝟎 𝒙 𝒏 𝑳 𝒊 (𝒙)𝒅𝒙 = 𝒙 𝟎 𝒙 𝒏 𝒋=𝟎 𝒋≠𝒊 𝒏 (𝒙− 𝒙 𝒋 ) ( 𝒙 𝒊 − 𝒙 𝒋 ) 𝒅𝒙 where Theorem 4.2 There exists 𝜉∈ 𝑎,𝑏 such that 𝒏 is odd 𝒏 is even 𝑹 = ℎ 𝑛+2 𝑓 𝑛+1 (𝜉) 𝑛+1 ! 0 𝑛 𝑡 (𝑡−1)⋯ 𝑡−𝑛 𝑑𝑡 𝑹 = ℎ 𝑛+3 𝑓 𝑛+2 (𝜉) 𝑛+2 ! 0 𝑛 𝑡 2 (𝑡−1)⋯ 𝑡−𝑛 𝑑𝑡 the degree of precision is 𝑛 the degree of precision is 𝑛+1 The Trapezoidal Rule (2pts, n=1) Simpson’s Rule (3pts, n=2) 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟐 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝒉 𝟑 𝟏𝟐 𝒇 ′′ 𝝃 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝒉 𝟑 𝒇 𝒙 𝟎 +𝟒𝒇 𝒙 𝟏 +𝒇( 𝒙 𝟐 ) − 𝒉 𝟓 𝟗𝟎 𝒇 𝟒 𝝃 ∗
16
𝑹 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: 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝟐𝒉 𝟒𝟓 𝟕𝒇 𝒙 𝟎 +𝟑𝟐𝒇 𝒙 𝟏 +𝟏𝟐𝒇 𝒙 𝟐 +𝟑𝟐𝒇 𝒙 𝟑 +𝟕𝒇( 𝒙 𝟒 ) − 𝟖𝒉 𝟕 𝟗𝟒𝟓 𝒇 𝟔 𝝃
17
𝑹 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 𝑓 𝑥 𝑑𝑥 = 𝑖=0 𝑛 𝒂 𝒊 𝒇 𝒙 𝒊 + 𝒂 𝒊 = 𝒙 −𝟏 𝒙 𝒏+𝟏 𝑳 𝒊 (𝒙)𝒅𝒙 = 𝒙 −𝟏 𝒙 𝒏+𝟏 𝒋=𝟎 𝒋≠𝒊 𝒏 (𝒙− 𝒙 𝒋 ) ( 𝒙 𝒊 − 𝒙 𝒋 ) 𝒅𝒙 𝑹 where
18
𝑹 𝑹 𝑹 Sec:4.3 Elements of Numerical Integration
Open Newton-Cotes Formulas 𝑥 −1 𝑥 𝑛+1 𝑓 𝑥 𝑑𝑥 = 𝑖=0 𝑛 𝒂 𝒊 𝒇 𝒙 𝒊 + 𝒂 𝒊 = 𝒙 −𝟏 𝒙 𝒏+𝟏 𝑳 𝒊 (𝒙)𝒅𝒙 = 𝒙 −𝟏 𝒙 𝒏+𝟏 𝒋=𝟎 𝒋≠𝒊 𝒏 (𝒙− 𝒙 𝒋 ) ( 𝒙 𝒊 − 𝒙 𝒋 ) 𝒅𝒙 𝑹 where Theorem 4.2 There exists 𝜉∈ 𝑎,𝑏 such that 𝒏 is odd 𝒏 is even 𝑹 = ℎ 𝑛+2 𝑓 𝑛+1 (𝜉) 𝑛+1 ! −1 𝑛+1 𝑡 (𝑡−1)⋯ 𝑡−𝑛 𝑑𝑡 𝑹 = ℎ 𝑛+3 𝑓 𝑛+2 (𝜉) 𝑛+2 ! −1 𝑛+1 𝑡 2 (𝑡−1)⋯ 𝑡−𝑛 𝑑𝑡 n=1 : n=0 : The midpoint Rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝟑𝒉 𝟐 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝟑𝒉 𝟑 𝟒 𝒇 ′′ 𝝃 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 =𝟐𝒉𝒇 𝒙 𝟎 + 𝒉 𝟑 𝟑 𝒇 ′′ 𝝃
19
𝑹 Sec:4.3 Elements of Numerical Integration Open Newton-Cotes Formulas
n=0 : The midpoint Rule 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 =𝟐𝒉𝒇 𝒙 𝟎 + 𝒉 𝟑 𝟑 𝒇 ′′ 𝝃 𝑥 −1 𝑥 𝑛+1 𝑓 𝑥 𝑑𝑥 = 𝑖=0 𝑛 𝒂 𝒊 𝒇 𝒙 𝒊 + 𝑹 n=1 : 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝟑𝒉 𝟐 𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 − 𝟑𝒉 𝟑 𝟒 𝒇 ′′ 𝝃 n = 2: 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝟒𝒉 𝟑 𝟐𝒇 𝒙 𝟎 −𝒇 𝒙 𝟏 +𝟐𝒇 𝒙 𝟐 − 𝟏𝟒𝒉 𝟓 𝟒𝟓 𝒇 𝟒 𝝃 n = 3: 𝑎 𝑏 𝑓 𝑥 𝑑𝑥 = 𝟓𝒉 𝟐𝟒 𝟏𝟏𝒇 𝒙 𝟎 +𝒇 𝒙 𝟏 +𝒇 𝒙 𝟐 +𝟏𝟏𝒇 𝒙 𝟑 − 𝟗𝟓𝒉 𝟕 𝟏𝟒𝟒 𝒇 𝟔 𝝃
20
Sec:4.3 Elements of Numerical Integration
Example
21
Sec:4.3 Elements of Numerical Integration
Example
22
Sec:4.3 Elements of Numerical Integration
23
Sec:4.3 Elements of Numerical Integration
summary
Similar presentations
© 2025 SlidePlayer.com Inc.
All rights reserved.