Question 1 (Polynomial interpolation)-
1. Recall the formula for the Newton form of the interpolation polynomial p1(x) of degree one of a function u(x) and interpolation points x0, x1.
2. Determine the interpolant exactly in the Newton form for u(x) = ex and in particular for the interpolation points x0 = 0 and x1 = 1. (Hint: write this in terms of the number e and the general interpolation points x0, x1.)
3. For the same example determine also the Lagrange form and the monomial form (a0 + a1x).
4. What is the error e(x) of p1(x) evaluated at point x?
5. What is (to 4 digits) e3/4, p1(3/4) and the error e(3/4) = p1(3/4) - u(3/4)? Choose x0 = 0 and x1 = 1.
6. What is the first degree Taylor polynomial t1(x) (expanded around x = 0) for the function u(x) = ex?
7. What is the value of this Taylor polynomial t1(x) at x = 3/4 and the error? Compare with the interpolation error.
8. What is the error formula provided in the lectures for the interpolation polynomial p1(x). Compare this to the error formula for the Taylor polynomial t1(x). Choose x0 = 0 and x1 = 1 and u(x) = ex.
9. Provide upper and lower bounds for both these errors for the interval [0,1] and evaluate at x = 3/4. How do the bounds compare to each other and to the actual errors computed previously?
10. Recall the formula for the Newton form of the interpolant p2(x) of u(x) for a second degree polynomial with interpolation points x0, x_1,x_2.(Hint : Usep_1(x)$ from above and provide the formula for the remaining coefficient c2 in terms of p1(x2).)
11. Evaluate the formula as above (exact and to 4 decimal digits) for the data points x0 = 0, x1 = 1 and x2 = 1/2 and u(x) = ex. Note that the xi do not need to be ordered. Compute the value of p2(3/4) what is the error p2(3/4) - e3/4?
12. What is the formula for the error of p2 for a general u(x)? Use this to get upper and lower error bounds for the error for the case of x0,x1,x2,x ∈ [0, 1]. Evaluate exactly and to 4 digits for the case of x0 = 0, x1 = 1, x2 = 1/2, x ∈ [0, 1] and x = 3/4. 1.
Question 2 (Quadrature) -
1. Recall the formula for a (composite) trapezoidal rule Tn(u)for I = a∫bu(x)dx which requires n function evaluations at equidistant quadrature points and where the first and the last quadrature points coincide with the integration bounds a and b, respectively.
2. For a given v(x) with x ∈ [0, 1] do a variable transformation x = g(ξ) = αξ + β such that g(-1) = 0 and g(1) = 1. Use this to transform the integral I = 0∫1v(x)dx to an integral over [-1, 1]. What are α and β? Show that for u(ξ) = αv(αξ + β) one has I =-1∫1 u(ξ) dξ = 0∫1v(x) dx.
3. Consider the function v(x) = x(x - 1/2)(x - 1) for x ∈ [0,1]. Determine the transformed function u(ξ) introduced in the previous question. Show that -1∫1 u(ξ) dξ = 0. (Hint: you can do this without evaluating the function.) Determine the values of the midpoint rule, the simple trapezoidal rule (with two points) and of the Gaussian rule with 2 quadrature points. What do you observe about the accuracy of these rules?
4. Consider the function u(ξ) = (ξ2 - 1)2 for ξ ∈ [-1, 1]. Compute the values of the (composite) trapezoidal rule for equidistant points and 2, 3 and 5 points. Construct the corresponding Romberg tableau Ri,j as in the lectures. Show that exactly one of the 3 computed values is exact. Give the reason why this is the case. (Hint: this follows from the Euler-Maclaurin formula.)
5. How many Gauss points are required if the Gauss quadrature rule should provide the exact value of the integral I = -1∫1u(ξ)dξ for the function u(ξ) = (ξ2 - 1)2? Prove that your answer is a consequence of a major result covered in the lectures about Gaussian quadrature. Provide the values of the weights and points (and show how to compute them) for this rule.
Question 3 (Differences) -
1. Use the method of undetermined coefficients to compute the coefficients of a finite difference approximation for u'(ξ) using the values u(0), u(1) and u(2). Choose the coefficients such that the formula is exact for polynomials with degree less or equal to 2. Can you use these coefficients to get an approximation for a first derivative based on function values v(x), v(x + ft) and v(x +2h)? At which point z and for which functions v(x) is this approximation equal to v'(z)? Determine the coefficients exactly for ξ = 3/4.
2. Evaluate these formulas to determine v'(ξh) using v(0), v(h), v(2h) for v(x) = exp(x) and h = 1, 0.5, 0.25. Determine the error for these three values of h. Based on these values, what would you guess the dependence of the error on h to be - linear, quadratic, cubic or of higher order? For this problem choose ξ = 3/4.
3. Recall the error formula from the lecture and apply them to this problem. Derive upper and lower bounds and compare them with the previously computed errors.