# Given this piecewise-defined function $f$, prove that $f$ is differentiable at $0$, but $f'$ isn't

Prove $f$ is differentiable at $0$, but $f'$ isn't. $$f(x)=\begin{cases} x^2 & \text{if }x>0,\\ x^3 & \text{if }x\leq 0. \end{cases}$$

The derivative at a point is equal to the limit as it approaches that point, right? For $$x^2$$ I got $$2x.$$ And for $$x^3$$ I got $$3x^2.$$ I then differentiated the derivatives of each at zero and got $$2$$ and $$6x$$

• ...please... ? What have you tried/done so far? Jun 3, 2013 at 22:51
• Hint: What are the derivatives at $x\neq0$? Jun 3, 2013 at 22:52
• You need to find $f'_l(0)\neq f'_r(0)$
– user63181
Jun 3, 2013 at 22:53
• Hi @Rubbles welcome to MSE! Thanks for sharing your question with us! It is appropriate to tell us what have you tried and provide information. How it's a homework, you usually won't find resolutions, but hints or explanations, depending on your needs. So, lets go: do you how to differentiate it? Using limits? And about continuity? Jun 3, 2013 at 22:54
• The derivative at a point is equal to the limit as it approaches that point, right? For x^2 I got 2x. And for x^3 I got 3x^2. Jun 3, 2013 at 23:44

If you mean the limit of the derivative, then that is true if the limit exists. But sometimes the derivative exists at the point even though that limit does not. But you can go back to the definition of the derivative: $$f'(0)= \lim_{h\to0}\frac{f(0+h)-f(0)}{h} \begin{cases} = \lim_{h\downarrow0} \frac{h^2-0}{h} \\[10pt] = \lim_{h\uparrow 0} \frac{h^3-0}{h} \end{cases}$$ provided these are equal. And it's readily checked that both are $0$.
Doing something similar to find $f''$ answers the rest.
Recall that the derivative of a function at a point exists if and only if the left hand derivative and right hand derivative also both exist at that point and equal each other. Observe that: $$f'(x) = \begin{cases} 3x^2 &\text{if } x < 0\\ 2x &\text{if } x > 0\\ \end{cases}$$ Hence, the left hand derivative of $f$ at $x=0$ is $3(0)^2=0$, while the the right hand derivative of $f$ at $x=0$ is $2(0)=0$. Since these two values are the same, we know that $f'(0)$ exists and also equals $0$, so we know that $f$ is differentiable at $x=0$ (in fact for all $x \in \mathbb{R}$) so that: $$f'(x) = \begin{cases} 3x^2 &\text{if } x \le 0\\ 2x &\text{if } x > 0\\ \end{cases}$$
Likewise, observe that: $$f''(x) = \begin{cases} 6x &\text{if } x < 0\\ 2 &\text{if } x > 0\\ \end{cases}$$ Hence, the left hand second derivative of $f$ at $x=0$ is $6(0)=0$, while the the right hand second derivative of $f$ at $x=0$ is $2$. Since these two values are NOT the same, we know that $f''(0)$ does NOT exist. Thus, $f'$ is NOT differentiable at $x=0$.