Math 128a, Homework 5

advertisement
Math 128a, Homework 5
due October 9.
1. Implement Romberg integration. You may use your implementation of Neville’s algorithm.
As a stopping criterion, pick some tolerance ε, e.g. 10−3 , and stop the run when |Tn − Tn−1 | <
εTn−1 , where Tn is you estimate after n iteration. Make sure to also put an upper bound
on the total number of iterations! Alternatively, you may use the comment of page 143, i.e.
calculate only a fixed number of columns (but not rows) of the Neville table. Again, test the
algorithm on five functions of your choosing, and list the actual errors if possible.
2. Exercise 3.15. Hint: first, Rprove that thePγi ’s satisfy the property that for any polynomial
1
f of degree at most (n − 1), −1 f (x)dx = ni=1 γi f (xi ), and are uniquely determined by it.
3. For x ∈ [−1, 1], define p0 = 1, pn (x) = 2−(n−1) cos(n arccos(x)) for n = 1, 2, . . ..
(a) Prove that for n > 0,
1
pn+1 (x) = xpn (x) − pn−1 (x).
4
Conclude that pn is a monic polynomial of degree n in x.
Hint: use the formula for cos(ky) + cos(ly).
(b) Prove that the polynomials {pn } are orthogonal with respect to the density ω(x) =
√ 1
.
1−x2
Hint: use substitution and the formula for cos(ky) cos(ly).
(c) Prove that the roots of pn are xi = cos( 2i−1
π), i = 1, 2, . . . , n.
2n
(d) Prove that the corresponding weights wi are all equal to π/n, or at least verify this
for n = 3.
4. Consider the linear system

   
1 2 −1
x1
−1
2 2 1  x 2  =  1 
3 5 −2
x3
−1
Solve this system by Gaussian elimination with standard partial pivoting. Also calculate the
permutation matrix P and the lower, respectively, upper triangular matrices L, R such that
P A = LR, where A is the matrix above. Finally, also solve the above system using the
Gauss-Jordan algorithm.
1
Download