Example 3. Use
cubic spline quadrature to compute a numerical approximation to the
integral
.
Use the tolerances
. Compare
with Mathematica's "numerical value" of the integral.
Solution 3.
3 (a). Plot the function over the interval [0, 2].
![[Graphics:../Images/SplineQuadMod_gr_114.gif]](../Images/SplineQuadMod_gr_114.gif)
![[Graphics:../Images/SplineQuadMod_gr_115.gif]](../Images/SplineQuadMod_gr_115.gif)
3 (b). Construct the cubic spline for 11 nodes and use it for quadrature.
3 (c). Construct the cubic spline for 21 nodes and use it for quadrature.
3 (d). Construct the cubic spline for 41 nodes and use it for quadrature.
3 (e). Construct the cubic spline for 41 nodes and use it for quadrature.
3 (f). Compare the results from parts b-d.
|
m sample points |
|
|
11 |
|
|
21 |
|
|
41 |
|
|
81 |
|
3 (g). Use Mathematica to find the numerical solution to the integral.
3 (h). How close did our last numerical approximation using Romberg integration come to Mathematica's "numerical value" of the integral.
![[Graphics:../Images/SplineQuadMod_gr_141.gif]](../Images/SplineQuadMod_gr_141.gif)
(c) John H. Mathews 2004