Prove that a function is differentiable at a point

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!

Using the fact that, $\lim_{x\to0}\dfrac{a^x-1}{x}=\log_ea$ (check out when $(a = e)$!)

Limit-1:

$\lim_{x\to0^+}\dfrac{-e^{-x}+e^0}{x}=\lim_{x\to0^+}\dfrac{1-e^{-x}}{x}=\lim_{x\to0^+}\dfrac{e^{-x}-1}{-x}=1$

Limit-2

$\lim_{x\to0^-}\dfrac{\ln(1-x)}{x}$ , (put $ln(1-x)=t$ so that when $x\to0^-$ gives $t\to 0^+$)

Simplifying expression in terms of $t$

$\lim_{t\to0^+}\dfrac{t}{1-e^t}=\lim_{t\to0^+}\dfrac{1}{\dfrac{1-e^t}{t}}=\dfrac{-1}{\lim_{t\to0^+}\left(\dfrac{e^t-1}{t}\right)}=-1$

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.

• can you tell me how to continue to evaluate the expression in the definition of derivative? – FigureItOut Dec 29 '14 at 18:27
• You can use the L'Hôpital's rule. – user63181 Dec 29 '14 at 18:29
• You don't need LHR here, because of what you pointed out Sami, that these are the definitions of the left- and right- derivatives: $\dfrac {f(x) - f(c)}{x - c} \ \text{as} \ x \to c^{\pm}$ – GFauxPas Dec 29 '14 at 20:52
• @Sami Could you do me a favor and upvote this, if you haven't already. I've received two downvotes to enable auto deletion. – Namaste Dec 31 '14 at 14:53

Note that you have an error: by definition, $f(0)=\ln(1-0)=0$, and that happens on both "sides" of zero. So,

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

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

In the first limit, note the numerator tends to $0$ and the denominator to $0$, so we can use L'Hôpital's Rule: $$(1)\qquad\lim_{x\to0^+}\frac{1-e^{-x}}{x}\overbrace{=}^{\text{LHR}}\lim_{x\to0^+}\frac{e^{-x}}{1}=1$$ For the second limit, note that is of the form $\frac{0}{0}$, so we use L'Hôpital's Rule: $$(2)\qquad \lim_{x\to0^-}\frac{\ln(1-x)}{x}\overbrace{=}^{\text{LHR}}\lim_{x\to0^-}\frac{-\frac{1}{1-x}}{1}=\lim_{x\to0^-}\frac{1}{x-1}=\frac{1}{0-1}=-1$$

Both limits are different, so $f(x)$ is not differentiable at $x=0$.

• You can't use LHR on $\dfrac {-e^{-x}}{x} \ \text{as} \ x \to 0^+$. Equation $(1)$ is wrong. – GFauxPas Dec 29 '14 at 20:45
• Oh, you're right! Editing my answer now – cjferes Dec 30 '14 at 19:52
• Edited! can you review the answer, and if it's correct, remove the downvote? thanks – cjferes Dec 30 '14 at 19:54
• I'm afraid you still have $1 - e^{-x} = -e^{-x}$ in $(1)$. – GFauxPas Dec 30 '14 at 21:27
• haha, didn't see it. Thanks for the corrections! – cjferes Dec 30 '14 at 21:59