4

For this question, let $f(x) = |x|$.


I found this answer saying that the derivative of the absolute value function is the signum function. In symbols,

$$\frac{d}{dx}|x| = \mathrm{sgn}(x).$$

I know that

$$f'(x) = \frac{x}{|x|}$$

using the chain rule. Notice that this is well-defined for $x \neq 0$. However, the definition of the signum function is

$$\mathrm{sgn}\,x = \begin{cases}-1 && \text{for } x< 0 \\ 0 &&\text{for }x = 0 \\ 1 && \text{for } x > 0\end{cases}.$$

This will be my question:

Are $x/|x|$ and $\mathrm{sgn}\,x$ the same derivative of $|x|$?

soupless
  • 2,344
  • 1
    $f(x)=|x|$ is not differentiable at $0$. The map $x \mapsto x/|x|$ and $x \mapsto \text{sgn} x$ match for $x \ne 0$, but the former is not defined at $x=0$. – angryavian Apr 27 '21 at 07:23
  • 1
    This is an edge case that depends on the context you are working in. As a strict function, and using the standard calculus definition of the derivative, they are not equal. But in other contexts they are equal. For example, they are equal $L^2$, and correspond to the weak derivative of $|x|$ as a function in $H^1$. Or in physics, if $|x|$ represents a potential, then the two functions are equal as physical fluxes. – Nick Alger Apr 27 '21 at 07:51

4 Answers4

8

No they are not. The absolute value function is differentiable at $x$ if and only if $x\ne0$. And, when that happens, the derivative is indeed $\operatorname{sgn}(x)$ or $\frac x{|x|}$. But, since the derivative of the absolute value function is undefined at $0$, but $\operatorname{sgn}$ is defined at that point, those two functions have distinct domains and therefore they cannot possibly be equal.

  • Examples abound in higher math where two functions are said to be equal, when they have different domains of definition, but are equal on the domains in which they are defined. Would you object to someone who says that $1/z$ is the derivative of $\log z$ (consider branch cut issues)? – Nick Alger Apr 27 '21 at 08:25
  • 1
    @NickAlger No, because $\frac1z$ is not a function; it's an analytic expression. So, for me, asserting that the derivative of $\log z$ is $\frac1z$ simply means that, whenever $\log$ is differentiable, $\log'z=\frac1z$. But if someone defined$$\begin{array}{rccc}\iota\colon&\Bbb C&\longrightarrow&\Bbb C\&z&\mapsto&\frac1z\end{array}$$and then asserted that, for some branch of the logarithm, $\log'=\iota$, I would disagree. But I agree that we don't use a very precise language when talking about these things. – José Carlos Santos Apr 27 '21 at 08:41
3

Yes, in fact you have three common expressions for $\text{sgn}$:

$$\text{sgn}(x) = \frac{x}{|x|} = \frac{|x|}{x}.$$

The two last expressions are of course only valid for $x \neq 0$, but poses no problem when talking about the derivative of $|x|$ since it is not differnetiable at $0$.

EDIT: You can of course not say that the derivative of $|x|$ and $\text{sgn}$ are the same function, since the have different domains. But $\text{sgn}$ provides a very compact way of presenting the derivative of $|x|$ when you make sure that you declare for which $x$ this is valid. What you can write is

$$\frac{d}{dx}|x| = \text{sgn}(x) \quad \text{for } x \neq 0.$$

  • You are in fact showing that the signum function is not equivalent to these ratios, thus not equivalent to the derivative of $|x|$. –  Apr 27 '21 at 07:26
  • This will depend on how one chooses to present. This explain why one can in good conscience write $\frac{d}{dx} |x| = \text{sgn}(x)$ for $x \neq 0$. It doesn't make sense say that $\text{sgn}(x)$ is the derivative of $|x|$ at $0$ since it is not differentiable at $0$. – Thusle Gadelankz Apr 27 '21 at 07:28
  • Refer to José's answer. –  Apr 27 '21 at 07:29
  • The first equality in this answer is wrong. I could understand writing it without too much care in a different context, but here this equality is the whole point of the question. – Javier Apr 27 '21 at 15:34
2

Summary:

$$|x|'\equiv\frac{|x|}{x}$$ is true.

$$|x|'\equiv\text{sgn}(x)$$ is not.

0

yes, the function $f(x)=|x|$ is non differentiable at $x=0$ so as far as domain is concerned for $f'(x)$ it is going to be $\mathbb{R} - {{0}}$ and for this domain $x/|x| = sgn(x)$

for better understanding of where functions are non differentiable refer http://www-math.mit.edu/~djk/calculus_beginners/chapter09/section03.html