6
$\begingroup$

I recently learnt about dual numbers, of the form $u + v\varepsilon$ where $u, v \in \mathbb R$ and $\varepsilon \notin \mathbb R$ is such that $\epsilon^2 = 0$. These numbers are used for automatic differentiation as they allegedly satisfy $f'(x) = \operatorname{Dual}(f(x+\varepsilon))$, where $\operatorname{Dual}$ is the coefficient of $\varepsilon$ in the cartesian expansion of a dual number. However, all resources I came across just showed this property for a few simple examples, usually polynomial.

I tried to prove or reject this property for a more general class of functions. So let's assume $f : (I \subseteq \mathbb R) \to \mathbb R$ is differentiable and $\delta$ is a small non-zero real number. We can then write $f(x+\delta) = f(x) + \delta f'(x) + \delta o(1)$, where $o(1)$ goes to $0$ as $\delta$ goes to $0$. Assuming we manage to make $\varepsilon$ behave like a small non-zero real, we get $f(x+\epsilon) = f(x) + \varepsilon f'(x) + \varepsilon o(1)$, and if $o(1) = \varepsilon \times \text{something}$ we can conclude that the dual part of $f(x+\varepsilon)$ is indeed $f'(x)$. This happens when $f$ can be expressed as a power series, which already helps cover a nice range of functions.

However:

  • being differentiable likely isn't enough to having a first-order Taylor expansion with a remainder of the form $\epsilon^2 \times \text{stuff}$, but can we make weaker assumptions?
  • can we even extend real functions to dual reals in a way that guarantees that $f(x+\varepsilon)$ looks like $f(x+\delta)$ for small $\delta$?

As an example for the second point, defining absolute value seems quite non-trivial. Assuming $|x+\varepsilon|$ is a square root of $(x+\varepsilon)^2$, calculations show that it must equal $\pm(x+\epsilon)$ if $x \neq 0$ and $0$ otherwise. To be able to find the derivative of $x \mapsto |x|$ and $x \mapsto x|x|$, we figure out that the best choice is probably to set $|x + \varepsilon| = x+\varepsilon$ if $x > 0$, $-(x+\varepsilon)$ if $x < 0$ and $0$ if $x = 0$.

$\endgroup$
8
  • 4
    $\begingroup$ You may be interested in the Transfer Principle for the hyperreals. It's what allows us to extend real functions to hyperreal ones. en.wikipedia.org/wiki/Transfer_principle $\endgroup$ Commented Apr 20 at 17:28
  • 3
    $\begingroup$ @CyclotomicField this question is not about hyperreals. $\endgroup$ Commented Apr 20 at 17:52
  • 1
    $\begingroup$ Note that real absolute value is usually replaced by the following "complex" modulus : $|x+\varepsilon|^2 = (x+\varepsilon)(x-\varepsilon) = x^2$, hence $|x+\varepsilon| = |x|$ simply. $\endgroup$ Commented Apr 20 at 18:26
  • 2
    $\begingroup$ @Abezhiko That's useful as a "geometric" absolute value for dual numbers, but it's not a good extension of real absolute value here, since the derivative of $|x|$ via dual numbers would be computed as $0$ for all $x$. $\endgroup$ Commented Apr 20 at 18:40
  • 2
    $\begingroup$ It is certainly not defined, as written, until you define it. All we can really say is that the definitions "makes sense" for a wide class of functions, like analytic functions. $\endgroup$ Commented Apr 20 at 19:46

1 Answer 1

2
$\begingroup$

As far as I am concerned, what you are looking for is true for any holomorphic function. This holds because given a function $f$ whose Taylor series around a certain point $a$ is

$$ f(x) = \sum_{n=0}^{\infty} \frac{d^nf(a)}{dx^n} \cdot (x-a)^n \Longrightarrow f(x+\varepsilon) = \sum_{n=0}^{\infty} \frac{d^nf(a)}{dx^n} \sum_{k=0}^n \binom{n}{k}\varepsilon^k(x-a)^{n-k} $$

has as dual part

$$ \mathfrak{D}(f(x+\varepsilon)) = \sum_{n=1}^{\infty} \frac{d^nf(a)}{dx^n} \cdot \binom{n}{1}(x-a)^{n-1} = f'(x) $$

In general, I cannot quite guarantee you that every single function with derivative verifies that $\mathfrak{D}(f(x+\varepsilon)) = f'(x)$ for all $x$ where $f$ has derivative.

$\endgroup$

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.