## Math 543 Computer Project 02

For this project you will need to use a mathematics software tool package like Matlab, Maple or Mathematica, or a programming language. The project will involve the use of the four test functions
• exp(x), for x in [-1,1],
• 1/(1+25x^2), for x in [-1,1],
• log(x), for x in [1,e], and
• exp(-x^2/2)/sqrt(2 pi), for x in [0,5].
1. Construct a procedure or function that will determine the coefficients for the cubic B-spline respresentation for the clamped (or complete) interpolating spline S(x) for a set of equally spaced data values. The procedure should have as input parameters:
• m -- the number of data points,
• f -- an array of length m of function values,
• fp_1, fp_m -- the function derivative values at the endpoints for the domain of the function.
The output should be an array of length m+2 of cubic B-spline coefficients.
2. Construct a procedure or function that will evaluate the B-spline representation for a clamped (or complete) interpolating cubic spline S(x) at a particular point xp. The procedure should have as input parameters:
• m -- the number of data points,
• a -- the left endpoint for the interpolation interval,
• b -- the right endpoint for the interpolation interval,
• c -- an array of length m+2 of cubic B-spline coefficients.
• xp -- the spline evaluation point.
The output should be the value of the spline at xp.
3. Construct a procedure or function that will compute the integral of the the B-spline representation for a clamped (or complete) interpolating cubic spline S(x) over the interval of definition [a,b] for the original function f(x) which S(x) interpolates. The procedure should have as input parameters:
• m -- the number of data points,
• a -- the left endpoint for the interpolation interval,
• b -- the right endpoint for the interpolation interval,
• c -- an array of length m+2 of cubic B-spline coefficients.
The output should be the value of the integral of the spline.
4. For each of the four functions determine coefficients for the spline S(x) for m = 5, 9, 17 and 33, and
• determine the maximum absolute error for each m using 129 equally spaced xp values;
• plot the error e(x) = f(x) - S(x) for m = 33;
• determine the integral of the spline for each m.
5. Hand in your computer source code, graphs, and a brief discussion of your results. Make sure that your source code is well-structured and reasonably efficient, with some comments to explain what you have done.