3

Let the positive part function be defined as $\max(0,x)$; this function is obviously not differentiable in $x=0$.

But what about the (more smooth) function $\big( \max(0,x) \big)^{2}$. I suspect the latter isn't differentiable in $x=0$ either, but it's not very clear.

2 Answers2

4

$$\max(0,x)={1\over 2}(x+|x|)$$ $$(\max(0,x))^2={1\over 4}(2x^2+2x|x|)$$ and this function is $C^1$ but not $C^2$.

0

I thought I would provide a more detailed answer piggybacking off of Martin-Bias Perez Punilla's answer:

Indeed, we have that $$\begin{align} f_1(x) &:= \max(0,x) = \frac{x + |x|}{2} \\ f_2(x) &:= (\max(0,x))^2 = \frac{x^2 + x|x|}{2}. \end{align}$$ Then, using the fact that $\frac{d|x|}{dx} = \frac{|x|}{x}$ via this post, we have that $$ \begin{align} \frac{df_1(x)}{dx} &= \frac{1}{2}\left(1 + \frac{|x|}{x}\right), \\ \frac{df_2(x)}{dx} &= x + |x| = 2f_1(x), \\ \frac{df_2^2(x)}{dx} &= 1 + \frac{|x|}{x} = 2f_1'(x). \end{align} $$

spaceman
  • 796