-
- Consider the points (0,1), (1,1), and (2,1).
Use the method of Lagrange to construct the interpolating
polynomial through these points.
You may leave the interpolating
polynomial in the form of Lagrange, do not expand.
(x-1)(x-2) (x-0)(x-2) (x-0)(x-1)
p(x) = ---------- 1 + ---------- 1 + ---------- 1
(0-1)(0-2) (1-0)(1-2) (2-0)(2-1)
- Explain why the sum of the Lagrange polynomials equals one.
(Hint: consider the interpolation of f=1, as above.)
The interpolating polynomial p for f=1 is the sum S of the
Lagrange polynomials. Since f is a polynomial of degree 0
and the interpolating polynomial is unique: p = f.
As p = s, the sum of the Lagrange polynomials equals one.
+--------+
| /20 |
+--------+
- Set up the linear system for the natural spline for e^x
over [1,2], using 4 intervals of equal length.
Do NOT solve the system.
x0 x1 x2 x3 x4
h = 0.25 [-----+-----+-----+-----]
1 1.25 1.5 1.75 2
h*S(i+1) + 2*(h+h)*S(i) + h*S(i-1)
= 6*(f[x(i),x(i+1)]-f[x(i-1),x(i)]), i = 1,2,3
For a natural spline we have: S(0) = 0 and S(4) = 0.
[ 1 0.25 0 ] [ S1 ] [e[x1,x2] - e[x0,x1]]
[ 0.25 1 0.25 ] [ S2 ] = 6 [e[x2,x3] - e[x1,x2]]
[ 0 0.25 1 ] [ S3 ] [e[x3,x4] - e[x2,x3]]
6 [ (e^1.50 - e^1.25) - (e^1.25 - e^1.00) ]
= --- [ (e^1.75 - e^1.50) - (e^1.50 - e^1.25) ]
.25 [ (e^2.00 - e^1.75) - (e^1.75 - e^1.50) ]
+--------+
| /20 |
+--------+
- Show that the central difference operator delta f(x,h) applied
to a function f with step size h > 0 at x to approximate
f'(x) has an error of order O(h^2).
f(x+h) = f(x) + h*f'(x) + h^2*f"(x)/2! + O(h^3)
-[ f(x-h) = f(x) - h*f'(x) + h^2*f"(x)/2! + O(h^3) ]
-------------------------------------------------------
f(x+h) - f(x-h) = 2*h*f'(x) + O(h^3)
f(x+h) - f(x-h)
delta f(x,h) = ----------------- = f'(x) + O(h^3)
2*h
+--------+
| /15 |
+--------+
- Consider the values in the table below:
+----------------------------------------------------------------------------------------------+
| x | 0.00000 | .125000 | .250000 | .375000 | .500000 | .625000 | .750000 | .875000 | 1.00000 |
|f(x)| 0.00000 | .382683 | .707107 | .923880 | 1.00000 | .923880 | .707107 | .382683 | 0.00000 |
+----------------------------------------------------------------------------------------------+
Perform all your calculations with six significant decimal places.
Write all numbers in scientific notation.
- Apply the composite Trapezoidal rule to compute
T(h), for h = 0.5,0.25,0.125.
T(0.5) = 0.25*(0.00000+0.00000) + 0.5*(1.00000) = 5.00000E-1
T(0.25) = T(0.5)/2 + 0.25*(.707107 + .707107) = 6.03554E-1
T(0.125) = T(0.25)/2
+ 0.125*(.382683 + .923880 + .923880 + .382683)
= 6.28418E-1
- Use the three values for T(h) from above in Romberg integration.
5.00000E-1 4*T[1][0] - T[0][0]
T[0][0] ------------------- = T[1][1]
4 - 1
6.38072E-1 16*T[2][1] - T[1][1]
6.03554E-1 --------------------
T[1][0] 4*T[2][0] - T[1][0] 16 - 1
------------------- = T[2][1] 6.36615E-1
4 - 1
6.28418E-1 6.36706E-1
T[2][0]
- How accurate is your final approximation for
the integral of f(x) over [0,1]?
Justify your answer.
The extrapolation gives an approximation with error O(h^6).
For h = .125, h^6 = 3.8E-6, so we estimate about 6 correct
decimal places.
+--------+
| /30 |
+--------+
-
- Consider the quadrature rule
h
/
| f(x) dx = w0 f(x0) + w1 f(x1), for h > 0.
/
0
Set up the system of equations in the weights w0, w1
and nodes x0, x1 to be satisfied for the
highest possible algebraic degree of accuracy.
Do NOT solve this system.
h
/
f=1 : | 1 dx = h = w0 + w1
/
0
h
/
f=x : | x dx = h^2/2 = w0*x0 + w1*x1
/
0
h
/
f=x^2 : | x^2 dx = h^3/3 = w0*x0^2 + w1*x1^2
/
0
h
/
f=x^3 : | x^3 dx = h^4/4 = w0*x0^3 + w1*x1^3
/
0
- What is the algebraic degree of accuracy attained by this rule?
Justify your answer.
Since 1, x, x^2, and x^3 are integrated exactly by the rule
and since the integral operator is linear,
every cubic polynomial is integrated exactly.
Thus the algebraic degree of accuracy equals 3.
+--------+
| /15 |
+--------+