a.) Data:
s(0)=1
s'(0)=1
s(1)=2
s'(1)=y
s(2)=2
s'(2)=0
The coefficients of the piecewise cubic function on the first interval (0-1) are found by solving:
And on the second interval (1-2):
b.) This becomes a cubic spline if the second derivative is continuous. Since we only have two intervals, this will hold if the second derivative for both equations is equal at 1. That is, if: