21. Suppose you are given a set ofNdata points (xn, yn), withxnincreasing, and you wish to interpolatethese points with a spline functionf, wheref(x) is given by a cubic polynomialpn(x) on each interval(xn, xn+1), forn= 1, . . . , N-1:pn(x) =an(x-xn)3+bn(x-xn)2+cn(x-xn) +dn.(a) Write down the equations required forf(x) to be continuous and to pass through the data points.How many equations does this provide?
(b) Write down the equations required forf(x) to have continuous first and second derivatives. Howmany equations does this provide?