4

If you differentiate the absolute value function the result could be the Sign Function. By definition, the Sign Function is defined at 0, but there is no derivate of absolute value function at zero.

So, the question is: Is the Sign Function a valid function to be the derivative of absolute value? Is there another function?

K.defaoite
  • 12,536
  • You’re right, the correct derivative would be a modified sign function that’s undefined at $0$. – Milten Jul 22 '21 at 15:15
  • 1
    Or you can say the derivative is $sign(x)$ for $x\ne0$. – Milten Jul 22 '21 at 15:16
  • Why do you say that the result of differentiating the absolute value function IS the sign function then ask IF that is true? No, since the sign function is 0 at x= 0 while the derivative of the absolute value function is not defined at x= 0 the derivative of the absolute value function is NOT the sign function! – user247327 Jul 22 '21 at 15:22

6 Answers6

4

Since the absolute value function is not differentiable at $0$, no function which is defined at $0$ can possibly be its derivative. But, of course, if you differentiate it, then you get the sign function at any point other than $0$.

J. W. Tanner
  • 60,406
1

If you read the article you linked, it says $$\frac{{\rm d}}{{\rm d}x}|x|=\operatorname{sgn}x,\quad \color{red}{x\ne 0}$$ In fact $|x|$ is not differentiable at $x=0$.

5201314
  • 2,227
1

The derivative of the absolute value function is indeed not defined at $0$, but so is this representation of the sign function, that you can use as the derivative of $|x|$: $$\frac{d}{dx}|x| = \frac{|x|}{x} = \frac{x}{|x|}$$

1

So far there are four answers to the first question of the OP: is the sign(x) function a valid function to be the derivative of the absolute value function? The answer is no, because the sign funftion is defined at $x = 0$ and the derivative is not. That is just formal mathematics, a matter of definitions.

The second question of the OP is constructive and in my opinion therefore more interesting: is there another function that can serve as the derivative? In other words, can we express the absolute value function in such a way that the derivative exist in $x = 0$?

The answer is yes. In mathematics there are several tricks one may use for this purpose.

A simple method is to use the Heaviside function to represent the absolute value function. For $x > 0$ we have $f = x$, and for $x < 0$ we have $f=-x$. Let us "glue" them together using the Heaviside function, to obtain:

$$f(x) = H(x)*x + (1-H(x))*-x$$

which we can rewrite as $$f(x) = (2*H(x) - 1) * x$$

We can now differentiate with respect to $x$ and obtain

$$f'(x) = 2*H(x) - 1 + 2x \delta (x)$$

where $\delta (x)$ is the Dirac delta function. This function holds for all values of $x$, in the sense that all mathematical operations (integration, differentiation etc) are well-defined and valid. The non-analytic behaviour of the derivative in $x = 0$ is of course still present, in the form of the second term.

Another method is to regard the abolute value function, with its sharp bend around $x = 0$, as the limit of a continuous function which is everywhere differentiable. It is not difficult at all to find such a continuous representation. Here is one:

$$ f(x) = \sqrt {x^2 + a^2}$$

where $a$ is an arbitrarily small parameter. Clearly the derivative $f'(x)$ now exists everywhere and can be used in calculations. At a suitable moment in the calculation the limit of $a$ to zero can be taken. Another choice is:

$$ f(x) = a * log[e^{x/a} + e^{-x/a}]$$

These methods are useful in applied mathematics, physics, engineering etc.

M. Wind
  • 3,624
  • 1
  • 14
  • 20
  • So what is $f’(0)$ in this construction? – Matthew Leingang Jul 24 '21 at 19:41
  • Both the second and third method yield $f'(0) = 0$ trivially. The first is more tricky, because $x*\delta(x)$ describes non-analytic behaviour. Still, if you take for $\delta (x)$ a narrow Gaussian around the origin, the term can be plotted and also yields $f'(0) = 0$. Of course it is "better" not to interpret the delta function this way, and to simply use in calculations as prescribed in handbooks. – M. Wind Jul 25 '21 at 04:29
  • Delta function could be use this way to calculate the density function of a convolution of a random variable and a constant value. So if you sum X, a random variable and a constant can be interpret as a convolution of X by delta function. – Guilherme Namen Jul 26 '21 at 11:37
  • I'm just not sure what use this is to the OP. Maybe if you went into more detail about the advantages of the delta “function” (e.g., how it works like a derivative in integration by parts). – Matthew Leingang Jul 26 '21 at 13:51
1

Let us differentiate the absolute value function distribution style. Write $f(x)=|x|$, then $f\in L^1_{\text{loc}}(\mathbb R)$ so we can consider $f$ as a distribution in $\mathcal D’(\mathbb R)$. Let $\phi\in C^\infty_c(\mathbb R)$, then by the very definition of distributional derivative we have; \begin{equation} \begin{split} \langle\phi ,f’\rangle &= -\langle \phi’,f\rangle=-\int_\mathbb R \phi’(x)|x|dx= -\int_0^\infty\phi’(x)xdx +\int_{-\infty}^0\phi’(x)xdx\\ &=\int_0^\infty \phi(x)dx - \int_{-\infty}^0 \phi(x)dx = \int_\mathbb R\phi(x)dx - 2\int_{-\infty}^0\phi(x)dx \\ &=\int_\mathbb R \phi(x)dx -2\int_\mathbb R \chi_{(-\infty,0]}(x)\phi(x)dx = \int_\mathbb R \big(\mathbf{ 1} -2\chi_{(-\infty,0]}(x)\big) \phi(x)dx\\ &=\langle\phi, \mathbf 1-2H\rangle. \end{split} \end{equation}

We conclude that $f’ = \mathbf 1-2H$.

Here $\mathbf 1$ denotes the constant map which is constantly $1$, and $H$ denotes the heavyside function. Furthermore $\chi_A(x)$ is the indicator function on the set $A$.

Now some justifications;

  • The first equality follows from the very definition of distributional derivatives.
  • The third equality is just splitting up the absolute value.
  • The fourth equality follows from partial integration.
  • Fifth equality is just some rewriting.

Note that the heavyside function is not defined in $x=0$!

0

The sign function $s(x)$ is the derivative of the function $f(x) = |x|$, except for the point $x=0$ where the sign function $s(x)$ is defined but $f'(x)$ is not defined.

So you could say that the sign function's domain has one extra point $x=0$ when compared to the domain of $f'(x)$, that's all.

peter.petrov
  • 12,568