03.03.2014 Views

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

Numerical Methods Course Notes Version 0.1 (UCSD Math 174, Fall ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8.4. GAUSSIAN QUADRATURE 107<br />

Example Problem 8.14. Determine a “quadrature” rule of the form<br />

∫ 1<br />

0<br />

f(x) dx ≈ Af(1) + Bf ′ (1) + Cf ′′ (1)<br />

that is exact for polynomials of highest possible degree. What is the highest degree polynomial for<br />

which this rule is exact?<br />

Solution: Since there are three unknown coefficients to be determined, we look for three equations.<br />

We get these equations by plugging in successive polynomials. That is, we plug in f(x) = 1, x, x 2<br />

and assuming the coefficients give equality:<br />

∫ 1<br />

0<br />

∫ 1<br />

0<br />

∫ 1<br />

0<br />

1 dx = 1 = A 1 + B 0 + C 0 = A<br />

x dx = 1/2 = A 1 + B 1 + C 0 = A + B<br />

x 2 dx = 1/3 = A 1 + B 2 + C 2 = A + 2B + 2C<br />

This is solved by A = 1, B = −1/2, C = 1/6. This rule should be exact for polynomials of degree<br />

no greater than 2, but it might be better. We should check:<br />

∫ 1<br />

0<br />

x 3 dx = 1/4 ≠ 1/2 = 1 − 3/2 + 1 = A 1 + B 3 + C 6,<br />

and thus the rule is not exact for cubic polynomials, or those of higher degree.<br />

⊣<br />

8.4.3 Gaussian Nodes<br />

It would seem this is the best we can do: using n + 1 nodes we can devise a quadrature rule that is<br />

exact for polynomials of degree ≤ n by choosing the weights correctly. It turns out that by choosing<br />

the nodes in the right way, we can do far better. Gauss discovered that the right nodes to choose<br />

are the n + 1 roots of the (nontrivial) polynomial, q(x), of degree n + 1 which has the property<br />

∫ b<br />

a<br />

x k q(x) dx = 0 (0 ≤ k ≤ n) .<br />

(If you view the integral as an inner product, you could say that q(x) is orthogonal to the polynomials<br />

x k in the resultant inner product space, but that’s just fancy talk.)<br />

Suppose that we have such a q(x)–we will not prove existence or uniqueness. Let f(x) be a<br />

polynomial of degree ≤ 2n + 1. We write<br />

f(x) = p(x)q(x) + r(x).<br />

Both p(x), r(x) are of degree ≤ n. Because of how we picked q(x) we have<br />

Thus<br />

∫ b<br />

a<br />

f(x) dx =<br />

∫ b<br />

a<br />

∫ b<br />

a<br />

p(x)q(x) dx = 0.<br />

p(x)q(x) dx +<br />

∫ b<br />

a<br />

r(x)dx =<br />

∫ b<br />

a<br />

r(x)dx.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!