# Differentiability of piecewise function at breakpoint

Problem

Show whether or not the function

$$f(x) = \begin{cases} \frac{1-\cos(x)}{x} & x > 0 \\ x^2 & x \leq 0 \\ \end{cases}$$

is differentiable at $x=0$.

My progress

I'm going by the definition of point-differentiability I found on Wikipedia, thus I need to show that it is continuous at $x=0$, and that $f'(0)$ exists.

I've been able to show that it is continuous, because the left and right limits exist, and are equal to $f(0)$.

But how can I show that $f'(0)$ exists (or not)? My idea is that this is pretty trivial because $\frac{\mathrm d}{\mathrm dx}x^2 = 2x$ which evaluates just fine at $x=0$. So I conclude that the function is differentiable at $x=0$.

Question

Does this hold? Or am I possibly overlooking something?

• Show that both one-sided derivatives exist and are equal at $x = 0$. – user307169 Sep 26 '16 at 16:38
• you need to make sure the other branch gets you a similar result... one ofthe ways to think about derivatives that $$f'(x) = \lim_{\delta \to 0} \frac{f(x+\delta) - f(x-\delta)}{2\delta}...$$ – gt6989b Sep 26 '16 at 16:39

A function. $f$ is differentiable at $x=0$ if

$$\lim_{h \rightarrow 0} \dfrac{f(0+h) - f(0)}{h}$$

exists. Now, for given $f(x)$, $$\lim_{h \rightarrow 0} \dfrac{\frac{1-cos(h)}{h} - 0^2}{h}=\lim_{h \rightarrow 0} \dfrac{1-cos(h)}{h^2}= \lim_{h \rightarrow 0} \dfrac{1-cos(h)}{h}\lim_{h \rightarrow 0}\frac{1}{h}=\lim_{h \rightarrow 0}\frac{1}{h}$$ This limit does not exists so $f'(0)$ does not exist.

You might be overthinking this.

A function. $f$ is differentiable at $x=0$ if

$$\lim_{h \rightarrow 0} \dfrac{f(0+h) - f(0)}{h}$$

exists. Perhaps consider the left and right hand limits. Are they equal? What can you conclude if they are not?

As I mentioned in my comment, show that both one-sided derivatives exist and are equal to each other at $x = 0$.

1. A limit exists if and only if both one-sided limits exist.
2. A derivative is a limit.
3. Therefore, the derivative exists if and only if both one-sided derivatives exist.
4. You already found that the derivative of $x^2$ at $x = 0$ is $0$. Now apply the fact in step 3 to (immediately) get that the left-hand derivative of $x^2$ at $x = 0$ is $0$.
5. Evaluate the derivative of $\dfrac{1-\cos x}x$ at $x = 0$. Let's call it $L$ (if it even exists at all - if it doesn't, then $f(x)$ is not differentiable at $x = 0$).
6. Apply the fact in step 3 to (immediately) get that the right-hand derivative of $\dfrac{1-\cos x}x$ is $L$.
7. Finally, $f(x)$ is differentiable at $x = 0$ if and only if $L = 0$.