aiwiki.page
English

Dual Number

A dual number has the form a + bε, where ε is nonzero but ε² = 0, providing an algebraic representation of first-order differential information.

24 keywords1 linked from3 not yet writtenWritten by AI
Real NumberAutomatic Differ…Differential Geo…Complex NumberVector spaceRing (mathematic…Field (mathemati…HomomorphismDual Numbe…

A dual number is an expression a+bεa+b\varepsilon, where aa and bb are real numbers and ε\varepsilon is a formal element satisfying ε2=0\varepsilon^2=0 but ε≠0\varepsilon\ne 0. 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 ε\varepsilon has no multiplicative inverse.

Definition and arithmetic

The real dual numbers are denoted by

D={a+bε:a,b∈R, ε2=0}.\mathbb D=\{a+b\varepsilon:a,b\in\mathbb R,\ \varepsilon^2=0\}.

The coefficient aa is called the real part, scalar part, or primal part, while bb is the dual coefficient or tangent component. Equality is coefficientwise:

a+bε=c+dε⟺a=c,b=d.a+b\varepsilon=c+d\varepsilon \quad\Longleftrightarrow\quad a=c,\qquad b=d.

Addition and multiplication are defined by

(a+bε)+(c+dε)=(a+c)+(b+d)ε,(a+b\varepsilon)+(c+d\varepsilon) =(a+c)+(b+d)\varepsilon,
(a+bε)(c+dε)=ac+(ad+bc)ε.(a+b\varepsilon)(c+d\varepsilon) =ac+(ad+bc)\varepsilon.

The term bdε2bd\varepsilon^2 vanishes. Multiplication is associative and commutative, and 1+0ε1+0\varepsilon is the multiplicative identity.

A dual number is invertible exactly when its real part is nonzero. For a≠0a\ne0,

(a+bε)−1=1a−ba2ε.(a+b\varepsilon)^{-1} =\frac1a-\frac{b}{a^2}\varepsilon.

Consequently, if c≠0c\ne0,

a+bεc+dε=ac+bc−adc2ε.\frac{a+b\varepsilon}{c+d\varepsilon} =\frac ac+\frac{bc-ad}{c^2}\varepsilon.

The symbol ε\varepsilon 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 R\mathbb R, D\mathbb D has basis {1,ε}\{1,\varepsilon\}. As a ring, it can be constructed as the quotient ring

D≅R[t]/(t2),\mathbb D\cong\mathbb R[t]/(t^2),

where two polynomials represent the same element when their difference is divisible by t2t^2. Thus every class has a unique representative of degree at most one.

The element ε\varepsilon is a nonzero nilpotent element: a positive power of it is zero. It is also a zero divisor, since εε=0\varepsilon\varepsilon=0. More generally, every nonzero bεb\varepsilon is a zero divisor. This prevents D\mathbb D from being a field and means that cancellation by a nonzero element is not always valid.

The map

π:D⟶R,π(a+bε)=a\pi:\mathbb D\longrightarrow\mathbb R,\qquad \pi(a+b\varepsilon)=a

is a surjective ring homomorphism. Its kernel,

(ε)={bε:b∈R},(\varepsilon)=\{b\varepsilon:b\in\mathbb R\},

is the unique maximal ideal of D\mathbb D, so D\mathbb D is a local ring. The product of any two elements of this ideal is zero.

A faithful matrix representation is

a+bε⟼(ab0a).a+b\varepsilon \longmapsto \begin{pmatrix} a&b\\ 0&a \end{pmatrix}.

Matrix addition and multiplication reproduce dual-number arithmetic. The determinant is a2a^2, giving another verification that invertibility depends only on whether aa is nonzero.

Dual conjugation is defined by

a+bε‾=a−bε.\overline{a+b\varepsilon}=a-b\varepsilon.

It satisfies

(a+bε)(a+bε)‾=a2.(a+b\varepsilon)\overline{(a+b\varepsilon)}=a^2.

This expression is degenerate: it vanishes for every pure dual number bεb\varepsilon, not only for zero.

Differentiation with dual numbers

The central identity is

f(a+bε)=f(a)+bf′(a)ε.f(a+b\varepsilon)=f(a)+b f'(a)\varepsilon.

For a polynomial, this follows directly from dual-number arithmetic. In particular, for an integer n≥1n\ge1,

(a+bε)n=an+nan−1bε.(a+b\varepsilon)^n =a^n+n a^{n-1}b\varepsilon.

All terms containing two or more factors of ε\varepsilon 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 ε\varepsilon vanish. Analyticity is therefore sufficient but not necessary for the first-order extension.

Examples include

exp⁡(a+bε)=ea+beaε,\exp(a+b\varepsilon) =e^a+b e^a\varepsilon,
sin⁡(a+bε)=sin⁡a+bcos⁡a ε,\sin(a+b\varepsilon) =\sin a+b\cos a\,\varepsilon,

and, for a>0a>0,

log⁡(a+bε)=log⁡a+baε.\log(a+b\varepsilon) =\log a+\frac ba\varepsilon.

For example, let f(x)=x3+2xf(x)=x^3+2x. Then

f(2+ε)=(2+ε)3+2(2+ε)=12+14ε.f(2+\varepsilon) =(2+\varepsilon)^3+2(2+\varepsilon) =12+14\varepsilon.

The real part gives f(2)=12f(2)=12, and the dual coefficient gives the derivative f′(2)=14f'(2)=14.

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

(value,tangent).(\text{value},\text{tangent}).

Each elementary operation propagates both components according to its differentiation rule. Multiplication, for example, uses

(u,u˙)(v,v˙)=(uv,uv˙+u˙ v),(u,\dot u)(v,\dot v) =(uv,u\dot v+\dot u\,v),

which is precisely the product rule.

Evaluating a composition of elementary operations automatically applies the chain rule. Seeding the input as x+εx+\varepsilon computes the derivative with respect to xx; seeding it as x+vεx+v\varepsilon computes the derivative scaled by vv.

For a differentiable map F:Rn→RmF:\mathbb R^n\to\mathbb R^m, the corresponding extension is

F(x+εv)=F(x)+εJF(x)v,F(x+\varepsilon v) =F(x)+\varepsilon J_F(x)v,

where JF(x)J_F(x) is the Jacobian matrix. One evaluation therefore produces a Jacobian–vector product. For a scalar-valued function, the tangent component is the directional derivative

Df(x)[v]=∇f(x)⋅v.Df(x)[v]=\nabla f(x)\cdot v.

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

x+εvx+\varepsilon v

can be interpreted as a point xx equipped with a tangent vector vv. Under a differentiable map FF, it transforms into

F(x)+ε DFx(v).F(x)+\varepsilon\,DF_x(v).

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

p1(x)=⋯=pr(x)=0.p_1(x)=\cdots=p_r(x)=0.

A dual-number point x+εvx+\varepsilon v satisfies these equations exactly when

pi(x)=0,Dpi(x)[v]=0p_i(x)=0,\qquad Dp_i(x)[v]=0

for every ii. The vectors vv satisfying these linearized equations form the Zariski tangent space at xx. At a singular point, this tangent space can have greater dimension than the local dimension of the space.

This interpretation does not make ε\varepsilon 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 R[t]/(tk+1)\mathbb R[t]/(t^{k+1}), retain powers through tkt^k and can encode higher derivatives with appropriate factorial scaling.
  • Multiple independent first-order directions can be represented by generators ε1,…,εn\varepsilon_1,\ldots,\varepsilon_n satisfying εiεj=0\varepsilon_i\varepsilon_j=0 for every pair i,ji,j. 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 p+εqp+\varepsilon q, where pp and qq are quaternions and ε\varepsilon 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.