Find a and b such that the following piecewise function is differentiable at x = 0:
\begin{equation*} f(x) = \left\{ \begin{array}{ll} ax - b & \quad x \leq 0 \\ sin(2x) - x^2cos(2/x) & \quad x > 0 \end{array} \right. \end{equation*}
Using the continuity criteria at $ x = 0$ , we can easily find that $ b = 0 $. But when we set the derivatives at $x = 0$ equal to each other, we get this:
a = $ 2cos(2x) $ - $ 2xcos(2/x)$ - $ 2sin(2/x) $
How do we find a I wonder?
$a = \lim \limits_{h \to 0^+} \dfrac {f(0+h) - f(0)}{h}$
$ = \lim \limits_{h \to 0^+} \dfrac { \sin (2h) - h^2 \cos (2/h) - [f(0)=0]} {h}$
Evaluating this limit, you get $a = 2$