

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


Problem 1: Consider the numerical quadrature rule to approximate
0 f^ (x)^ dx^ given by ∫ (^1)
0
f (x) dx ≈ w 1 f (0) + w 2 f (x 1 ).
Find the maximum possible degree of precision you can attain by appropriate choices of w 1 , w 2 and x 1. With such choices of w 1 and w 2 , approximate
0 x (^3) dx and compare with
the exact value.
Solution: We want the formula ∫ (^1)
0
f (x) dx = w 1 f (0) + w 2 f (x 1 )
to hold for polynomials 1, x, x^2 ,.. .. Plugging these into the formula, we obtain:
f (x) = x^0
0
1 dx = x|^10 = 1 = w 1 · 1 + w 2 · 1 ,
f (x) = x^1
0
x dx =
x^2 2
0
= w 1 · 0 + w 2 · x 1 ,
f (x) = x^2
0
x^2 dx = x^3 3
1 0
= w 1 · 0 + w 2 · x^21.
We have 3 equations in 3 unknowns:
w 1 + w 2 = 1 , w 2 x 1 =
w 2 x^21 =
or
w 2 = 1 − w 1 , x 1 (1 − w 1 ) =
x^21 (1 − w 1 ) =
Multiplying the second equation by x 1 and subtracting the third equation, we obtain x 1 = 23. Then, w 2 = 34 and w 1 = 14. Thus, the quadrature formula is ∫ (^1)
0
f (x) dx =
f (0) +
f
The accuracy of this quadrature formula is n = 2, since this formula holds for polynomials 1 , x, x^2. We can check how well this formula approximates
0 x
(^3) dx: ∫ (^1)
0
x^3 dx =
The exact value of this integral is ∫ (^1)
0
x^3 dx = x^4 4
1 0
Problem 2: Determine constants a, b, c, d that will produce a quadrature formula ∫ (^1)
− 1
f (x) dx ≈ af (−1) + bf (1) + cf ′(−1) + df ′(1)
that has degree of precision 3.
Solution: We want the formula ∫ (^1)
− 1
f (x) dx = af (−1) + bf (1) + cf ′(−1) + df ′(1)
to hold for polynomials 1, x, x^2 ,.. .. Plugging these into the formula, we obtain:
f (x) = x^0
− 1
1 dx = x|^1 − 1 = 2 = a · 1 + b · 1 + c · 0 + d · 0 ,
f (x) = x^1
− 1
x dx = x^2 2
1 − 1
= 0 = a · (−1) + b · 1 + c · 1 + d · 1 ,
f (x) = x^2
− 1
x^2 dx = x^3 3
1 − 1
= a · 1 + b · 1 + c · (−2) + d · 2 ,
f (x) = x^3
− 1
x^3 dx =
x^4 4
− 1 = 0 = a · (−1) + b · 1 + c · 3 + d · 3.
We have 4 equations in 4 unknowns:
a + b = 2 , −a + b + c + d = 0 , a + b − 2 c + 2d =
−a + b + 3c + 3d = 0.
Solving this system, we obtain:
a = 1, b = 1, c =
, d = −
Thus, the quadrature formula with accuracy n = 3 is: ∫ (^1)
− 1
f (x) dx = f (−1) + f (1) +
f ′(−1) −
f ′(1). X