Intro To Splines
Intro To Splines
A spline is a thin rod of some elastic material equipped with a groove and a set of weights (called
ducks or rats) with attached arms designed to fit into the groove. This mechanical device spline
has been used by architects to draw smooth curves passing through prescribed points.
1. S is a polynomial function of degree less than or equal to k, for each of the subintervals
[𝑥 , 𝑥 [, [𝑥 , 𝑥 [, … , [𝑥 , 𝑥 [, … , [𝑥 ,𝑥 ]
2. S and its higher order derivatives, up to the order k-1, are continuous at knots
𝑥 ,𝑥 ,…,𝑥 ,𝑥 ,…,𝑥
Note: The spline of degree k can also be defined over the whole real line Ɍ with knots
𝒙𝟎 , 𝒙𝟏 , … , 𝒙𝒊 , 𝒙𝒊 𝟏 , … , 𝒙𝒏 , similarly.
Consider the following piecewise defined cubic polynomials function over the interval [a, b]
with a single knot at c
𝑎 +𝑎 𝑥+𝑎 𝑥 +𝑎 𝑥 , 𝑥 𝜖 [𝑎, 𝑐[
𝑆(𝑥) =
𝑏 +𝑏 𝑥+𝑏 𝑥 +𝑏 𝑥 , 𝑥 𝜖 [𝑐, 𝑏]
s.t. S and its higher derivatives are continuous at knot c up to the order three.
i.e. 𝑆(𝑐 ) = 𝑆(𝑐), 𝑆 (𝑐 ) = 𝑆 (𝑐), 𝑆 (𝑐 ) = 𝑆 (𝑐) and 𝑆 (𝑐 ) = 𝑆 (𝑐),
then it can be determined that 𝑎 = 𝑏 , 𝑎 = 𝑏 , 𝑎 = 𝑏 and 𝑎 = 𝑏 , which shows that both the
cubic polynomials remain no more different.
Thus, to define piecewise cubic polynomials functions the order of derivative continuity at knot
cannot be imposed to be three.
Note: If a spline is defined using polynomials of different degrees, then the order
of derivative continuity must be one less than the degree of polynomial with larger
degree from the polynomials adjacent to the knot. In such case the degree of spline
will be the degree of polynomial with maximum degree among the polynomials
used in defining the spline. More precisely, if a spline of degree k is defined using
polynomials of degrees less than or equal to k, then at certain knots the order of
derivative continuity may not exceed even k-1.
It may be noted while using Lagrange interpolant, the more number of data points, the higher
degree of Lagrange interpolant will be, which increases the possibility of more number of
unwanted inflection points. It may also be noted that to reduce the error, the shape of the
Lagrange interpolant cannot be modified, like in case of other interpolating functions there is no
choice of shape control.
Thus, in such situation only the piecewise defined polynomial functions (splines) are useful.
𝑎 = 2, 𝑎 = 0, 𝑎 = − , 𝑎 = .
Thus
𝟏 𝟏
𝑺(𝒙) = 𝟐 − 𝒙𝟐 + 𝒙𝟑 , 𝒙 𝝐 [𝟎, 𝟒[
𝟒 𝟏𝟔
𝑏 = 38, 𝑏 = −27, 𝑏 = ,𝑎 = −
Thus,
𝟏𝟑 𝟏
𝑺(𝒙) = 𝟑𝟖 − 𝟐𝟕𝒙 + 𝒙𝟐 − 𝒙𝟑 , 𝒙 𝝐 [𝟒, 𝟔].
𝟐 𝟐
It may be noted that the second order derivative continuity at the knot 𝒙 = 𝟒 ceases
the inflection point at the knot.
Note: It can be calculated that 𝑆 (0) = 0, 𝑆 (6) = −3. Thus, keeping in view 𝑆(𝑥), the
following piecewise function 𝐻(𝑥) can be defined over the interval [0, 6], s.t. 𝐻(𝑥) defines two
different cubic polynomials over the subintervals [0, 4[ and [4, 6], along with
𝐻(0) = 2, 𝐻(4) = 2, 𝐻(6) = 2, 𝐻 (0) = 0, 𝐻 (4) = 1, 𝐻 (6) = −3
1 1
2− 𝑥 + 𝑥 , 𝑥 𝜖 [0, 4[
𝐻(𝑥) = 4 16
13 1
38 − 27𝑥 + 𝑥 − 𝑥 , 𝑥 𝜖 [4, 6]
2 2
i.e. 𝐻(𝑥) = 𝑆(𝑥), 𝑥 𝜖 [0, 6]
Example: Let,
𝑎 +𝑎 𝑥+𝑎 𝑥 +𝑎 𝑥 , 𝑥 𝜖 [0, 4[
𝑆(𝑥) =
𝑏 +𝑏 𝑥+𝑏 𝑥 +𝑏 𝑥 , 𝑥 𝜖 [4, 6]
𝑎 = 2, 𝑎 = 1, 𝑎 = − , 𝑎 = .
Thus
𝟑 𝟏
𝑺(𝒙) = 𝟐 + 𝒙 − 𝒙𝟐 + 𝒙𝟑 , 𝒙 𝝐 [𝟎, 𝟒[
𝟒 𝟖
𝑏 = 14, 𝑏 = −11, 𝑏 = 3, 𝑎 = −
Thus,
𝟏
𝑺(𝒙) = 𝟏𝟒 − 𝟏𝟏𝒙 + 𝟑𝒙𝟐 − 𝒙𝟑 , 𝒙 𝝐 [𝟒, 𝟔].
𝟒
𝟑
It can be calculated that 𝑺 (𝟒 ) = , while 𝑺 (𝟒) = 𝟎. Thus, 𝑺(𝒙) is not a cubic spline, as
𝟐
shown below.