


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Exam; Class: Numerical Analysis; Subject: Mathematics; University: University of California - Berkeley; Term: Summer 2009;
Typology: Exams
1 / 4
This page cannot be seen from the preview
Don't miss anything!



BENJAMIN JOHNSON
(1) (8 points) [Calculus] (a) (4 points) State Taylor’s Theorem. solution: If f (n+1)^ exists on [a, b] and x 0 ∈ [a, b], then for every x ∈ [a, b] we can write f (x) as
∑n k=
f (k)(x) k! (x^ −^ x^0 )
k (^) + f^ (n+1)(c(x)) (n+1)! (x^ −^ x^0 )
n+1 (^) for some c(x) between x 0 and x. [There are other ways to correctly phrase this same theorem]. (b) (4 points) Compute the 3rd Taylor polynomial P 3 (x) for the function f (x) = sin x about the point x 0 = 0. solution: P 3 (x) = f^
(0)(0) 0! (x^ −^ 0)
(^0) + f^ ′(0) 1! (x^ −^ 0)
(^1) + f^ ′′(0) 2! (x^ −^ 0)
(^2) + f^ ′′′(0) 3! (x^ −^ 0)
We have f (0)(x) = f (x) = sin x, f ′(x) = cos x, f ′′(x) = − sin x, and f ′′′(x) = − cos x. So f (0)(0) = 0, f ′(0) = 1, f ′′(0) = 0, and f ′′′(0) = −1. So P 3 (x) = 0+x+0+ − 61 x^3 = x− x
3
(2) (8 points) [Equations in one variable] (a) (4 points) Explain why the problem of finding solutions for a general equation in one variable, of the form lhs(x) = rhs(x), is equivalent in difficulty to the problem of finding the roots of a general function f. [Hint: to show equivalence in difficulty you need to demonstrate how you would solve one type of problem given a way to solve the other type of problem, and vice versa.] solution: Given a general equation of the form lhs(x) = rhs(x), we can define f (x) = lhs(x) − rhs(x). Then to find solutions to the general equation, we just need to define this f and then find its roots. Conversely, the equation f (x) = 0 is already in the form of a general equation by considering lhs(x) = f (x) and rhs(x) = 0. So we can find roots if we can solve general equations. (b) (4 points) Explain why the root-finding problem is equivalent in difficulty to the fixed- point-finding problem. solution: Given a function f whose root we want to find, we can define g(x) = x−f (x). Then we can find the roots of f by finding the fixed points of g. Conversely, if we have a function g whose fixed points we want to find, we can define f (x) = x − g(x). Then we can find the fixed points of g by finding the roots of f. (3) (12 points) [Newton’s and Steffensen’s Methods] (a) (6 points) Let f (x) = x^2 − 1. Compute the first three terms generated by applying Newton’s method to f starting with p 0 = 2, (counting p 0 , so you just need to compute through p 2 ). solution: We use the equation pn = pn− 1 − (^) ff ′((ppnn−−^11 )). Since f ′(x) = 2x, we have p 1 = 2 − 2
(^2) − 1 2 · 2 = 2^ −^
3 4 =^
5
Then p 2 = 54 − (5/4)
(^2) − 1 2 ·(5/4) =^
5 4 −^
(25/16)− 1 (10/4) =^
5 4 −^
9 / 16 10 / 4 =^
5 4 −^
9 40 =^
41
Date: July 16, 2008. 1
2 BENJAMIN JOHNSON
(b) (6 points) Let g(x) = (^1) x. List the first five terms of the sequence generated by applying Steffensen’s method to g, starting with p 0 = 2, (counting p 0 , so you just need to compute up through p 4 ). solution: Steffensen’s method uses a combination of fixed point iteration and Aitken’s ∆^2 method. We have p 1 = g(p 0 ) = 12. Then p 2 = g(p 1 ) = (^11) / 2 = 2. Then p 3 = p 0 − (p^1 −p^0 )
2 p 2 − 2 p 1 +p 0 = 2^ −^
(1/ 2 −2)^2 2 − 2 ·(1/2)+2 = 2^ −^
9 / 4 3 = 2^ −^
3 4 =^
5
4
(4) (8 points) [Zeros of Polynomials] (a) (4 points) State the Fundamental Theorem of Algebra. solution: Every polynomial with coefficients in C has at least one root in C. (b) (4 points) Explain how M¨uller’s method works. You may use graphs and pictures, but you must explain the method in words. solution: M¨uller’s method works like the secant method, but with three points and a parabola instead of two points and a line [a picture would help to illustrate this]. As far as the method goes, start with p 0 , p 1 , p 2 ; find the unique degree 2 (or less) polynomial that passes through these points; then find a root of this polynomial that is closest in distance to p 2. Call this root p 3. Repeat the procedure with p 1 , p 2 , p 3 in place of p 0 , p 1 , p 2. Continue in this manner until you reach a maximum number of steps or you achieve the proper tolerance for |pn − pn− 1 |. BONUS: (4 points) Aside from convergence properties, what additional advantage does M¨uller’s method have over all the the other root-approximating methods presented in chapter 2 of the textbook. solution: The method will find complex roots even if you start with purely-real initial values. (5) (8 points) [Lagrange Polynomial] (a) (4 points) Let f be a function defined at some real numbers x 0 ,... , xn. Give a defining equation for the Lagrange Interpolating Polynomial for f over x 0 ,... , xn.
solution: Pn(x) =
∑n k=0 f^ (xk)^
∏n i=0,i 6 =k
x−xi xk −xi
(b) (4 points) Let f (x) = cos x and for i ∈ { 0 , 1 , 2 }, let xi = i· 2 π. Write an expression for the Lagrange interpolating polynomial for f over x 0 , x 1 , x 2. solution: P 2 (x) = cos(0)((0x−−π/π/2)(2)(0x−−ππ)) + cos(π/2) (^) (π/(x 2 −−0)(0)(xπ/− 2 π−)π) + cos π ((πx−−0)(0)(xπ−−π/π/2)2) = (x−π/ π2)( (^2) / 2 x −π)+ 0 − x((xπ− (^2) /π/2)2) = −π( πx 2 −/π/ 2 2)= (^) π− 2 πx/ 2 + 1 = 1 − (^2) πx.
(6) (10 points) [Cubic Spline Interpolation] (a) (4 points) Suppose that a = x 0 < x 1 < · · · < xn = b, that f is define at xj for each j, and that f is differentiable at a and b. Define what it means for S to be a clamped cubic spline interpolant for f over the nodes x 0 ,... xn. solution: It means that
4 BENJAMIN JOHNSON
(b) (4 points) State Simpsons’ rule (with or without the error term). solution:
∫ (^) b a f^ (x)dx^ ≈^
b−a 6
f (a) + 4f
(a+b 2
[You can also express the same rule using different notation]. (c) (4 points) Give an example of another formula different from the ones in parts (a) and (b) that can be used to approximate the definite integral
∫ (^) b a f^ (x)dx. solution: One example is the midpoint rule:
∫ (^) b a f^ (x)dx^ ≈^ (b^ −^ a)f^
(a+b 2
, but there are a number of other possibilities. (9) (10 points) [Romberg Integration] (a) (4 points) Your textbook uses the notation Rk, 1 to denote one particular approximation of
∫ (^) b a f^ (x)dx.^ Please explain how^ Rk,^1 relates to the composite trapezoid rule.^ To receive full credit, you must specify all the required parameters (h, n, the xj ’s, etc... ) necessary to apply the composite trapezoid rule. solution: Rk, 1 uses the composite trapezoid rule with n = 2k−^1 , h = hk = 2 bk−−a 1 , and xj = a + j · hk for each j = 0,... 2 k−^1. [You can get full credit for this question by drawing an appropriate picture with all the labels correct.] (b) (6 points) Use Romberg integration to compute R 2 , 2 for the integral
0 e
x^2 dx. You do not need to compute any decimals. Just leave your answer in a form that includes some e’s in it. solution: We compute R 1 , 1 using the trapezoid rule and we compute R 2 , 1 using the composite trapezoid rule with three equally spaced points. For R 2 , 2 we use Richardson’s extrapolation. R 1 , 1 = 1 − 2 0 [e^1 2
1+2e^0.^25 +e− e 2 − (^12) 3 =^
1+4e^0.^25 +e