A dual number is an expression , where and are real numbers and is a formal element satisfying but . Dual numbers form a two-dimensional commutative algebra over the real numbers. Their arithmetic encodes the rules of first-order differentiation, making them useful in automatic differentiation, differential geometry, and the study of infinitesimal changes. Unlike the complex numbers, they do not form a field, because a nonzero multiple of has no multiplicative inverse.
Definition and arithmetic
The real dual numbers are denoted by
The coefficient is called the real part, scalar part, or primal part, while is the dual coefficient or tangent component. Equality is coefficientwise:
Addition and multiplication are defined by
The term vanishes. Multiplication is associative and commutative, and is the multiplicative identity.
A dual number is invertible exactly when its real part is nonzero. For ,
Consequently, if ,
The symbol is not a very small positive real number. It is an exact algebraic object whose square is zero. In particular, no nonzero real number can satisfy its defining relation.
Algebraic structure
As a vector space over , has basis . As a ring, it can be constructed as the quotient ring
where two polynomials represent the same element when their difference is divisible by . Thus every class has a unique representative of degree at most one.
The element is a nonzero nilpotent element: a positive power of it is zero. It is also a zero divisor, since . More generally, every nonzero is a zero divisor. This prevents from being a field and means that cancellation by a nonzero element is not always valid.
The map
is a surjective ring homomorphism. Its kernel,
is the unique maximal ideal of , so is a local ring. The product of any two elements of this ideal is zero.
A faithful matrix representation is
Matrix addition and multiplication reproduce dual-number arithmetic. The determinant is , giving another verification that invertibility depends only on whether is nonzero.
Dual conjugation is defined by
It satisfies
This expression is degenerate: it vanishes for every pure dual number , not only for zero.
Differentiation with dual numbers
The central identity is
For a polynomial, this follows directly from dual-number arithmetic. In particular, for an integer ,
All terms containing two or more factors of vanish.
For a differentiable real function, the same formula defines its first-order extension to dual numbers wherever its derivative exists. For an analytic function, the formula also follows from its Taylor series, since all terms of degree two and higher in vanish. Analyticity is therefore sufficient but not necessary for the first-order extension.
Examples include
and, for ,
For example, let . Then
The real part gives , and the dual coefficient gives the derivative .
This is not an approximation obtained by choosing a small step size. It is an exact identity in the dual-number algebra, subject in a computer implementation to ordinary rounding and evaluation errors.
Automatic differentiation
Dual numbers provide a direct implementation of forward-mode automatic differentiation. A program represents each intermediate quantity as a pair
Each elementary operation propagates both components according to its differentiation rule. Multiplication, for example, uses
which is precisely the product rule.
Evaluating a composition of elementary operations automatically applies the chain rule. Seeding the input as computes the derivative with respect to ; seeding it as computes the derivative scaled by .
For a differentiable map , the corresponding extension is
where is the Jacobian matrix. One evaluation therefore produces a Jacobian–vector product. For a scalar-valued function, the tangent component is the directional derivative
Ordinary dual numbers carry one tangent direction at a time. Computing a full Jacobian may require multiple evaluations or a generalized representation carrying several tangent components. Reverse-mode automatic differentiation uses a different propagation strategy and can be more efficient for scalar-valued functions with many inputs.
Unlike finite-difference derivative estimates, dual-number differentiation introduces no step-size truncation error and does not estimate derivatives by subtracting nearby function values. Nevertheless, floating-point arithmetic still introduces rounding errors. Nondifferentiable operations, discrete decisions, and branch boundaries require care: propagating through the executed branch does not establish that the overall program is differentiable at that input.
Infinitesimal and geometric interpretation
Dual numbers describe first-order changes while discarding products of changes. An expression
can be interpreted as a point equipped with a tangent vector . Under a differentiable map , it transforms into
This packages the action of the derivative on a tangent space into ordinary algebraic evaluation.
In algebraic geometry, dual numbers provide an algebraic description of tangent directions. Suppose a space is defined by polynomial equations
A dual-number point satisfies these equations exactly when
for every . The vectors satisfying these linearized equations form the Zariski tangent space at . At a singular point, this tangent space can have greater dimension than the local dimension of the space.
This interpretation does not make an ordinary real displacement. Its infinitesimal character comes from nilpotence, rather than from being a nonzero real quantity smaller than every positive real number.
History and related constructions
Dual numbers are generally credited to William Kingdon Clifford, who introduced them in 1873. They subsequently became useful in geometry, mechanics, and computational differentiation.
Several related constructions retain different amounts of differential information:
- Higher-order truncated polynomial algebras, such as , retain powers through and can encode higher derivatives with appropriate factorial scaling.
- Multiple independent first-order directions can be represented by generators satisfying for every pair . These retain several first derivatives but no mixed second-order information.
- Hyper-dual numbers use commuting generators whose individual squares vanish while certain mixed products remain nonzero. Those products can carry mixed second derivatives.
- Dual quaternions have the form , where and are quaternions and commutes with them. With suitable constraints, they represent rigid-body rotations and translations.
The term “dual” here should not be confused with the dual space of a vector space, which consists of linear functionals, or with optimization duality. These are distinct mathematical constructions.