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?
 A: EDIT: Wrong Answer
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.
A: 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?
A: As I mentioned in my comment, show that both one-sided derivatives exist and are equal to each other at $x = 0$.


*

*A limit exists if and only if both one-sided limits exist.

*A derivative is a limit.

*Therefore, the derivative exists if and only if both one-sided derivatives exist.

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

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

*Apply the fact in step 3 to (immediately) get that the right-hand derivative of $\dfrac{1-\cos x}x$ is $L$.

*Finally, $f(x)$ is differentiable at $x = 0$ if and only if $L = 0$.

