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

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$. Example 2

Take $f(x)=|\sin(x)|$, function is clearly not differentiable at the point $x=n\pi$ 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!! 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?

• To your hypothesis in question 1, check $f(x)= x^3$. – Torsten Schoeneberg Sep 19 '18 at 23:00
• 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. – Guido A. Sep 19 '18 at 23:03
• Perhaps check this conjecture: If $f$ is 0 at point $x=a$, and $f'(a)\neq 0$, then $|f|$ is not differentiable at $a$. – bonsoon Sep 19 '18 at 23:08
• +1 for showing so much thought. – Randall Sep 19 '18 at 23:08
• 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.) – Torsten Schoeneberg Sep 20 '18 at 3:41

## 1 Answer

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.$

• Please have a look at the edited post. – StammeringMathematician Sep 19 '18 at 23:36