Cubic Spline Interpolation
Presented By: Safa Mirza
Learning Outcomes
Understand the concept of interpolation and how cubic splines
provide smooth curve fitting between data points.
Differentiate between natural and clamped splines based on their
boundary conditions and behavior.
Apply cubic spline methods to construct curves and interpret
graphical results for real-world data.
Spline Interpolation
Spline interpolation is a technique used to approximate data by dividing it into smaller intervals
and fitting low-degree polynomials to each segment. Unlike a single high-degree polynomial, it
ensures a smoother and more stable curve across all data points.
Key Characteristics:
Uses piecewise polynomials instead of one global function
Provides smooth transitions between intervals
Reduces oscillations and numerical errors compared to high-order polynomials
Figure shows piecewise polynomial interpolation
Background
Spline interpolation was developed as a practical way to construct smooth curves by
combining simple polynomial segments rather than relying on a single complex
function. This approach allows better control over how the curve behaves between
individual data points.
The concept of a “spline” originates from a drafting technique, where a thin, flexible
strip was bent around fixed pins to draw smooth curves. This physical method
naturally produced continuous and visually pleasing shapes, which inspired the
mathematical idea of spline functions.
In numerical methods, this idea is applied by using low-degree polynomials across
intervals, ensuring that the overall curve remains smooth while accurately representing
the given data.
Types Of Splines
Spline interpolation can be implemented using polynomials of different degrees,
depending on the level of smoothness required.
Linear Spline:
Uses straight lines between consecutive data points, making it simple but not smooth
at the joints.
Quadratic Spline:
Uses second-degree polynomials for each interval, providing a smoother curve than
linear splines but with limited continuity.
Cubic Spline:
Uses third-degree polynomials, offering high smoothness and continuity in both slope
and curvature, making it the most widely used spline in practice.
Cubic Spline
Cubic spline interpolation fits a third-degree polynomial to each interval between data
points, ensuring a smooth and continuous curve across the entire range. For n+1 data
points, there are n intervals, leading to 4n unknown coefficients.
Each segment is represented as:
To determine these coefficients, 4n conditions are required:
Function passes through interior points → 2n-2 conditions
Curve passes through end points → 2 conditions
First derivatives are continuous → n−1 conditions
Second derivatives are continuous → n−1conditions
Boundary conditions at endpoints → 2 conditions
Continuity Conditions
Cubic splines are constructed so that the curve is smooth across all intervals. This
smoothness is ensured by enforcing continuity of the function and its derivatives at
the interior points (knots).
At each interior knot xi, the following conditions must be satisfied:
Types Of Cubic Splines
There are two main types of cubic spline interpolation:
Natural cubic spline:
Assumes the second derivative at the endpoints is zero, making the curve “free” and less
constrained at the boundaries
Clamped cubic spline:
Specifies the first derivative (slope) at the endpoints, giving more control over how the
curve behaves at the boundaries.
Table draws a comparison between two types of Cubic Spline
Feature
Natural Splines
Clamped Splines
Endpoint Condition
Zero second derivatives (S''(x) = 0)
Specified first derivatives (S'(x) = f')
Physical Intuition
A "relaxed" ruler that naturally
straightens at the ends.
A ruler "clamped" at a specific
angle at the ends.
Boundary Control
Low; the curve dictates its own exit High; you dictate the entry/exit
angle.
slope.
Complexity
Simpler: Requires n-1 equations for Higher: Requires extra equations
n+1 points.
for endpoint slopes.
Best Used When...
No slope information is available at Slope information is known or
endpoints.
specific behavior is desired.
Applications
Smoothing time series,
experimental data analysis.
CAD, car body design, aerodynamic
profiles.
Drawbacks
Potentially undesirable
extrapolation behavior.
Increased computational
complexity.
Example 1
Example 2
Practice Questions
Conclusion
Cubic spline interpolation provides a smooth and accurate way to model data by ensuring
continuity in the function and its derivatives.
Natural and clamped splines differ mainly in their boundary conditions, allowing flexibility
depending on whether endpoint behavior is known.
Overall, spline interpolation is widely used in engineering and data analysis for creating
reliable and smooth curves from discrete data points.