One application of dual numbers is automatic differentiation. Consider the real dual numbers above. Given any real polynomial P(x) = p0+p1x+p2x2+...+pnxn, it is straightforward to extend the domain of this polynomial from the reals to the dual numbers. Then we have this result:
- where is the derivative of .
By computing over the dual numbers, rather than over the reals, we can use this to compute derivatives of polynomials.
More generally, we can extend any (smooth) real function to the dual numbers by looking at its Taylor series: .
By computing compositions of these functions over the dual numbers and examining the coefficient of ε in the result we find we have automatically computed the derivative of the composition.
This effect can be explained from the non-standard analysis viewpoint. The imaginary unit ε of dual numbers is a close relative to infinitesimal used in non-standard calculus: indeed the square (or any higher power) of ε is exactly zero and the square of an infinitesimal is almost zero at this infinitesimal's scale (is an infinitesimal of a higher order more precisely).
Read more about this topic: Dual Number