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

Homework Assignment for Week 04

Assigned Oct 07, 2011.

1. Reading instruction:

Section 4.3: Skip the derivation of the error formula for Trapezoidal rule involving ”Lagrange interpolating polynomials”. Study your class note on this part instead. Skip Theorems 4.2 and 4.3 for now. We will briefly introduce them next week. For now, focus on Midpoint, Trapezoidal and Simpson’s Rules.

Section 4.4: Read all.

2. Section 4.3: Problems 2, 14, 15, 16, 17, 18, 20.

3. Here are some details for Simpson’s formula that we skipped in class:

(a) Suppose f ∈ C^{4}[−h, h], determine the unique quadratic function P (x) passing through (−h, f(−h)), (0, f(0)) and (h, f(h)). Consequently, P (x) depends on h, f(−h), f(0) and f(h).

(b) Verify that

∫_{−h}^{h} P (x)dx = 2h(\frac{f(−h)}{6} + \frac{4f(0)}{6} + \frac{f(h)}{6}).  (1)

This gives Simpson’s quadrature formula for ∫_{−h}^{h} f(x)dx. It is also easier to see

why (1) is also exact for cubic polynomials.

(c) Derive corresponding formula for ∫_{a}^{b} f(y)dy by a change of variable y = Cx + D (That is, find C, D so that x = −h, h correspond to y = a, b, respectively and substitute them into (1) ).

4. Implement composite Midpoint or Trapezoidal rule (one is enough) for I = ∫_{0}^{1} sin x dx

and find the rate of convergence numerically. This can be done by evaluating log_{2} \frac{I − I_{2h}}{I − I_{h}}.

Why? Can you obtain the rate of convergence if you pretend that you don’t know the exact integral I?

5. Do the same for the integral I = ∫_{0}^{1} \sqrt{x} dx.