Cubic Spline Interpolation – Constructing the Matrix

interpolation

Interpolate a cubic spline between the three points $(0, 1), (2, 2) \text{ and } (4, 0).$

I'm trying to understand how to interpolate a given set of points using cubic splines with the help of this solved example. I don't quite get how they arrived at the matrix shown in [s11]. I'm aware of the conditions that have to be imposed so that we don't get an underdetermined linear equation system, but I'm not sure how these equations look like (why are there $8$ unknowns in each equation?) Can someone explain in detail how to get these equations?

Best Answer

Okay let's consider the [s11]. $$\begin{pmatrix} 0&0&0&1&0&0&0&0\\ 8&4&2&1&0&0&0&0\\ 0&0&0&0&8&4&2&1\\ 0&0&0&0&64&16&4&1\\ 12&4&1&0&-12&-4&-1&0\\ 12&2&0&0&-12&-2&0&0\\ 0&2&0&0&0&0&0&0\\ 0&0&0&0&24&2&0&0 \end{pmatrix} \begin{pmatrix} \delta_1 \\ \gamma_1 \\ \beta_1 \\ \alpha_1 \\ \delta_2 \\ \gamma_2 \\ \beta_2 \\ \alpha_2 \end{pmatrix} =\begin{pmatrix} 1\\ 2\\ 2\\ 0\\ 0\\ 0\\ 0\\ 0 \end{pmatrix} $$ You know that matrices are multiplied "row by column" -- a row from the first matrix by a column from the second one and then sum.
The first row corresponds to $\alpha_1=1$ i.e. [s3], the second row is [s4], then [s5], [s6], the 5th row is certainly [s7] in the form $p_1'(2)-p_2'(2)=0$, then [s8], 7th row is [s9], then [s10] is clearly $24\delta_2+2\gamma_2=0$ is $(\delta_2x^3+\gamma_2x^2+\beta_2x+\alpha_2)''(4)=0$.
Does it make sense now or do I have to present the equations in an explicit form with all $\delta_1,\,\ldots,\,\alpha_2$? Thanks.