# How do the different ancillary conditions for splines differ?

I'm currently learning how spline interpolation works. I guess you could directly jump to "questions", but I wanted to give some context in case I missunderstood something.

## Splines - short introduction

You have $n+1$ points $(x_i, y_i)$ with $i=0, \dots, n$ and $a = x_0 < x_1 < \dots < x_n = b$. You usually get those points by evaluating a much more complex function $f$.

Now you want a function $s : [a,b] \rightarrow \mathbb{R}$ through those points such that

1. $\forall i \in \{1, \dots, n\}: s|_{[x_{i-1}, x_{i}]}$ is a cubic function
2. $\forall i \in \{0, \dots, n\}: s(x_i) = y_i$
3. $s \in C^2([a,b])$: $$\int_a^b s''(x)^2 dx \text{ is minimal}$$

So we have

• $s$ consist of $n$ cubic function
• every cubic function has four variables: $a \cdot x^3 + b \cdot x^2 + c \cdot x + d$. We need to calculate $a,b,c,d \in \mathbb{R}$.
• $\stackrel{(1.)}{\Rightarrow}$ we have $4n$ variables we need to determine
• (2.) gives 2 equations we can use for every polynomial. So we get $2n$ equations
• (3.) gives $2$ equations for inner intervals and $1$ equation for the ones at the end. That makes $2 \cdot (n-1) = 2n - 2$ equations.
• $\Rightarrow$ we have $4n-2$ equations, but to solve this system of equations with an unique answer, we need $4n$ equations.

So we search for more conditions that give two more equations (and hopefully improve the result).

## Possible ancillary conditions

• natural splines: $s''(x_0) =0, \;\;\; s''(x_n) = 0$
• clamped splines: $s'(x_0) = f'(x_0),\;\;\; s'(x_n)= f'(x_n)$ where $y_0'$ and $y_n'$ can be any value
• periodic: $s'(x_0) = s'(x_n), \;\;\; s''(x_0) = s''(x_n)$
• not-a-knot: $s_1''' = s_2''', \;\;\; s_{n-1}''' = s_{n}'''$

## My questions

• What are the advantages of the different ancillary conditions?
• When should which condition be used (Do you have examples that show that one condition is better than another?)