An archive of Mark's Spring 2018 Numerical Analysis course.

A natural cubic spline

mark

Write down the system of equations defining the natural cubic spline that goes through the points

\{(1,1),(2,3),(4,2)\}.
anonymous_user

In order to interpolate between these 3 points, we will need to solve for two natural cubic functions, f_1(x)=a_1(x)^3+b_1(x)^2+c_1(x)+d_1 and f_1(x)=a_2(x)^3+b_2(x)^2+c_2(x)+d_2. This gives us a total of 8 parameters to solve for, and thus we need 8 equations.

From the values of the functions at the three points, we have the first 4 equations:

f_1(1)=1 \Rightarrow a_1(1)^3+b_1(1)^2+c_1(1)+d_1=1 \Rightarrow a_1+b_1+c_1+d_1=1 \\ f_1(2)=3 \Rightarrow a_1(2)^3+b_1(2)^2+c_1(2)+d_1=3 \Rightarrow 8a_1+4b_1+2c_1+d_1=3 \\ f_2(2)=3 \Rightarrow a_2(2)^3+b_2(2)^2+c_2(2)+d_2=3 \Rightarrow 8a_2+4b_2+2c_2+d_2=3 \\ f_2(4)=2 \Rightarrow a_2(4)^3+b_2(4)^2+c_2(4)+d_2=2 \Rightarrow 64a_2+16b_2+4c_2+d_2=2.

To ensure smoothness, we require that both the first and second derivatives of the two functions agree at their point of intersection, giving us two more equations:

f’_1(2)=f’(2) \Rightarrow 12a_1+4b_1+c_1=12a_2+4b_2+c_2 \\ f’’_2(2)=f’’_2(2) \Rightarrow 12a_1+2b_1=12a_2+2b_2.

Finally, since we wish to have interpolate using natural cubic splines, we will enforce the second derivatives of each function to be zero at the endpoints of the interval we are interpolating, so we have

f’’_1(1)=0 \Rightarrow 6a_1+2b_1=0 \\ f’’_2(4)=0 \Rightarrow 24a_2+2b_2=0.

Since we now have 8 equations to solve for the 8 unknown parameters, this system is fully defined.