0% found this document useful (0 votes)
20 views

Chapter 4

Numerical Analysis Chapter 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Chapter 4

Numerical Analysis Chapter 4
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 30

Chapter 4

Numerical Differentiation and Integration


Numerical Differentiation

Forward and Backward Differences


Inspired by the definition of derivative:

𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 )
𝑓 ′ (𝑥0 ) = lim ,
ℎ→0 ℎ
choose a small ℎ and approximate

𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 )
𝑓 ′ (𝑥0 ) ≈

The error term for the linear Lagrange polynomial gives:

𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 ) ℎ ″
𝑓 ′ (𝑥0 ) = − 𝑓 (𝜉)
ℎ 2
Also known as the forward-difference formula if ℎ > 0 and the
backward-difference formula if ℎ < 0
General Derivative Approximations

Differentiation of Lagrange Polynomials


Differentiate
𝑛
(𝑥 − 𝑥0 ) ⋯ (𝑥 − 𝑥𝑛 ) (𝑛+1)
𝑓(𝑥) = ∑ 𝑓(𝑥𝑘 )𝐿𝑘 (𝑥) + 𝑓 (𝜉(𝑥))
𝑘=0
(𝑛 + 1)!

to get
𝑛

𝑓 (𝑛+1) (𝜉(𝑥𝑗 ))
𝑓 (𝑥𝑗 ) = ∑ 𝑓(𝑥𝑘 )𝐿′𝑘 (𝑥𝑗 ) + ∏(𝑥 − 𝑥𝑘 )
𝑘=0
(𝑛 + 1)! 𝑘≠𝑗 𝑗

This is the (𝑛 + 1)-point formula for approximating 𝑓 ′ (𝑥𝑗 ).


Commonly Used Formulas

Using equally spaced points with ℎ = 𝑥𝑗+1 − 𝑥𝑗 , we have the


three-point formulas
1 ℎ2
𝑓 ′ (𝑥0 ) = [−3𝑓(𝑥0 ) + 4𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 + 2ℎ)] + 𝑓 (3) (𝜉0 )
2ℎ 3
2
1 ℎ
𝑓 ′ (𝑥0 ) = [−𝑓(𝑥0 − ℎ) + 𝑓(𝑥0 + ℎ)] − 𝑓 (3) (𝜉1 )
2ℎ 6
1 ℎ2
𝑓 ′ (𝑥0 ) = [𝑓(𝑥0 − 2ℎ) − 4𝑓(𝑥0 − ℎ) + 3𝑓(𝑥0 )] + 𝑓 (3) (𝜉2 )
2ℎ 3
2
1 ℎ
𝑓 ″ (𝑥0 ) = 2 [𝑓(𝑥0 − ℎ) − 2𝑓(𝑥0 ) + 𝑓(𝑥0 + ℎ)] − 𝑓 (4) (𝜉)
ℎ 12
and the five-point formula
1
𝑓 ′ (𝑥0 ) = [𝑓(𝑥0 − 2ℎ) − 8𝑓(𝑥0 − ℎ) + 8𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 + 2ℎ)]
12ℎ
ℎ4
+ 𝑓 (5) (𝜉)
30
Optimal ℎ

Consider the three-point central difference formula:

1 ℎ2
𝑓 ′ (𝑥0 ) = [𝑓(𝑥0 + ℎ) − 𝑓(𝑥0 − ℎ)] − 𝑓 (3) (𝜉1 )
2ℎ 6
Suppose that round-off errors 𝜀 are introduced when computing
𝑓. Then the approximation error is

̃ + ℎ) − 𝑓(𝑥
𝑓(𝑥 ̃ − ℎ) 𝜀 ℎ2
0 0
∣𝑓 ′ (𝑥0 ) − ∣ ≤ + 𝑀 = 𝑒(ℎ)
2ℎ ℎ 6

where 𝑓 ̃ is the computed function and |𝑓 (3) (𝑥)| ≤ 𝑀


Sum of truncation error ℎ2 𝑀 /6 and round-off error 𝜀/ℎ
Minimize 𝑒(ℎ) to find the optimal ℎ = √ 3
3𝜀/𝑀
Richardson’s Extrapolation

Suppose 𝑁 (ℎ) approximates an unknown 𝑀 with error

𝑀 − 𝑁 (ℎ) = 𝐾1 ℎ + 𝐾2 ℎ2 + 𝐾3 ℎ3 + ⋯

then an 𝑂(ℎ𝑗 ) approximation is given for 𝑗 = 2, 3, … by

ℎ 𝑁𝑗−1 (ℎ/2) − 𝑁𝑗−1 (ℎ)


𝑁𝑗 (ℎ) = 𝑁𝑗−1 ( ) +
2 2𝑗−1 − 1
The results can be written in a table:

𝑂(ℎ) 𝑂(ℎ2 ) 𝑂(ℎ3 ) 𝑂(ℎ4 )


1:𝑁1 (ℎ) ≡ 𝑁 (ℎ)
2:𝑁1 ( ℎ2 ) ≡ 𝑁 ( ℎ2 ) 3:𝑁2 (ℎ)
4:𝑁1 ( ℎ4 ) ≡ 𝑁 ( ℎ4 ) 5:𝑁2 ( ℎ2 ) 6:𝑁3 (ℎ)
7:𝑁1 ( ℎ8 ) ≡ 𝑁 ( ℎ8 ) 8:𝑁2 ( ℎ4 ) 9:𝑁3 ( ℎ2 ) 10:𝑁4 (ℎ)
Richardson’s Extrapolation

If some error terms are zero, different and more efficient


formulas can be derived
Example: If

𝑀 − 𝑁 (ℎ) = 𝐾2 ℎ2 + 𝐾4 ℎ4 + ⋯

then an 𝑂(ℎ2𝑗 ) approximation is given for 𝑗 = 2, 3, … by

ℎ 𝑁𝑗−1 (ℎ/2) − 𝑁𝑗−1 (ℎ)


𝑁𝑗 (ℎ) = 𝑁𝑗−1 ( ) +
2 4𝑗−1 − 1
Numerical Quadrature

Integration of Lagrange Interpolating Polynomials


Select {𝑥0 , … , 𝑥𝑛 } in [𝑎, 𝑏] and integrate the Lagrange polynomial
𝑃𝑛 (𝑥) = ∑𝑛𝑖=0 𝑓(𝑥𝑖 )𝐿𝑖 (𝑥) and its truncation error term over [𝑎, 𝑏]
to obtain
𝑏 𝑛
∫ 𝑓(𝑥) 𝑑𝑥 = ∑ 𝑎𝑖 𝑓(𝑥𝑖 ) + 𝐸(𝑓)
𝑎 𝑖=0
with
𝑏
𝑎𝑖 = ∫ 𝐿𝑖 (𝑥) 𝑑𝑥
𝑎
and
𝑏 𝑛
1
𝐸(𝑓) = ∫ ∏(𝑥 − 𝑥𝑖 )𝑓 (𝑛+1) (𝜉(𝑥)) 𝑑𝑥
(𝑛 + 1)! 𝑎 𝑖=0
Trapezoidal and Simpson’s Rules
The Trapezoidal Rule
Linear Lagrange polynomial with 𝑥0 = 𝑎, 𝑥1 = 𝑏, ℎ = 𝑏 − 𝑎, gives
𝑏
ℎ ℎ3
∫ 𝑓(𝑥) 𝑑𝑥 = [𝑓(𝑥0 ) + 𝑓(𝑥1 )] − 𝑓 ″ (𝜉)
𝑎
2 12

Simpson’s Rule
Second Lagrange polynomial with 𝑥0 = 𝑎, 𝑥2 = 𝑏, 𝑥1 = 𝑎 + ℎ,
ℎ = (𝑏 − 𝑎)/2 gives
𝑥2
ℎ ℎ5
∫ 𝑑𝑥 = [𝑓(𝑥0 ) + 4𝑓(𝑥1 ) + 𝑓(𝑥2 )] − 𝑓 (4) (𝜉)
𝑥0
3 90

Definition
The degree of accuracy, or precision, of a quadrature formula is the
largest positive integer 𝑛 such that the formula is exact for 𝑥𝑘 , for
each 𝑘 = 0, 1, … , 𝑛.
The Newton-Cotes Formulas
The Closed Newton-Cotes Formulas
Use nodes 𝑥𝑖 = 𝑥0 + 𝑖ℎ, 𝑥0 = 𝑎, 𝑥𝑛 = 𝑏, ℎ = (𝑏 − 𝑎)/𝑛:
𝑏 𝑛
∫ 𝑓(𝑥) 𝑑𝑥 ≈ ∑ 𝑎𝑖 𝑓(𝑥𝑖 )
𝑎 𝑖=0
𝑥𝑛 𝑥𝑛 (𝑥 − 𝑥𝑗 )
𝑎𝑖 = ∫ 𝐿𝑖 (𝑥) 𝑑𝑥 = ∫ ∏ 𝑑𝑥
𝑥0 𝑥0 𝑗≠𝑖
(𝑥𝑖 − 𝑥𝑗 )

𝑛 = 1 gives the Trapezoidal rule, 𝑛 = 2 gives Simpson’s rule.

The Open Newton-Cotes Formulas


Use nodes 𝑥𝑖 = 𝑥0 + 𝑖ℎ, 𝑥0 = 𝑎 + ℎ, 𝑥𝑛 = 𝑏 − ℎ,
ℎ = (𝑏 − 𝑎)/(𝑛 + 2). Setting 𝑛 = 0 gives the Midpoint rule:
𝑥1
ℎ3 ″
∫ 𝑓(𝑥) 𝑑𝑥 = 2ℎ𝑓(𝑥0 ) + 𝑓 (𝜉)
𝑥−1
3
Composite Rules
Theorem
Let 𝑓 ∈ 𝐶 2 [𝑎, 𝑏], ℎ = (𝑏 − 𝑎)/𝑛, 𝑥𝑗 = 𝑎 + 𝑗ℎ, 𝜇 ∈ (𝑎, 𝑏). The
Composite Trapezoidal rule for 𝑛 subintervals is
𝑏 𝑛−1
ℎ 𝑏−𝑎 2 ″
∫ 𝑓(𝑥) 𝑑𝑥 = [𝑓(𝑎) + 2 ∑ 𝑓(𝑥𝑗 ) + 𝑓(𝑏)] − ℎ 𝑓 (𝜇)
𝑎
2 𝑗=1
12

Theorem
Let 𝑓 ∈ 𝐶 4 [𝑎, 𝑏], 𝑛 even, ℎ = (𝑏 − 𝑎)/𝑛, 𝑥𝑗 = 𝑎 + 𝑗ℎ, 𝜇 ∈ (𝑎, 𝑏).
The Composite Simpson’s rule for 𝑛 subintervals is

𝑏 (𝑛/2)−1 𝑛/2

∫ 𝑓(𝑥) 𝑑𝑥 = [𝑓(𝑎) + 2 ∑ 𝑓(𝑥2𝑗 ) + 4 ∑ 𝑓(𝑥2𝑗−1 ) + 𝑓(𝑏)]
𝑎
3 𝑗=1 𝑗=1
𝑏 − 𝑎 4 (4)
− ℎ 𝑓 (𝜇)
180
Romberg Integration

Compute a sequence of 𝑛 integrals using the Composite


Trapezoidal rule, where 𝑚1 = 1, 𝑚2 = 2, 𝑚3 = 4, … and
𝑚𝑛 = 2𝑛−1 .
The step sizes are then ℎ𝑘 = (𝑏 − 𝑎)/𝑚𝑘 = (𝑏 − 𝑎)/2𝑘−1
The Trapezoidal rule becomes
𝑘−1
𝑏 2 −1
ℎ𝑘
∫ 𝑓(𝑥) 𝑑𝑥 = [𝑓(𝑎) + 𝑓(𝑏) + 2 ( ∑ 𝑓(𝑎 + 𝑖ℎ𝑘 ))]
𝑎
2 𝑖=1
(𝑏 − 𝑎) 2 ″
− ℎ𝑘 𝑓 (𝜇𝑘 )
12
Romberg Integration

Let 𝑅𝑘,1 denote the trapezoidal approximation, then

ℎ1 (𝑏 − 𝑎)
𝑅1,1 = [𝑓(𝑎) + 𝑓(𝑏)] = [𝑓(𝑎) + 𝑓(𝑏)]
2 2
1
𝑅2,1 = [𝑅1,1 + ℎ1 𝑓(𝑎 + ℎ2 )]
2
1
𝑅3,1 = {𝑅2,1 + ℎ2 [𝑓(𝑎 + ℎ3 ) + 𝑓(𝑎 + 3ℎ3 )]}
2
2𝑘−2
1
𝑅𝑘,1 = [𝑅𝑘−1,1 + ℎ𝑘−1 ∑ 𝑓(𝑎 + (2𝑖 − 1)ℎ𝑘 )]
2 𝑖=1

Apply Richardson extrapolation to these values:

𝑅𝑘,𝑗−1 − 𝑅𝑘−1,𝑗−1
𝑅𝑘,𝑗 = 𝑅𝑘,𝑗−1 +
4𝑗−1 − 1
Romberg Integration

MATLAB Implementation
function R = romberg(f, a, b, n)
% Compute integral of f(x) from a to b using Romberg integration.

h = b-a;
R = zeros(n,n);
R(1,1) = h/2 * (f(a) + f(b));
for i = 2:n
R(i,1) = 1/2 * (R(i-1,1) + h*sum(f(a + ((1:2^(i-2))-0.5)*h)));
for j = 2:i
R(i,j) = R(i,j-1) + (R(i,j-1)-R(i-1,j-1)) / (4^(j-1)-1);
end
h = h/2;
end
Error Estimation

The error term in Simpson’s rule requires knowledge of 𝑓 (4) :


𝑏
ℎ5 (4)
∫ 𝑓(𝑥) 𝑑𝑥 = 𝑆(𝑎, 𝑏) − 𝑓 (𝜇)
𝑎
90

Instead, apply it again with step size ℎ/2:


𝑏
𝑎+𝑏 𝑎+𝑏 1 ℎ5
∫ 𝑓(𝑥) 𝑑𝑥 = 𝑆 (𝑎, ) + 𝑆( , 𝑏) − ( ) 𝑓 (4) (𝜇)̃
𝑎
2 2 16 90

The assumption 𝑓 (4) (𝜇) ≈ 𝑓 (4) (𝜇)̃ gives the error estimate
𝑏
𝑎+𝑏 𝑎+𝑏
∣∫ 𝑓(𝑥) 𝑑𝑥 − 𝑆 (𝑎, ) − 𝑆( , 𝑏)∣
𝑎
2 2
1 𝑎+𝑏 𝑎+𝑏
≈ ∣𝑆(𝑎, 𝑏) − 𝑆 (𝑎, ) − 𝑆( , 𝑏)∣
15 2 2
Adaptive Quadrature

To compute ∫ 𝑓(𝑥) 𝑑𝑥 within a tolerance 𝜀 > 0, first apply


𝑏
𝑎
Simpson’s rule with ℎ = (𝑏 − 𝑎)/2 and with ℎ/2
If
𝑎+𝑏 𝑎+𝑏
∣𝑆(𝑎, 𝑏) − 𝑆 (𝑎, ) − 𝑆( , 𝑏)∣ < 15𝜀
2 2
then the integral is sufficiently accurate
If not, apply the technique to [𝑎, (𝑎 + 𝑏)/2] and [(𝑎 + 𝑏)/2, 𝑏],
and compute the integral within a tolerance of 𝜀/2
Repeat until each portion is within the required tolerance
Gaussian Quadrature

Basic idea: Calculate both nodes 𝑥1 , … , 𝑥𝑛 and coefficients


𝑐1 , … , 𝑐𝑛 such that
𝑏 𝑛
∫ 𝑓(𝑥) 𝑑𝑥 ≈ ∑ 𝑐𝑖 𝑓(𝑥𝑖 )
𝑎 𝑖=1

Since there are 2𝑛 parameters, we might expect a degree of


precision of 2𝑛 − 1
Example: 𝑛 = 2 gives the rule
1
√ √
− 3 3
∫ 𝑓(𝑥) 𝑑𝑥 ≈ 𝑓 ( ) + 𝑓( )
−1
3 3

with degree of precision 3


Legendre Polynomials

The Legendre polynomials 𝑃𝑛 (𝑥) have the properties


1. For each 𝑛, 𝑃𝑛 (𝑥) is a monic polynomial of degree 𝑛 (leading
coefficient 1)
2. ∫ 𝑃 (𝑥)𝑃𝑛 (𝑥) 𝑑𝑥 = 0 when 𝑃 (𝑥) is a polynomial of degree
1
−1
less than 𝑛
The roots of 𝑃𝑛 (𝑥) are distinct, in the interval (−1, 1), and
symmetric with respect to the origin.
Examples:

𝑃0 (𝑥) = 1, 𝑃1 (𝑥) = 𝑥
1 3
𝑃2 (𝑥) = 𝑥2 − 𝑃3 (𝑥) = 𝑥3 − 𝑥
3 5
6 3
𝑃4 (𝑥) = 𝑥4 − 𝑥2 +
7 35
Gaussian Quadrature

Theorem
Suppose 𝑥1 , … , 𝑥𝑛 are roots of 𝑃𝑛 (𝑥) and
1 𝑛 𝑥 − 𝑥𝑗
𝑐𝑖 = ∫ ∏ 𝑑𝑥
−1 𝑗≠𝑖
𝑥𝑖 − 𝑥𝑗

If 𝑃 (𝑥) is any polynomial of degree less than 2𝑛, then


1 𝑛
∫ 𝑃 (𝑥) 𝑑𝑥 = ∑ 𝑐𝑖 𝑃 (𝑥𝑖 )
−1 𝑖=1
Computing Gaussian Quadrature Coefficients

MATLAB Implementation
function [x, c] = gaussquad(n)
% Compute Gaussian quadrature points and coefficients.

P = zeros(n+1,n+1);
P([1,2],1) = 1;
for k = 1:n-1
P(k+2,1:k+2) = ((2*k+1)*[P(k+1,1:k+1) 0] - ...
k*[0 0 P(k,1:k)]) / (k+1);
end
x = sort(roots(P(n+1,1:n+1)));

A = zeros(n,n);
for i = 1:n
A(i,:) = polyval(P(i,1:i),x)';
end
c = A \ [2; zeros(n-1,1)];
Arbitrary Intervals

Transform integrals ∫ 𝑓(𝑥) 𝑑𝑥 into integrals over [−1, 1] by a


𝑏
𝑎
change of variables:

2𝑥 − 𝑎 − 𝑏 1
𝑡= ⇔ 𝑥 = [(𝑏 − 𝑎)𝑡 + 𝑎 + 𝑏]
𝑏−𝑎 2
Gaussian quadrature then gives
𝑏 1
(𝑏 − 𝑎)𝑡 + (𝑏 + 𝑎) (𝑏 − 𝑎)
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 𝑓 ( ) 𝑑𝑡
𝑎 −1
2 2
Double Integrals

Consider the double integral

∬ 𝑓(𝑥, 𝑦) 𝑑𝐴, 𝑅 = {(𝑥, 𝑦) | 𝑎 ≤ 𝑥 ≤ 𝑏, 𝑐 ≤ 𝑦 ≤ 𝑑}


𝑅

Partition [𝑎, 𝑏] and [𝑐, 𝑑] into even number of subintervals 𝑛, 𝑚


Step sizes ℎ = (𝑏 − 𝑎)/𝑛 and 𝑘 = (𝑑 − 𝑐)/𝑚
Write the integral as an iterated integral
𝑏 𝑑
∬ 𝑓(𝑥, 𝑦) 𝑑𝐴 = ∫ (∫ 𝑓(𝑥, 𝑦) 𝑑𝑦) 𝑑𝑥
𝑅 𝑎 𝑐

and use any quadrature rule in an iterated manner.


Composite Simpson’s Rule Double Integration
The Composite Simpson’s rule gives
𝑏 𝑑
ℎ𝑘 𝑛 𝑚
∫ (∫ 𝑓(𝑥, 𝑦) 𝑑𝑦) 𝑑𝑥 = ∑ ∑ 𝑤 𝑓(𝑥𝑖 , 𝑦𝑗 ) + 𝐸
𝑎 𝑐
9 𝑖=0 𝑗=0 𝑖,𝑗

where 𝑥𝑖 = 𝑎 + 𝑖ℎ, 𝑦𝑗 = 𝑐 + 𝑗𝑘, 𝑤𝑖,𝑗 are the products of the nested


Composite Simpson’s rule coefficients (see below), and the error is

(𝑑 − 𝑐)(𝑏 − 𝑎) 4 𝜕 4 𝑓 4
4𝜕 𝑓
𝐸=− [ℎ ( 𝜂,
̄ 𝜇)
̄ + 𝑘 (𝜂,̂ 𝜇)]
̂
180 𝜕𝑥4 𝜕𝑦4

𝑑 •1 •4 •2 •4 •1

•4 •16 •8 •16 •4

𝑐 •1 •4 •2 •4 •1
𝑎 𝑏
Non-Rectangular Regions

The same technique can be applied to double integrals of the form


𝑏 𝑑(𝑥)
∫ ∫ 𝑓(𝑥, 𝑦) 𝑑𝑦 𝑑𝑥
𝑎 𝑐(𝑥)

The step size for 𝑥 is still ℎ = (𝑏 − 𝑎)/𝑛, but for 𝑦 it varies with 𝑥:

𝑑(𝑥) − 𝑐(𝑥)
𝑘(𝑥) =
𝑚
Gaussian Double Integration

For Guassian integration, first transform the roots 𝑟𝑛,𝑗 from


[−1, 1] to [𝑎, 𝑏] and [𝑐, 𝑑], respectively
The integral is then
𝑏 𝑑
(𝑏 − 𝑎)(𝑑 − 𝑐) 𝑛 𝑛
∫ ∫ 𝑓(𝑥, 𝑦) 𝑑𝑦 𝑑𝑥 ≈ ∑ ∑ 𝑐𝑛,𝑖 𝑐𝑛,𝑗 𝑓(𝑥𝑖 , 𝑦𝑗 )
𝑎 𝑐
4 𝑖=1 𝑗=1

Similar techniques can be used for non-rectangular regions


Improper Integrals with a Singularity

The improper integral below, with a singularity at the left endpoint,


converges if and only if 0 < 𝑝 < 1 and then
𝑏 𝑏
1 (𝑥 − 𝑎)1−𝑝 (𝑏 − 𝑎)1−𝑝
∫ 𝑑𝑥 = ∣ =
𝑎
(𝑥 − 𝑎)𝑝 1−𝑝 1−𝑝
𝑎

More generally, if

𝑔(𝑥)
𝑓(𝑥) = , 0 < 𝑝 < 1, 𝑔 continuous on [𝑎, 𝑏],
(𝑥 − 𝑎)𝑝

construct the fourth Taylor polynomial 𝑃4 (𝑥) for 𝑔 about 𝑎:

𝑔″ (𝑎)
𝑃4 (𝑥) = 𝑔(𝑎) + 𝑔′ (𝑎)(𝑥 − 𝑎) + (𝑥 − 𝑎)2
2!
𝑔‴ (𝑎) 𝑔(4) (𝑎)
+ (𝑥 − 𝑎)3 + (𝑥 − 𝑎)4
3! 4!
Improper Integrals with a Singularity

and write
𝑏 𝑏 𝑏
𝑔(𝑥) − 𝑃4 (𝑥) 𝑃4 (𝑥)
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 𝑝
𝑑𝑥 + ∫ 𝑑𝑥
𝑎 𝑎
(𝑥 − 𝑎) 𝑎
(𝑥 − 𝑎)𝑝

The second integral can be computed exactly:


𝑏 4 𝑏 (𝑘)
𝑃4 (𝑥) 𝑔 (𝑎)
∫ 𝑝
𝑑𝑥 = ∑ ∫ (𝑥 − 𝑎)𝑘−𝑝 𝑑𝑥
𝑎
(𝑥 − 𝑎) 𝑘=0 𝑎
𝑘!
4
𝑔(𝑘) (𝑎)
=∑ (𝑏 − 𝑎)𝑘+1−𝑝
𝑘=0
𝑘!(𝑘 + 1 − 𝑝)
Improper Integrals with a Singularity

For the first integral, use the Composite Simpson’s rule to compute
the integral of 𝐺 on [𝑎, 𝑏], where
𝑔(𝑥)−𝑃4 (𝑥)
(𝑥−𝑎)𝑝 , if 𝑎 < 𝑥 ≤ 𝑏
𝐺(𝑥) = {
0, if 𝑥 = 𝑎

Note that 0 < 𝑝 < 1 and 𝑃4 (𝑎) agrees with 𝑔(𝑘) (𝑎) for each
(𝑘)

𝑘 = 0, 1, 2, 3, 4, so 𝐺 ∈ 𝐶 4 [𝑎, 𝑏] and Simpson’s rule can be applied.


Singularity at the Right Endpoint

For an improper integral with a singularity at the right endpoint


𝑏, make the substitution 𝑧 = −𝑥, 𝑑𝑧 = −𝑑𝑥 to obtain
𝑏 −𝑎
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 𝑓(−𝑧) 𝑑𝑧
𝑎 −𝑏

which has its singularity at the left endpoint


For an improper integral with a singularity at 𝑐, where
𝑎 < 𝑐 < 𝑏, split into two improper integrals
𝑏 𝑐 𝑏
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 𝑓(𝑥) 𝑑𝑥 + ∫ 𝑓(𝑥) 𝑑𝑥
𝑎 𝑎 𝑐
Infinite Limits of Integration

An integral of the form ∫ 𝑥1𝑝 𝑑𝑥, with 𝑝 > 1, can be converted to



𝑎
an integral with left endpoint singularity at 0 by the substitution

𝑡 = 𝑥−1 , 𝑑𝑡 = −𝑥−2 𝑑𝑥, so 𝑑𝑥 = −𝑥2 𝑑𝑡 = −𝑡−2 𝑑𝑡

which gives
∞ 0 1/𝑎
1 𝑡𝑝 1
∫ 𝑝
𝑑𝑥 = ∫ − 2
𝑑𝑡 = ∫ 2−𝑝
𝑑𝑡
𝑎
𝑥 1/𝑎
𝑡 0
𝑡

More generally, this variable change converts ∫



𝑓(𝑥) 𝑑𝑥 into
𝑎

∞ 1/𝑎
1
∫ 𝑓(𝑥) 𝑑𝑥 = ∫ 𝑡−2 𝑓 ( ) 𝑑𝑡
𝑎 0
𝑡

You might also like