Maths & numbers

Hermite interpolation calculator using values and derivatives

Build an exact polynomial matching function values and first derivatives, and verify both constraints at each supplied node.

Your numbers

Use exact integers, decimals with up to six places, or fractions. Separate entries with commas or spaces; each component is bounded as stated in the guide. Supply 1 through 8 distinct x nodes.
Use an integer, a decimal with up to six places, or a fraction such as 3/2. Endpoint magnitude and fraction components are limited to 1,000,000.

Calculated on your device. Your inputs aren’t sent to us.

Your result

Ready when you are

Enter your inputs and select Calculate.

Report an issue

Behind the numbers

How this calculation works

Hermite interpolation adds slope information to value constraints. Each row supplies an x coordinate, a function value and a first derivative at that location. For n distinct nodes these 2n constraints determine a unique polynomial of degree at most 2n minus one. This calculator uses exact rational confluent divided differences, returns the expanded polynomial and checks both values and derivatives. It is a different constraint problem from ordinary interpolation through values alone.

THE FORMULAp(xᵢ)=yᵢ and p′(xᵢ)=dᵢ; n nodes determine one polynomial of degree at most 2n−1.

A worked example

At x = 0 specify value 0 and derivative 0. At x = 1 specify value 1 and derivative 3. The resulting polynomial is x³, which satisfies all four conditions. Evaluating it at 1/2 gives 1/8, and its derivative there is 3/4. A straight line joining the same two values would have slope one and would violate both supplied endpoint derivatives.

Good to know

Supports one through eight distinct nodes, each with a value and first derivative. Higher derivatives, incomplete derivative rows and piecewise Hermite splines are excluded. Inputs use bounded exact rationals and intermediate fraction growth is limited. The single global polynomial can oscillate; neither the slope constraints nor exact arithmetic guarantee a shape-preserving curve between nodes.

A derivative is an additional independent condition

Two ordinary values leave only two interpolation conditions and determine a line when the degree is limited to one. The default Hermite data add two slopes, increasing the number of conditions to four and permitting a cubic. The node-check table substitutes the resulting polynomial and its derivative at every original location, so a correct y value cannot conceal a wrong slope.

Confluent divided differences represent each node twice internally. When the two node entries coincide, the corresponding first divided difference is the supplied derivative rather than a quotient with a zero denominator. Higher divided differences then combine information from distinct nodes. Users should enter one complete row per x location; duplicating a row is not the method for requesting a higher derivative here.

Endpoint values and slopes determine the Hermite cubic x cubedp′(0) = 0p′(1) = 3p(1/2) = 1/8
At zero the value and derivative are both zero; at one they are one and three. The endpoint tangent segments illustrate those additional constraints.

The Polynomial interpolation calculator from points uses values alone; its maximum degree follows a different constraint count.

A global Hermite polynomial is not a piecewise spline

The page constructs one polynomial across all nodes. A piecewise cubic Hermite curve uses a separate cubic on each adjacent interval and imposes a different global model. Adding many slope constraints to this page can increase the degree substantially, even if the eventual polynomial simplifies. Neither model should be substituted for the other without deciding which continuity and shape assumptions are intended.

Derivative units must be compatible with the entered axes. If x is seconds and y is meters, the derivative is meters per second. Rescaling the x axis requires rescaling derivative values too; copying only the x coordinates into another unit would change the constraint problem. The ordinary polynomial interpolation calculator covers values without slopes. This Hermite page keeps exact values, exact slope checks and a sampled decimal graph together, with no claim that the graph itself is an exact drawing.

A few questions, answered

Can the polynomial degree be below 2n−1?

Yes. That is a maximum degree. Compatible constraints can lie on a lower-degree polynomial, including a constant or straight line.

Does one node give a useful result?

One value and one first derivative determine a line tangent to the supplied local data. More distinct nodes add global constraints.

Find your calculator

Start typing to explore the library.