[Math] How to check the differentiability of this function.

calculuscontinuityderivativeslimits

Question:

Let $\text{f(x) = max{1-x, 1+x, 2}}$. Prove that $f(x)$ is continuous at all points but not differentiable at $x = 1$ and $x = -1$.

Doubt:

I checked for the continuity of this function and successfully found it to be continuous at all points.

For differentiability, at $x=1$, I calculated the right and left hand derivative using: $$f'(a)=\lim_{h\to0}\frac{f(a\pm h)-f(a)}{\pm h}.$$

For $Rf'(1)$, the value of $f(1+h)$ will be $\text{1+1+h}$ as $\text{1+x}$ is the maximum in this case. On solving, I am getting $Rf'(1)=1$.

For $Lf'(1)$, the value of $f(1-h)$ will be $\text{2}$ as it is the maximum in this case. On solving, I am getting $Lf'(1)=\lim_{h\to0}\frac{2-2}{h}$.

The case is similar with $\text{-1}$.

But for $\text{x=0}$, I am getting both, Right and Left hand derivative similar to $\lim_{h\to0}\frac{2-2}{h}$. But according to question, the function is non-differentiable at only $\text{x=-1,1}$.

Kindly help.

Best Answer

At $x=0$ the right hand and left hand derivatives are both equal to $0$, since $f(x)$ is identically equal to $2$ in a neighborhood of $x=0$. So the function is differentiable with derivative $0$ at $x=0$.

Edit: A more explicit calculation

By definition, $f'(0)$ exists if and only if $$ \lim_{h\to0}\frac{f(h)-f(0)}{h} $$ exists. In the case that the above limit does exist, that is exactly the derivative of $f$ at $x=0$.

Now note that we are taking $h$ to zero; in particular, we can assume that $|h|<\frac{1}{2}$. In this case, it is easy to see $1+h<2$ and $1-h<2$, so we will have $f(h)=2$ by the definition of $f$. Thus we have $$ f'(0)=\lim_{h\to0}\frac{f(h)-f(0)}{h}=\lim_{h\to0}\frac{2-2}{h}=\lim_{h\to0}\frac{0}{h}=0 $$

Related Question