Natural splines: spline

### 6.27.30 Natural splines: spline

#### Definition

Let σn be a subdivision of a real interval [a,b]:

a=x0, x1, …, xn=b

The function s is a spline function of degree l if s is a function from [a,b] to ℝ such that:

- s has continuous derivatives up to the order l−1,
- on each interval of the subdivision σn, s is a polynomial of degree less or equal than l.

#### Theorem

The set of spline functions of degree l on σn is an ℝ-vector space of dimension n+l.

Proof.
Let s be a spline function of degree l on σn.

On [a,x1], s is a polynomial A of degree less or equal to l, hence on [a,x1], s=A(x)=a0+a1x+… alxl and A is a linear combination of 1,x,… xl.

On [x1,x2], s is a polynomial B of degree less or equal to l, hence on [x1,x2], s=B(x)=b0+b1x+… blxl. Since s has continuous derivatives up to order l−1,

∀ 0 ≤ j ≤ l−1, B(j)(x1)−A(j)(x1)=0

therefore B(x)−A(x)=α1(x−x1)l, i.e. B(x)=A(x)+α1(x−x1)l, for some α1. Define the function:

q1(x) = | ⎧ ⎪ ⎨ ⎪ ⎩ |
0 | on | [a,x1]
(x−x1)l | on | [x1,b]

so:

s|[a,x2]=a0+a1x+… alxl+α1q1(x)

On [x2,x3], s is a polynomial C of degree less or equal than l, hence on [x2,x3], s=C(x)=c0+c1x+… clxl.
Since s has continuous derivatives up to order l−1:

∀ 0 ≤ j ≤ l−1, C(j)(x2)−B(j)(x2)=0

therefore C(x)−B(x)=α2(x−x2)n or C(x)=B(x)+α2(x−x2)n.
Define the function:

q2(x) = | ⎧ ⎪ ⎨ ⎪ ⎩ |
0 | on | [a,x2]
(x−x2)l | on | [x2,b]

Hence: s|[a,x3]=a0+a1x+… alxl+α1q1(x)+α2q2(x)
Continuing, define the functions

∀ 1 ≤ j ≤ n−1, qj(x) = | ⎧ ⎪ ⎨ ⎪ ⎩ |
0 | on | [a,xj]
(x−xj)l | on | [xj,b]

Then

s|[a,b]=a0+a1x+… alxl+α1q1(x)+…+αn−1qn−1(x)

and so s is a linear combination of n+l independent functions 1,x,..xl,q1,..qn−1.

It follows that the set of all possible s is a real vector space of dimension n+l.

#### Types of spline functions

If you want to interpolate a function f on σn by a spline function s of degree l, then s must satisfy s(xk)=yk=f(xk) for all 0≤ k≤ n. This gives n+1 conditions, leaving l−1 degrees of freedom. You can therefore add l−1 conditions, these conditions are on the derivatives of s at a and b.

Hermite interpolation, natural interpolation and periodic interpolation are three kinds of interpolation obtained by specifying three kinds of constraints. The uniqueness of the solution of the interpolation problem can be proved for each kind of constraints.

If l is odd (l=2m−1), there are 2m−2 degrees of freedom. The constraints are defined by:

- Hermite interpolation:

  ∀ 1≤ j≤ m−1, s(j)(a)=f(j)(a), s(j)(b)=f(j)(b)

- Natural interpolation:

  ∀ m ≤ j ≤ 2m−2, s(j)(a)=s(j)(b)=0

- periodic interpolation:

  ∀ 1≤ j≤ 2m−2, s(j)(a)=s(j)(b)

If l is even (l=2m), there are 2m−1 degrees of freedom. The constraints are defined by:

- Hermite interpolation:

  ∀ 1≤ j≤ m−1, s(j)(a)=f(j)(a), s(j)(b)=f(j)(b)

  and

  s(m)(a)=f(m)(a)

- Natural interpolation:

  ∀ m ≤ j ≤ 2m−2, s(j)(a)=s(j)(b)=0

  and

  s(2m−1)(a)=0

- Periodic interpolation:

  ∀ 1≤ j≤ 2m−1, s(j)(a)=s(j)(b)