Proving differentiability without using limit definition Question:
Let $f:(-2,2) \rightarrow \mathbb{R}$ be the function given by
\begin{equation}f(x)=\begin{cases} \sqrt{4-x^2}, & x \in (-2,0] \\ 2 & x \in (0,2) \end{cases}
\end{equation}
Prove that $f$ is differentiable on $(-2,2)$ and compute $f'(x)$ for each $x \in(-2,2)$.
Attempt:
Can I simply say in the first domain, $\sqrt{4-x^2}$ is a differentiable/continuous function so we can use chain rule to find the derivative at this domain??
And $2$ is a differentiable function any domain so we can just differentiate this to get $0$.
I find this question strange because it seems like you dont need to use the differentiable definition limit. Please can someone advise me.
 A: We do (sort of) need the definition of derivative to deal with differentiability at  at $x=0$.  So we want to show that 
$$\lim_{h\to 0} \frac{f(h)-f(0)}{h}$$
exists.
It is clear that the limit above exists and is equal to $0$, if $h$ approaches $0$ from the right So it remains to show that 
$$\frac{\sqrt{4-h^2}-2}{h}\to 0$$
as $h$ approaches $0$ from the left. To show that this is the case, multiply top and bottom by $\sqrt{4-h^2}+2$.
A: You can apply the usual rules for the derivative except at $0$, because in a suitable neighborhood of any point in $(-2,2)$ (except $0$), the function coincides with a function that is known to be differentiable.
At $0$ the situation is different, because we cannot say the function coincides with a function that is known to be differentiable in any neighborhood of $0$.
So you have to compute
$$
\lim_{x\to0}\frac{f(x)-f(0)}{x-0}
$$
for deciding whether $f$ is differentiable at $0$; in this particular case, you'll do separately the limits from the right and from the left.
One can also use a different limit, but one is necessary anyway. Here's an example.
Since $\lim_{x\to0-}f(x)=2=\lim_{x\to0^+}f(x)$, it's meaningful to ask oneself whether the function is differentiable at $0$. In order to do this we can use l'Hôpital's theorem.
Indeed, since we know the function is continuous at $0$, l'Hôpital's theorem says that if
$$
\lim_{x\to0}f'(x)
$$
exists, then this limit is equal to
$$
\lim_{x\to0}\frac{f(x)-f(0)}{x-0}
$$
because the derivative of the numerator and the denominator exist in a neighborhood of $0$ (excluding $0$) and both the numerator and the denominator have limit $0$ at $0$.
With the given function we have
$$
\lim_{x\to0^+}f'(x)=\lim_{x\to0}\frac{-x}{\sqrt{4-x^2}}=0,
\qquad
\lim_{x\to0^-}f'(x)=\lim_{x\to0}0=0,
$$
so we can conclude that $f'(0)=0$.

Be careful in applying this:


*

*continuity at $a$ is necessary for the existence of the derivative at $a$;

*granted continuity at $a$, the existence of the limit of the derivative at $a$ is sufficient for the existence of the derivative at $a$.
The classical example is
$$
f(x)=\begin{cases}
x^2\sin\dfrac{1}{x} & \text{for $x\ne0$}\\[3px]
0 & \text{for $x=0$}
\end{cases}
$$
This function is continuous at $0$ because it's even differentiable:
$$
\lim_{x\to0}\frac{f(x)-f(0)}{x-0}=\lim_{x\to0}x\sin\frac{1}{x}=0.
$$
However
$$
\lim_{x\to0}f'(x)=
\lim_{x\to0}\left(2x\sin\frac{1}{x}-\cos\frac{1}{x}\right)
$$
doesn't exist.
There's nothing really strange here: the derivative $f'$ is everywhere defined, but it happens to not be continuous at $0$.
A: You have that: $$f'(0^{+}) = \displaystyle \lim_{x\to 0^{+}} \dfrac{f(x)-f(0)}{x-0} = \displaystyle \lim_{x\to 0^{+}} \dfrac{2-2}{x} = 0 $$, and $$\displaystyle \lim_{x\to 0^{-}} \dfrac{f(x)-f(0)}{x-0}= \displaystyle \lim_{x\to 0^{-}} \dfrac{\sqrt{4-x^2}-2}{x}=\displaystyle \lim_{x\to 0^{-}} \dfrac{-x}{\sqrt{4-x^2}+2}=0=f'(0^{-})\Rightarrow f'(0) = 0$$. Thus $f$ is differentiable at $x= 0$.
