Let $a, b \in \mathbb{R}$. Consider the function $f$ defined by $$ f(x)=\left\{\begin{array}{ll} e^{-\frac{1}{x}}+\sqrt{1+2x}\ \ &\mbox{ if }\ \ x>0,\\ a\ \ &\mbox{ if }\ \ x=0,\\ b\sin(x)+1\ \ &\mbox{ if }\ \ x<0. \end{array} \right. $$
$1)$ Determine the value of $a$ so that $f$ is continuous at $x=0$. ($a=1$)
$2)$ For this value of $a$, determine $b$ so that $f$ is differentiable at $x=0$.
I want to ask, is there a problem with this exercise? More precisely part 2, because I think one cannot find $b$.
Clearly, $a=1$ is the answer to part $1)$. For part $2$, we have
$$f'(x)= \begin{cases} \frac{e^{-1/x}}{x^2}+\frac{1}{\sqrt{2 x+1}} & x> 0 \\ b \cos(x) & x<0 \end{cases}$$
What we want is these two directions to connect at $x=0$. We have that
$$\lim_{x\to 0^+}f'(x)=1$$
$$\lim_{x\to 0^-}f'(x)=b$$
Thus, if we set $b=1$ then
$$\lim_{x\to 0}f'(x)=1$$
and we are done.