Sec 5-3 PDF
Sec 5-3 PDF
Sec 5-3 PDF
ANOTHER APPROACH
w1 = w2 = 1, −1 ,
x1 = sqrt(3) 1
x2 = sqrt(3)
This yields the formula
Z 1 µ ¶ µ ¶
−1
f (x) dx ≈ f sqrt(3) 1
+ f sqrt(3) (1)
−1
We say it has degree of precision equal to 3 since it
integrates exactly all polynomials of degree ≤ 3. We
can verify directly that it does not integrate exactly
f (x) = x4.
Z 1
x4 dx = 25
−1
µ ¶ µ ¶
−1
f sqrt(3) 1
+ f sqrt(3) = 29
EXAMPLE Integrate
Z 1
dx .
= log 2 = 0.69314718
−1 3 + x
The formula (1) yields
1 1
+ = 0.69230769
3 + x1 3 + x2
Error = .000839
THE GENERAL CASE
wi > 0
for all n > 0. This is considered a very desirable
property from a practical point of view. Moreover, it
permits us to develop a useful error formula.
CHANGE OF INTERVAL
OF INTEGRATION
x = (1 + t) π2
Then
Z π Z 1³ ´
π
F (x) dx = 2 π
F (1 + t) 2 dt
0 −1
EXAMPLE Consider again the integrals used as ex-
amples in Section 5.1:
Z 1
2 .
I (1) = e−x dx = .74682413281234
0
Z 4
dx
I (2) = 2
= arctan 4
01+x
Z 2π
dx 2π
I (3) = =
0 2 + cos x sqrt(3)
f (2n)(cn)
En(f ) = en
(2n)!
22n+1 (n!)4 π
en = 2 ≈ n
(2n + 1) [(2n)!] 4
for some a ≤ cn ≤ b.
m ρm(f ) m ρm(f )
1 5.30E − 2 6 7.82E − 6
2 1.79E − 2 7 4.62E − 7
3 6.63E − 4 8 9.64E − 8
4 4.63E − 4 9 8.05E − 9
5 1.62E − 5 10 9.16E − 10
n I − In Ratio
2 −7.22E − 3
4 −1.16E − 3 6.2
8 −1.69E − 4 6.9
16 −2.30E − 5 7.4
32 −3.00E − 6 7.6
64 −3.84E − 7 7.8
Numerically,
x1 = .2654117024, x2 = .8115113746
w1 = .3297238792, w2 = .4202761208
The formula
Z 1
1
x 3 f (x) dx ≈ w1f (x1) + w2f (x2) (4)
0
has degree of precision 3.
EXAMPLE Consider evaluating the integral
Z 1
1
x3 cos x dx (5)
0
In applying (4), we take f (x) = cos x. Then