




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!





Prof. Ming Gu, 861 Evans, tel: 2- Email: [email protected] http://www.math.berkeley.edu/โผmgu/MA128A2008S/
This is a closed book, closed notes exam. You need to justify every one of your answers. Completely correct answers given without justification will receive little credit. Do as much as you can. Partial solutions will get partial credit. Look over the whole exam to find problems that you can do quickly. You need not simplify your answers unless you are specifically asked to do so.
Problem Maximum Score Your Score
Total 100
Your Name:
Your SID:
Your GSI:
Math128A: Numerical Analysis Sample Midterm II 2
I 4 (x) =
2 h 45
(7f (a) + 32f (a + h) + 12f (a + 2h) + 32f (a + 3h) + 7f (b)).
(a) Show that the degree of precision of this formula is 5. (b) Develop the Composite Booleโs Rule for integration on [a, b].
Math128A: Numerical Analysis Sample Midterm II 4
Find a combination of f (h) and f (h/2) that is a much better estimate of L.
Math128A: Numerical Analysis Sample Midterm II 5
(3) f (x) = sin(x)/x. We approximate by natural spline at x = โ 1 , 0 , 1. f (โ1) = sin(โ1)/(โ1) = sin(1), f (1) = sin(1)/1 = sin(1). To find f (0) we take the limit limxโ 0 sin(x)/x = cos(0)/1 = 1 by LโHopitalโs rule. So our points are f (โ1) = f (1) = sin(1), f (0) = 1. Now we find the natural spline P. We have eight variables: on [โ 1 , 0] we have P (x) = a(x + 1)^3 + b(x + 1)^2 + c(x + 1) + d, while on [0, 1] we have P (x) = qx^3 + rx^2 + sx + t. Since the spline must match the value of f at the given points, we have P (โ1) = d = sin(1), P (0) = a+b+c+d = t = 1, P (1) = q+r+s+t = sin(1). P โฒ(x) is 3a(x + 1)^2 + 2b(x + 1) + c on [โ 1 , 0] and 3qx^2 + 2rx + s on [0, 1]. For the first derivative to be continuous at 0, we must have 3a + 2b + c = s. P โฒโฒ(x) is 6a(x + 1) + 2b on [โ 1 , 0] and 6qx + 2r on [0, 1]. For the second derivative to be continuous at 0, we must have 6a + 2b = 2r. Finally, the natural spline condition is that the second derivative should be zero at the endpoints. This gives 2b = 0, 6q + 2r = 0. Putting all this together we have d = sin(1), t = 1, b = 0 a + c = 1 โ sin(1) q + r + s = sin(1) โ 1, so a + c + q + r + s = 0. 3 a + c = s 6 a = 2r, a = r/ 3 6 q + 2r = 0, so q = โr/3. Then s = r + c, r/3 + c โ r/3 + r + r + c = 0 = 2c + 2r, and c = โr, implying s = 0. We then have r/ 3 โ r = โ 2 r/3 = 1 โ sin(1), for r = โ^32 (1 โ sin(1)). So we can write down P as follows: P (x) = โ^12 (1 โ sin(1))(x + 1)^3 + 32 (1 โ sin(1))(x + 1) + sin(1) on [โ 1 , 0] and P (x) = 12 (1 โ sin(1))x^3 โ 32 (1 โ sin(1))x^2 + 1 on [0, 1]. (4) L = limhโ 0 f (h) and L โ f (h) = c 6 h^6 + c 9 h^9 + ... We consider Lโf (h/2). This is c 6 (h/2)^6 +c 9 (h/2)^9. .. = c 6 h^6 /64+c 9 h^9 /512. To cancel the lowest order term, we compute (L โ f (h)) โ 64(L โ f (h/2)) = c 9 h^9 โ (c 9 /8)h^9. Then โ 63 L โ f (h) + 64f (h/2) = (7/8)c 9 h^9. Solving for L we find L = (64f (h/2) โ f (h) โ (7/8)c 9 h^9 )/63, so L โ (^6463 f (h/2) โ 631 f (h)) = โ 721 c 9 h^9. This is order h^9 instead of h^6 , and so is more accurate than the original estimate. (5) We have f (0) = 0, f (0.1) = 0.01, f (0.2) = 0.04.
A second-order method must give the exact solution on quadratic polyno- mials. Therefore the second-order approximation to the derivative of f using these three points must be equal to the derivative of the quadratic passing through these points. We compute this quadratic with Lagrange polynomials: P (x) = 0L 0 +
This is P = โ 0. 01 x
(^2) โ 0. 2 x
x^2 โ 0. 1 x
(^2) โ 0. 2 x) +
2(x^2 โ 0. 1 x) = x^2. So our second-order approximation to f โฒ(x) at x = 0 is the derivative of x^2 at 0, which is 0.