Dual numbers capture first-order derivatives because the infinitesimal element satisfies
Dual numbers capture first-order derivatives because the infinitesimal element satisfies
To compute higher-order derivatives, we extend this idea by allowing higher powers to survive temporarily before truncation.
The resulting structures are called truncated polynomial algebras.
They generalize dual numbers from first-order infinitesimals to finite-order infinitesimal expansions.
From Dual Numbers to Higher Orders
Recall the dual-number algebra:
Every element has the form
The condition
removes all second-order and higher terms.
Now instead consider:
Here powers up to survive:
Only terms of degree and higher vanish.
This algebra stores derivatives up to order .
Example: Second-Order Algebra
The simplest nontrivial extension is:
Elements have the form:
Now:
but:
Multiplication works by ordinary polynomial multiplication followed by truncation.
For example:
expands to:
All powers containing or above vanish.
Taylor Expansion Interpretation
The key connection comes from Taylor expansion.
For a smooth function:
Substitute a truncated infinitesimal:
Then:
The series terminates exactly.
Higher-order derivatives become coefficients in the algebra.
Second Derivative Example
Let:
Use the algebra:
Evaluate:
Expanding:
Since:
we obtain:
Compare with Taylor expansion:
Since:
and
we get:
The coefficients match exactly.
Structure of the Algebra
The truncated polynomial algebra
is:
- commutative
- finite-dimensional
- associative
- local
- nilpotent
Its basis is:
Dimension is:
Every element is represented uniquely as:
Arithmetic remains finite because powers terminate.
First-Order Versus Higher-Order AD
Dual numbers compute first derivatives:
Truncated polynomial algebras compute finite Taylor expansions:
Thus:
| Algebra | Information Stored |
|---|---|
| First derivative | |
| Second derivative | |
| Third derivative | |
| -th derivatives |
Forward-mode higher-order AD is therefore polynomial propagation over truncated algebras.
Polynomial Propagation Through Programs
Suppose a program computes:
Represent input as:
Each intermediate variable becomes a truncated polynomial.
First compute:
Then evaluate sine:
Taylor expansion automatically propagates derivative information through every intermediate computation.
Programs become finite Taylor-series transformers.
Jet Spaces
In differential geometry, truncated polynomial algebras correspond to jet spaces.
A -jet stores derivatives up to order .
Two smooth functions are equivalent at a point if their derivatives agree through order .
The truncated algebra captures exactly this finite local behavior.
For example:
- dual numbers correspond to first jets
- cubic truncations correspond to second jets
- higher truncations correspond to higher jets
Automatic differentiation over truncated algebras therefore computes finite jets of programs.
Multiple Variables
For multivariate functions, introduce several infinitesimal generators:
A second-order algebra may satisfy:
or:
while mixed products survive.
A general element becomes:
The coefficients encode:
- first derivatives
- mixed partial derivatives
- Hessian structure
This forms the basis of multivariate higher-order AD.
Example: Mixed Partial Derivatives
Let:
Represent:
Then:
The mixed product term survives.
Expanding the full function reveals coefficients involving:
Those coefficients encode:
Higher-order structure emerges directly from algebraic multiplication.
Computational Complexity
Higher-order propagation becomes expensive because coefficient counts grow rapidly.
For order in variables, the number of monomials is:
Growth is combinatorial.
For example:
| Variables | Order | Number of Terms |
|---|---|---|
| 1 | 2 | 3 |
| 2 | 2 | 6 |
| 5 | 3 | 56 |
| 10 | 4 | 1001 |
This combinatorial explosion is one of the main challenges in higher-order automatic differentiation.
Sparse and Structured Representations
Practical systems rarely store full dense polynomial expansions.
Instead they exploit:
- sparsity
- symmetry
- directional derivatives
- compressed Hessians
- low-rank structure
Methods include:
- truncated Taylor mode
- hyper-dual numbers
- Hessian-vector products
- checkpointed higher-order reverse mode
The algebraic viewpoint remains the same even when representations become optimized.
Relation to Formal Power Series
Truncated polynomial algebras are finite approximations to formal power series.
A formal power series has infinite expansion:
Truncated algebras cut this off at finite order:
Automatic differentiation computes finite local expansions rather than full analytic series.
This finite truncation keeps computation practical.
Program Semantics View
Ordinary execution interprets variables as real numbers:
First-order forward AD interprets them as dual numbers:
Higher-order AD interprets them as truncated polynomials:
The program structure remains unchanged.
Only the underlying algebra changes.
This is one of the deepest ideas in automatic differentiation: differentiation can be implemented by changing the algebra of evaluation.
Algebraic Summary
Truncated polynomial algebras generalize dual numbers by preserving higher-order infinitesimal terms.
The algebra:
stores finite Taylor expansions up to order .
Evaluating a function in this algebra produces:
Thus:
- coefficients become derivatives
- multiplication propagates chain rules
- higher-order interactions emerge naturally
- differentiation becomes algebraic evaluation
Higher-order automatic differentiation is therefore computation over truncated polynomial algebras.