[Math] Prove that a function is differentiable at a point

calculusderivativeslimits

At which values of $x$ is $f(x)$ differentiable?

$f(x) =
\begin{cases}
1-e^{-x}, & \text{$x \gt 0$} \\
\ln(1-x), & \text{$x\le 0$}
\end{cases}$

I first proved that $f(x)$ is continuous for every $x$:

$$
\lim_{x \to 0^+}f(x) = 1-e^{-0} = 0
$$

$$
\lim_{x \to 0^-}f(x) = \ln(1-x) = 0
$$

and $f(0) = 0$, is this OK? was that necessary when proving that a function is differentiable at a point?

Next, I wanna prove the limit using the definition of derivative, so:

$$
\lim_{x\to0^+} \frac{f(x)-f(0)}{x-0} = \frac{1-e^{-x}-(1-e^0)}{x} = \frac{-e^{-x}+e^0}{x}
$$

$$
\lim_{x\to0^-} \frac{f(x)-f(0)}{x-0} = \frac{\ln(1-x)-0}{x} = \frac{\ln(1-x)}{x}
$$

How do I continue from here? I'm stuck at both sides, some help please?:)

Thanks!

Best Answer

Your work is correct. Notice that the limit on the right and on the left are the derivative of $1-e^{-x}$ and $\ln(1-x)$ respectively at $0$ so you need to verify that they are equal.