A spline is a function assembled from polynomial pieces on adjacent intervals or regions, with conditions specifying how smoothly the pieces join. In the classical one-dimensional setting, a cubic spline consists of polynomials of degree at most three whose values and first two derivatives agree at the joining points, called knots. More generally, the degree, knot locations, knot multiplicities, and continuity conditions determine a family of spline functions.
Splines combine the simplicity of low-degree polynomials with the flexibility of piecewise construction. They are fundamental tools in interpolation, approximation theory, statistical curve fitting, and computer-aided geometric design. Their local representations support efficient computation and controlled changes to a fitted curve or designed shape. Extensions include rational splines, multivariate splines, and variational splines defined by minimizing a measure of roughness.
Polynomial pieces, knots, and smoothness
Let
be a partition of an interval. A polynomial spline of degree at most is a function whose restriction to every subinterval is a polynomial of degree at most . Smoothness conditions are imposed at the interior knots . The notation means that the function has continuous derivatives through order ; thus a cubic spline has continuous value, slope, and second derivative, while its third derivative may jump at a knot.
For fixed knots, degree, and homogeneous joining conditions, the splines form a finite-dimensional vector space. Before imposing continuity, polynomial pieces have coefficients. Requiring agreement of derivatives of orders imposes independent conditions at each of the knots. Consequently, for , the dimension is
The frequently used case therefore has dimension . Each new simple interior knot adds one degree of freedom.
The distinction between degree and order is important. In a common convention, a spline of degree has order : cubic splines have degree three and order four. Terminology is not completely uniform across software and texts, so an unexplained reference to “order three” can be ambiguous. In knot-vector formulations, a knot repeated times generally reduces the imposed continuity there to , for . A multiplicity of permits a discontinuity. Particular choices of coefficients can produce greater smoothness than the knot multiplicity requires.
A useful algebraic representation for splines with simple knots and continuity is
Each truncated-power term vanishes to the left of its knot and introduces a possible change in the -th derivative to its right. This makes the dimension and joining conditions transparent. It is usually less suitable for numerical computation than a local basis, because its basis functions extend across much of the interval and can become badly scaled.
A spline is not necessarily an interpolant, nor must it be cubic. Piecewise-linear continuous functions are degree-one splines; piecewise-constant functions can be treated as degree-zero splines with no continuity requirement. Conversely, a single global polynomial is a spline on any partition, although introducing knots adds useful flexibility only when different polynomial pieces are allowed.
Mechanical origins and mathematical development
The word spline originally referred to a thin, flexible strip used by draftspeople to draw smooth curves through prescribed positions. The strip was held in place by weights or other constraints. Its shape distributed bending along its length rather than forming sharp corners at the constraints. This physical construction suggested a mathematical principle: among curves satisfying specified conditions, select one with small bending energy.
In an exact planar elastic-rod model, bending energy involves the square of curvature integrated with respect to arc length. Under a small-slope approximation, curvature is approximated by the second derivative of a graph, and arc length by the horizontal coordinate. The resulting functional is
The minimizer subject to interpolation constraints is a natural cubic spline. The correspondence is therefore variational rather than literal: a freely bending physical strip is not, in general, exactly the graph of a piecewise-cubic polynomial.
Isaac Jacob Schoenberg established a central part of modern spline theory in his 1946 work on approximation by spline functions and related smoothing problems. His research connected piecewise-polynomial approximation with cardinal interpolation and special basis functions. Subsequent work by Schoenberg and other approximation theorists developed the structural properties that made splines a distinct mathematical subject rather than merely a drafting analogy.
The spread of digital computers created demand for representations that were both flexible and numerically reliable. In the 1960s and 1970s, Carl de Boor and other numerical analysts developed practical methods for evaluating and manipulating B-splines. Maurice Cox and de Boor independently developed the recurrence now known as the Cox–de Boor formula, while de Boor’s evaluation algorithm provided an efficient way to compute a spline directly from its coefficients. De Boor’s 1978 book A Practical Guide to Splines became a standard reference in numerical analysis.
A parallel development occurred in industrial shape design. Paul de Casteljau and Pierre Bézier developed polynomial curve methods for automotive applications, and B-spline methods subsequently supplied local control over longer curves and surfaces. Rational extensions made it possible to represent conic sections exactly. In statistics, work on smoothing splines, including that of Grace Wahba, connected spline fitting with penalized estimation and Hilbert-space methods. These developments produced several related uses of the word: a spline may denote a mathematical function, a geometric representation, or a fitted statistical model, depending on context.
Cubic interpolation and boundary conditions
Suppose values are given at distinct ordered sites
A cubic interpolating spline satisfies and has continuous first and second derivatives at the interior sites. These conditions do not determine a unique spline by themselves. There are degrees of freedom in the cubic spline space with these interior knots, but only interpolation equations. Two additional endpoint or global conditions are needed.
For a natural cubic spline, the extra conditions are
For a clamped or complete cubic spline, the endpoint slopes and are prescribed instead. A not-a-knot condition requires the third derivative to agree across the first and last interior knots; this effectively makes the first two pieces one cubic and the last two pieces another. A periodic spline identifies values and appropriate derivatives at the two ends of a period. These choices encode different assumptions and can produce noticeably different behavior near the boundaries.
The standard equations can be written in terms of the nodal second derivatives . With , continuity of the first derivative gives, for ,
Natural boundary conditions set . The remaining equations form a tridiagonal linear system, solvable in time proportional to the number of data sites.
Once the second derivatives are known, the polynomial on is
This expression separates endpoint values from curvature information and makes differentiation and integration straightforward.
Interpolation conditions must be distinguished from shape conditions. An ordinary cubic spline passing through positive or increasing data can become negative or decrease between observations. Piecewise-cubic Hermite methods instead specify or estimate nodal slopes, sometimes with inequalities designed to preserve monotonicity. Such constructions commonly have continuous first derivatives but not continuous second derivatives.
Likewise, local polynomial pieces do not imply that interpolation is entirely local. Changing a single observation generally changes the solution of the linear system and hence the interpolating spline throughout the interval. Locality of the basis and locality of the map from observations to fitted coefficients are different properties.
B-spline bases and local representation
B-splines provide a basis adapted to the knots and degree. Given a nondecreasing knot vector , the degree-zero functions are
Higher-degree functions are defined recursively by
A term with zero denominator is interpreted as zero. The right endpoint of the parameter domain is handled by a suitable endpoint convention.
Each is nonnegative and vanishes outside . On the standard parameter domain, the relevant basis functions sum to one:
This partition of unity means that constants are reproduced exactly. At a point strictly inside a nonzero knot span, at most degree- B-splines are nonzero. A spline therefore has a representation
in which only a small number of coefficients affect its value at any particular point.
The coefficient vector is not usually a vector of interpolated function values. Instead, it specifies weights in a basis of the spline space. This distinction is particularly useful in geometric design: changing one coefficient affects the function only over the support of the corresponding basis function. Because the weights are nonnegative and sum to one, a scalar spline value lies between the smallest and largest active coefficients. The analogous vector-valued statement gives a local convex-hull property for spline curves.
B-splines also behave simply under differentiation. For
the derivative can be expressed in a degree- basis, with coefficients
using the appropriately shortened knot vector. Thus derivatives are controlled by scaled differences of neighboring coefficients. Integrals can similarly be computed exactly from polynomial pieces or through related spline representations.
There are several common knot-vector conventions. Uniform knots have equal spacing; nonuniform knots allow concentrated resolution in selected regions. An open or clamped knot vector repeats each endpoint times, making the resulting curve pass through its first and last control points. The word clamped here describes endpoint knot multiplicity and should not be confused with prescribed-slope boundary conditions for an interpolating cubic spline. Repeated interior knots allow deliberate reductions in smoothness, including corners in a geometric curve.
Evaluation, knot insertion, and numerical computation
A spline can be evaluated by first identifying the knot span containing the argument and then evaluating the relevant polynomial or B-spline combination. Binary search locates a span among many knots in logarithmic time, while ordered evaluation sites permit a sequential traversal. For fixed degree, the arithmetic needed after locating the span is independent of the total number of knots.
De Boor’s algorithm evaluates a degree- B-spline curve by repeated local interpolation among relevant coefficients or control points. It requires on the order of arithmetic operations and avoids forming global polynomial coefficients. Its construction is closely related to the de Casteljau algorithm for Bézier curves. On a valid knot span, its interpolation weights lie between zero and one, which helps explain its favorable numerical stability. Nevertheless, sensitivity to input perturbations and the conditioning of a fitting problem remain separate questions.
Knot insertion adds a knot while leaving the represented function unchanged. It replaces a small group of coefficients by suitable weighted averages and enlarges the ambient spline space. Repeated insertion can raise every interior knot to multiplicity , exposing individual Bézier segments. Knot insertion is therefore both a representation conversion and a foundation for refinement. By contrast, removing a knot without changing the function is possible only when the coefficients satisfy additional compatibility conditions; approximate knot removal allows a controlled error.
For fitting, one constructs a design or collocation matrix
Because each row has only a few nonzero entries, the matrix is sparse and, for ordered sites and ordinary one-dimensional arrangements, has a banded structure. Interpolation solves ; least-squares fitting solves an overdetermined problem. For square B-spline collocation matrices, the Schoenberg–Whitney conditions characterize nonsingularity through the relative positions of the data sites and basis supports. Merely having the same number of equations and coefficients does not guarantee a unique interpolant.
In least-squares calculations, forming normal equations can square the condition number of the design matrix. QR decomposition or other stable factorizations are therefore important when columns are poorly scaled or nearly dependent. Local support improves computational structure but does not prevent every ill-conditioned configuration, especially with unsuitable knots or derivative constraints.
Representations are chosen according to the operation. Piecewise-polynomial coefficients are convenient for repeated evaluation, root finding, and exact integration within individual spans. B-spline coefficients are useful for fitting, refinement, and shape manipulation. Conversion between them is routine, but converting an entire spline into a single high-degree polynomial is generally impossible: the changes in derivatives at knots are part of the function itself.
Approximation accuracy and shape preservation
Splines address a central difficulty of global polynomial approximation: raising the degree can increase flexibility while also producing large oscillations. The Runge phenomenon demonstrates that polynomial interpolation at equally spaced points need not converge even for an analytic target function. Splines offer a different refinement strategy. They keep the degree low and decrease the lengths of the intervals, avoiding the need for a single polynomial to accommodate all features of the data.
Let be the largest knot spacing. Under suitable mesh, smoothness, and boundary assumptions, approximation by degree- splines can achieve an error proportional to . For a sufficiently smooth function and an appropriately specified cubic interpolant, a representative bound is
where is the maximum norm and does not depend on . Derivative errors typically lose one power of per derivative. The precise theorem depends on the interpolation scheme, endpoint conditions, and permitted mesh geometry.
Boundary conditions matter to these rates. A natural cubic interpolant forces zero second derivative at both ends. If the target function does not satisfy those conditions, a boundary error can prevent fourth-order convergence in the maximum norm over the entire interval. For example, a quadratic with nonzero constant second derivative cannot itself be the natural cubic interpolant. Clamped conditions using the correct endpoint slopes, or suitable not-a-knot conditions, avoid that particular mismatch.
Another distinction is between interpolation and quasi-interpolation. A quasi-interpolant selects coefficients from local function values, derivatives, or averages without solving the full interpolation system. Properly designed quasi-interpolants reproduce low-degree polynomials and attain high approximation orders while retaining stronger locality. Such operators are useful in approximation theory, numerical differential equations, and large-scale data processing.
Shape constraints can be incorporated through coefficient inequalities. Since a spline derivative is represented by scaled coefficient differences, nondecreasing B-spline coefficients are a sufficient condition for a nondecreasing spline on ordinary knot configurations. Appropriate nonnegative second-difference conditions similarly give sufficient conditions for convexity. These conditions are convenient but are not always necessary: a function can be monotone even when its coefficients do not satisfy the simplest monotonicity rule.
Adaptive approximation places more knots where the target has high curvature, rapid variation, or reduced smoothness. If a function has a genuine corner, inserting a knot with reduced continuity may be more effective than maintaining maximal smoothness and adding many nearby knots. Selecting coefficients with fixed knots is often a linear problem; selecting the knot locations as well creates a nonlinear optimization problem, potentially with multiple local minima and nearly redundant knots.
Regression splines, smoothing, and statistical inference
In statistics, a spline commonly represents an unknown relationship between a predictor and a response. With fixed basis functions,
This is a linear regression model in the coefficients , although the fitted relationship can be nonlinear in . A regression spline usually employs a selected set of knots and estimates the coefficients by least squares or an appropriate likelihood-based method. The number and placement of knots determine much of its flexibility.
A smoothing spline instead arises from a roughness-penalized variational problem. For distinct sites and positive weights, the classical cubic criterion is
The optimization is over an infinite-dimensional class of sufficiently regular functions, not over a preselected small spline basis. Nevertheless, the minimizer is a natural cubic spline with knots at the distinct data sites. This finite-dimensional characterization is a major reason the method is computationally practical.
The smoothing parameter controls a bias–variance tradeoff. As tends to zero, the fitted curve approaches the natural cubic interpolant, assuming distinct observations. As tends to infinity, it approaches the weighted least-squares straight line, because linear functions form the null space of the second-derivative penalty. More generally, penalizing the squared -th derivative leads, under the standard assumptions, to splines of degree , with polynomials of degree at most unpenalized.
In a finite basis, the criterion becomes
The penalty matrix is positive semidefinite. When the combined system is identifiable,
This is a form of regularization, related to ridge regression but with a structured, generally singular penalty. Penalized B-splines can instead use differences of neighboring coefficients as a computationally convenient roughness penalty.
For fixed knots and smoothing parameter, the fitted values are a linear transformation . The trace is commonly used as an effective number of degrees of freedom. Smoothing parameters can be selected through cross-validation, generalized cross-validation, or likelihood-based methods. Uncertainty calculations differ according to whether smoothing parameters are treated as fixed or estimated.
Spline terms also enter generalized additive models, where several smooth predictor effects are added and linked to a response distribution. Centering constraints separate smooth terms from intercepts, while penalties control their complexity. A flexible fitted association does not, by itself, establish a causal relationship.
Parametric curves, Bézier segments, and rational splines
For geometric applications, a spline need not be the graph of a scalar function. A parametric spline curve is written
where the control points lie in two- or three-dimensional Euclidean space. Both coordinates vary with the parameter, so the curve can turn back, form loops, or have vertical tangents without becoming multivalued as a parameterized object. The control polygon guides the shape, but most control points do not lie on the curve.
A Bézier curve is the single-segment case, represented in the Bernstein basis:
It is also a B-spline curve with no interior knots and with both endpoint knots repeated times. Piecewise Bézier curves and B-spline curves therefore describe closely related objects; B-splines encode joining conditions and local support efficiently across many segments.
Geometric continuity must be distinguished from parametric continuity. Two segments have continuity when their first derivative vectors agree under the specified parameterization. They have first-order geometric continuity, usually written , when their tangent directions agree with compatible orientation, even if the derivative magnitudes differ. A change of parameter can preserve the visible curve while altering its derivative with respect to the parameter. This distinction matters in surface design, motion planning, and the interpretation of apparent smoothness.
Polynomial splines cannot represent every useful geometric shape exactly. In particular, a nonconstant polynomially parameterized planar curve cannot trace an exact circular arc. Rational splines overcome this limitation. A non-uniform rational B-spline, or NURBS, has the form
With positive weights, the denominator is positive on the ordinary parameter domain, and the normalized rational basis functions remain nonnegative and sum to one.
A rational quadratic Bézier curve represents a quarter of a unit circle using control points , , and , with weights , , and . More generally, rational quadratic segments represent suitable arcs of conic sections exactly. Rational curves can be understood as projections of polynomial curves expressed in homogeneous coordinates, linking their construction to projective geometry.
NURBS became central to computer-aided design because one representation can accommodate free-form shapes and exact conic geometry. Positive weights preserve useful convex-hull behavior; zero or negative weights require additional care and can allow singularities. Parameter values also need not correspond uniformly to distance along the curve: constant-speed motion requires an additional arc-length calculation or reparameterization.
Multivariate splines and differential-equation methods
The simplest extension to several variables uses a tensor product of one-dimensional bases. A bivariate spline surface can be written
This construction supplies separate degree and smoothness control in each coordinate direction. A parametric surface replaces the scalar coefficients by control points in three-dimensional space. Tensor-product B-spline and NURBS surfaces are widely used for manufactured shapes and for approximating fields on structured domains.
Tensor-product structure is efficient but imposes a rectangular organization. Adding a knot in one coordinate direction introduces a line of refinement across the corresponding parameter domain rather than affecting only a small isolated region. The number of coefficients also grows rapidly with dimension: a full tensor product with basis functions per coordinate has coefficients in variables. This is one manifestation of the curse of dimensionality. Hierarchical splines and other locally refined constructions seek to concentrate resolution without refining the entire grid.
Piecewise polynomials can also be defined on triangulations or more general subdivisions. Here continuity is more intricate than in one dimension, because neighboring polynomial pieces must agree along shared edges or faces, and compatibility conditions meet at vertices. Even determining the dimension of a highly smooth spline space may depend on the geometry of the subdivision, not just on counts of vertices and edges. Box splines, constructed from collections of direction vectors, provide another route to multivariate piecewise-polynomial functions and connect naturally with repeated convolution and lattice-based approximation.
Variational extensions need not be piecewise polynomial. A thin-plate spline in two dimensions is associated with the bending functional
Under the standard interpolation or smoothing formulation, its representation includes radial terms proportional to , together with an affine polynomial and side constraints. Thus the broader spline family includes functions defined by variational principles rather than only by polynomial pieces. The null space of this penalty consists of affine functions.
Splines are also closely related to the finite element method. Continuous piecewise-linear functions on a mesh are both elementary splines and standard finite-element shape functions. Higher smoothness permits direct conforming formulations for problems whose energies involve second derivatives, such as certain plate-bending models. Classical finite elements often prioritize simple local elements and flexible meshing; spline spaces can instead provide smoothness across many elements.
In isogeometric analysis, introduced under that name in 2005 by Thomas Hughes, John Cottrell, and Yuri Bazilevs, spline representations used for geometry also serve as approximation spaces for physical fields. Knot insertion refines the space without changing the represented geometry, while degree elevation and controlled continuity offer additional refinement strategies. Trimmed surfaces, complex topology, local refinement, and integration over geometrically complicated domains remain important technical issues in connecting geometric models to numerical solutions of partial differential equations.