Differentiability and continuity of a piecewise function. Consider
$$f(x) = \left\{
\begin{array}{l l}
0 & \quad \text{if $x=0$}\\
\frac{1-\cos 2x}{x} & \quad \text{otherwise}
\end{array} \right.$$
Which of the following is true?
1.$f$ is continuous
2.$f$ is differentiable
3.$f$ is continuously differentiable
 A: *

*Yes, and easy to check.

*Yes, also easy to check.

*Yes also. To see this part:


$f'(0) = \displaystyle \lim_{x \to 0} \dfrac{f(x) - f(0)}{x} = \displaystyle \lim_{x \to 0} \dfrac{1-cos(2x)}{x^2} = \displaystyle \lim_{x \to 0} 2\dfrac{sin^2x}{x^2} = 2$,
and $f'(x) = 4\cdot \dfrac{sin(2x)}{2x} - \dfrac{1-cos(2x)}{x^2}$ for $x \neq 0$.
Using L'hopital rule we can check that $f'(0) = 2 = \displaystyle \lim_{x \to 0} f'(x)$. Thus $f'(x)$ is continuous at $x = 0$, and hence continuously differentiable.
A: Now you need to check the continuity at $x=0$. Given $\epsilon \gt 0$, if there exists a $\delta \gt 0$ such that $|x| \lt \delta$ $$\implies |\frac{1-cos2x}{x}|=|\frac{2sin^2x}{x}| \le|\frac{2x^2}{x}|=|2x| \lt 2\delta=\epsilon$$  S0 for $$\delta = \frac{\epsilon}{2}$$ , we have $|f(x)-f(0)| \lt \epsilon$, and hence as per our definiton $f$ is continuos.
For differentiabilty $$\lim_{h\to 0}\frac{1-cos2h}{h^2}=\lim_{h\to 0}\frac{2sin^2h}{h^2}=2$$.
Hence $F$ is differentiable at $x=0$.
From here you can see the (iii) I hope
