Interpolation: Introduction to Splines
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}\]
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\).
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