Numerical Analysis I, Fall 2017 (http://www.math.nthu.edu.tw/˜ wangwc/)

Midterm 02 makeup exam

Dec 08, 2017.

1. (16 pts) Let P_{n} be the degree n interpolating polynomial of sin x on the uniformly spaced nodes x_{0}, ⋯, x_{n} on [0, 1] with x_{j} = jh, h = 1/n. Is it true that

max_{0≤x≤1} | sin x − P_{n}(x)| ≤ Ch^{n}

for some constant C independent of n? Explain.

2. (16 pts) Given four data (0.3, exp(−0.3)), (0.4, exp(−0.4)), (0.5, exp(−0.5)) and (0.6, exp(−0.6)), use Inverse Interpolation to find the root of x = exp(−x). You can use any algorithm for Lagrange interpolation. Extra credits for Neville’s method using loops.

Hand in your code, put all commands and data within the code so that it can be executed directly without further input.

3. (10 pts) Suppose that we are to construct a piecewise polynomial interpolation S(x) on the data (x_{0}, f(x_{0})), (x_{1}, f(x_{1})), ⋯, (x_{n}, f(x_{n})), with additional continuity conditions for S′, S′′, S^{(3)}, S^{(4)} and S^{(5)} on the interior nodes x_{1}, ⋯, x_{n−1}. If we use polynomials of the same degree on each of the interval [x_{0}, x_{1}], ⋯, [x_{n−1}, x_{n}], what is the minimal degree needed in each interval? How many additional end conditions are needed? Explain.

4. (10 pts) Use minimal number of data points among f(x), f(x + h), f(x + 2h), f(x + 3h), ⋯ to approximate f′′(x) with f′′(x) − f′′_{h}(x) = O(h^{2}). Give details.

5. (16 pts) Find the constants a, b, c so that, the quadrature

∫_{−h}^{h} f(x)dx ≈ h · (af(−h) + bf(0) + cf(h)) has highest degree of precision, where f is

sufficiently smooth. Under the assumption (need not prove this assumption) that the error of this quadrature is of the form

∫_{−h}^{h} f(x)dx − h · (af(−h) + bf(0) + cf(h)) = Kf^{(n)}(ξ)h^{p},

find K, n and p.

6. (16 pts + extra 8 pts max.) Use no more than 65 data points (such as f(x_{0}), ⋯, f(x_{64})) of your choice to evaluate ∫_{0}^{1} f(x)dx numerically, where f(x) = e^{−x}. Two points for each correct digit.

Describe your method, write down your numerical answer and hand in your code.

7. (16 pts) Let w(x) = cos x. Find a quadrature rule for ∫_{−1}^{1} w(x)f(x)dx that is exact for f(x) = 1, x, x^{2}, x^{3} with minimal number of quadrature points. You can express your answer in terms of a_{0} = ∫_{−1}^{1} cos xdx and a_{2} = ∫_{−1}^{1} x^{2} cos xdx without explicitly evaluating a_{0} and a_{2} (which could be done). You can instead do w(x) = 1 for partial credits. Hint for both w(x)’s: Explore possible even/odd symmetry of c_{i} and x_{i}.

8. (5 pts) Solve both roots for x^{2} − 1900 + 1 = 0 to 14 correct digits. Explain how you find your answer (direct evaluation using ’calculator’ will receive no credits).

9. (7 pts) Give a cubically convergent method to solve for e^{x} − 1 = 0. Give the formula and prove that it is cubically convergent (locally). If you cannot do it, do the same for a locally quadratically convergent method for partial credit.

10. (8 pts) Use any method to solve the nonlinear system of equations

\begin{aligned}1x_{1} + 2x_{2} + 0.03 ∗ sin(x_{1} + x_{2}) & = 4 \\ 5x_{1} + 6x_{2} − 0.01 ∗ cos(x_{1} − x_{2}) & = 8 \end{aligned}

Write your answer in the format of ’format long e’ and hand in your code.