Math 441

Interpolation: Introduction to Splines

Example 1

Given the data points \((0,1), (1,2), (2,-1)\), find a continuous piecewise linear function \(f\) that interpolates these points.

\[f(x) = \begin{cases} a_1 + b_1 x & \text{ for } 0 \le x \lt 1\\ a_2 + b_2 x & \text{ for } 1 \le x \le 2\\ \end{cases}\]

Example 2

Given the data points \((0,1), (1,2), (2,-1)\), find a differentiable piecewise quadratic function \(f\) that interpolates these points.

\[f(x) = \begin{cases} a_1 + b_1 x + c_1 x^2& \text{ for } 0 \le x \lt 1\\ a_2 + b_2 x + c_2 x^2& \text{ for } 1 \le x \le 2\\ \end{cases}\]

One more condition: \(f'(0) = 1\).

What is a Spline?

Given \(n+1\) data points \((x_i,y_i)\) such that \(x_{i-1} < x_{i}\) for \(i = 1, 2, \dots, n\), spline of degree \(n\) is a function \(f:[x_0,x_n] \to \mathbb{R}\) such that

  • \(f(x_i) = y_i\) for \(i = 0, 1, \dots, n\),
  • \(f\) restricted to \([x_{i-1},x_i)\) is a polynomial of degree \(n\), for \(i = 1, 2, \dots, n\),
  • \(f\) satisfy some additional smoothness conditions.
  • 0 degree splines: piecewise constant functions
  • linear splines: piecewise linear function, continuous at \(x_i\).
  • quadratic splines: piecewise quadratic function, continuously differentiable at \(x_i\).
    • One extra condition needed.
  • cubic splines: piecewise cubic function, two times continuously differentiable at \(x_i\).
    • Extra conditions needed.