0
$\begingroup$

I just want to check if this is the correct way to handle $\frac d{dx} |f(x)|$.

Should you say $|f(x)| = \operatorname{sgn}(f(x))f(x)$ (where $\operatorname{sgn}(x)$ is the sign function which equals $\pm 1$, depending on the sign of $x$) and then take the derivative of this, where $\operatorname{sgn}(x)$ is a constant? I.e. $\frac d{dx} |f(x)| = \operatorname{sgn}(x) \frac {df}{dx}$?

What about integration? Can I also do $\int_a^b |f(x)|dx = \operatorname{sgn}(f(x))\int_a^b f(x)dx$?

$\endgroup$
5
  • $\begingroup$ Just have a look at the graph of $g(x)=|x|$ to see that this is not everywhere differentiable. $\endgroup$
    – Thomas
    Mar 6, 2015 at 15:51
  • $\begingroup$ Oh yeah. So I'd have to figure out where all of the cusps are first. But does it work everywhere where there's not a cusp? $\endgroup$
    – user221523
    Mar 6, 2015 at 15:52
  • $\begingroup$ @user221523 The derivative simply doesn't exist where $f(x) = 0$. Apart from that, the chain rule dictates $$|f(x)|' = \mathrm{sgn}(f(x)) f'(x)$$ $\endgroup$
    – AlexR
    Mar 6, 2015 at 15:55
  • $\begingroup$ Please look up the definition of weak derivative. The function might have a derivative in this sense. $\endgroup$ Mar 6, 2015 at 15:56
  • $\begingroup$ OK @Euler....IS_ALIVE I'm about to have to go to class, but I'll look that up later. Thanks. $\endgroup$
    – user221523
    Mar 6, 2015 at 15:58

2 Answers 2

1
$\begingroup$

The derivative simply doesn't exist where $f(x) = 0, f'(x) \ne 0$. Apart from that, the chain rule dictates $$|f(x)|' = \mathrm{sgn}(f(x)) f'(x)$$ Conversely you have $$\int_0^x |t|\ \mathrm dt = \frac12\mathrm{sgn}(x)x^2$$ wich can be used for integration.

$\endgroup$
3
  • $\begingroup$ OK. Thanks. That's what I thought. I'll accept this when it lets me later if no one has given a different answer. $\endgroup$
    – user221523
    Mar 6, 2015 at 15:58
  • 1
    $\begingroup$ The derivative does exist sometimes when $f(x) = 0$. For example, if $f(x) = x^3$ then $\left.\frac{d|f|}{dx}\right|_{x=0} = 0$. And the integral trick only works when $f(x)$ is always non-negative or always non-positive on the interval $(a,b)$. $\endgroup$ Mar 6, 2015 at 16:02
  • $\begingroup$ @MarkFischler Actually $f(x) = f'(x) = 0$ is okay, but I added that. $|x^3|' = 3\mathrm{sgn}(x)x^2$ $\endgroup$
    – AlexR
    Mar 6, 2015 at 16:03
0
$\begingroup$

Your first statement $$ \frac{d}{dx}\left| f(X) \right| = \text{sgn}(x) \frac{df}{dx} $$ is true for all $x$ such that either $f(x) \neq 0$, or if $f(x) = 0$, then $f'(x) = 0$ as well. But not for the reason you state: It is not valid to blithely treat $\text{sgn}(x)$ is a constant. If it were, then those exceptions would not be exceptions.

The integration statement is completely wrong, and in fact ill-posed, since $x$ on the left is a dummy variable of integration, while $x$ is used outside the integral on the right.

$\endgroup$
2
  • $\begingroup$ There's a severe error in the equation (not sure if typo or not). $\endgroup$
    – AlexR
    Mar 6, 2015 at 15:59
  • $\begingroup$ I'm talking about the argument of $\mathrm{sgn}$. Please fix. $\endgroup$
    – AlexR
    Mar 6, 2015 at 16:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .