I want to discuss about the differentiability of $g(x)=|f(x)|$, where $f$ is a differentiable function

Example 1

Take $f(x)=|x|$, function is clearly not differentiable at $x=0$. enter image description here

Example 2

Take $f(x)=|\sin(x)|$, function is clearly not differentiable at the point $x=n\pi$

enter image description here

After taking few more examples like $|x-1|, |\cos(x)|$, it always seems to be the case that $|f(x)|$ is not differentiable at the points where $f(x)=0$

Observation: One thing is common in all the examples that some portion of $f(x)$ lies below $x$ axis. So I took another example

$f(x)=x^2$ but $|f(x)|$ is differentiable at the point where $f(x)=0$

Question 1:

Am I right in concluding that we can not just say in general setting that $|f(x)|$ is not differentiable at the points where $f(x)=0$?

When can we(I mean under what conditions can we )conclude that $|f(x)|$ is differentiable at points where $f(x)=0$. My hypothesis is that graph of $f$ should lie below $x$ axis.

Question 2:

Let $f(x)$ and $g(x)$ be two differentiable function, when can we conclude that $|f(x)|+|g(x)|$ is not differentiable at the points where $f(x)=0$ and $g(x)=0$

Example $|sin(2-x)|+ |cos(x)| $ are not differentiable at $x=2+2\pi, x=(2n+1)\frac{k}{2}$

Edits As mentioned by @Torsten Schoeneberg in comments, my hypothesis fails!! enter image description here

Grand Edit:

$f(x)=|x|$ then $f'(x)=\text{sign}{(x)}$

So let $f(x)$ be a differentiable function, and let $g(x)=|f(x)|$, then $$g'(x) =\text{sign}(f(x))f'(x)$$ Note that $\text{sign}{(f(x))}=\begin{cases}{ -1 \quad \text{if } f(x)<0\\+1 \quad \text{if } f(x)>0 } \\{ 0 \quad \text{if } f(x)=0} \end{cases}$

Am I going in right direction?

  • 1
    $\begingroup$ To your hypothesis in question 1, check $f(x)= x^3$. $\endgroup$ Sep 19, 2018 at 23:00
  • 1
    $\begingroup$ Yes to the first question: if $f$ is non-negative and differentiable, then $|f| \equiv f$ and thus the former is differentiable (in particular at its roots). There are plenty of such examples. $\endgroup$
    – qualcuno
    Sep 19, 2018 at 23:03
  • 2
    $\begingroup$ Perhaps check this conjecture: If $f$ is 0 at point $x=a$, and $f'(a)\neq 0$, then $|f|$ is not differentiable at $a$. $\endgroup$
    – bonsoon
    Sep 19, 2018 at 23:08
  • 2
    $\begingroup$ +1 for showing so much thought. $\endgroup$
    – Randall
    Sep 19, 2018 at 23:08
  • 1
    $\begingroup$ Concerning the "grand edit": Certainly that is one way to go for those $x$ where $f(x)\neq 0$, but be careful, we do not have that the derivative of the absolute value function at $0$ is $sign(0) =0$; rather, it is undefined. (The absolute value function is not differentiable at $x=0$, as you yourself noticed at the beginning of your post.) $\endgroup$ Sep 20, 2018 at 3:41

1 Answer 1


Hint: Try to show that if $f(x_0)\ne 0,$ then $f'(x_0)$ exists iff $|f|'(x_0)$ exists. And if $f(x_0)= 0$ and $f'(x_0)$ exists, then $|f|'(x_0)$ exists iff $f'(x_0)=0.$

  • $\begingroup$ Please have a look at the edited post. $\endgroup$ Sep 19, 2018 at 23:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.