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

Midterm 02

20 pts each + extra points in problem 3, 5. Hand in your codes for problem 3, 5.

1. Suppose f is smooth and the data f(x), f(x ± h), f(x ± 2h), ⋯ are prescribed.

(a) Fine a second order approximation of f′(x+\frac{h}{2}) with minimal number of data points and derive an error identity of the form f′(x + \frac{h}{2}) − f′_{h}(x + \frac{h}{2}) = C_{1}f^{(n_{1})}(ξ_{1})h^{2}.

(b) Find a fourth order approximation of f′(x+\frac{h}{2}) with minimal number of data points and derive an error bound of the form |f′(x + \frac{h}{2}) − f′_{h}(x + \frac{h}{2})| ≤ C_{2}|f^{(n_{2})}(ξ_{2})|h^{4}.

2. 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.

3. Integrate ∫_{0}^{1} (sin x − 0.5(cos 1 − 1)x^{2}) dx using composite \underline{Midpoint Rule}. The exact answer is \frac{7}{6}(1 − cos 1).

(a) Estimate theoretically n or h it takes to bound the error within 10^{−6}.

(b) Find the order of convergence numerically. You can use the exact answer (or not).

(c) (Harder, extra point) Why is the numerical order greater than 2?

4. Let w(x) = e^{−x^{2}}. 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 may use the formula

∫_{−1}^{1} e^{−x^{2}}dx = \frac{\sqrt{π}}{2} (erf(1) − erf(−1)) and ∫_{−1}^{1} x^{2}e^{−x^{2}}dx = \frac{\sqrt{π}}{4} (erf(1) − erf(−1)) − e^{−1}

and octave’s built-in function erf() to evaluate them. You can instead do w(x) = 1 for partial credits.

5. Use any method to find the area enclosed by x^{4} + y^{4} = 1 to 10 digits. You need to explain why your answer is correct to 10 digits, either theoretically or numerically. You may use standard methods that do not have their theoretical orders of convergence for this problem. Extra credits will be given for truly fourth (or higher) order methods.