# Proving a function is continuous and differentiable at $0$.

The question I have been asked is:

Let $f$ be the function defined by:

$f(x)=\begin{cases}\ e^{-\frac{1}{x}} & x>0\\ 0 & x \leq 0\\ \end{cases}$

Show that $f$ is continuous at 0 and differentiable at $0$, and also compute the derivative $f '(0)$. (Hint: you may use, without proof, the fact that $\frac{e^{-\frac{1}{x}}}{x^n}\to 0$ as $x → 0$ for any $n ∈ \Bbb{N}$.)

Any help provided would be greatly appreciated. I have a solution but it is very poorly worded, looking for a simpler and more understandable explanation.

Thanks

• Can we assume that $\exp(a)$ is continuous? – Holo Jan 2 '18 at 15:06
• That's not been stated, so no I don think so in this case. – JonnyWhite13 Jan 2 '18 at 15:07
• oh, I didn't saw what you can assume from the hint – Holo Jan 2 '18 at 15:15
• @JonnyWhite13 Please, if you are ok, you can accept the answer and set it as solved. Thanks! – gimusi Feb 2 '18 at 21:30

As $x\to0$, $\frac1x\to\infty$, hence $e^{-\frac1x}\to0$. So $f$ is continuous at $0$. Moreover by L'Hospital's rule $$\lim_{h\to0}\frac{e^{-\frac1h}-0}h=\lim_{h\to0}e^{-\frac1h}\frac1{h^2}=\lim_{x\to\infty}e^{-x}x^2=0$$ So $f'(0)$ exists.

compute the term $$\frac{f(0+h)-f(0)}{h}$$ and then compute the Limit $$\lim_{h\to 0}\frac{f(0+h)-f(0)}{h}$$ if this Limit exists

• in this instance what is 'h'? – JonnyWhite13 Jan 2 '18 at 15:06
• a variable not a constant – Dr. Sonnhard Graubner Jan 2 '18 at 15:08
• So, as f approaches 0 from the left h is always 0, by the definition. – JonnyWhite13 Jan 2 '18 at 15:10
• And as f approaches 0 from the right its limit is also 0, so, as the limits agree it is differentiable? – JonnyWhite13 Jan 2 '18 at 15:11
• but the question is for $x=0$ – Dr. Sonnhard Graubner Jan 2 '18 at 15:11

For the continuity you should verify that:

$$\lim_{x\to0} f(x)=f(x_0)$$

For the derivability that the following limits exist and are equals

$$\lim_{h\to0^+} \frac{f(0+h)-f(0)}{h}=\lim_{h\to0^-} \frac{f(0+h)-f(0)}{h}$$

Note: derivability $\implies$ continuity.

• What does your note mean? I'm a little confused, sorry. – JonnyWhite13 Jan 2 '18 at 15:13
• @JonnyWhite13 if you show that f is derivable it implies that f is also continuos, hence if the 2 limits exists you are done. Otherwise in generl you might have functions non derivable but continuos, in these cases you can verify continuity by the first limit (eg f(x)=|x|). – gimusi Jan 2 '18 at 15:16
• Gimusi. Allow a Bravo!! You mention right and left limits!! Most of the above colleagues check only one side. – Peter Szilas Jan 2 '18 at 15:39

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

Where we do the change of variables: $$t=\frac{1}{x} \to +\infty \text{ as } x \to 0^+$$

Also $\lim_{x \to 0^-} \frac{f(x)-f(0)}{x-0}=\lim_{x \to 0^-}\frac{0}{x}=0$

So both side limits exist at zero and are equal to zero thus $f$ is differentiable at zero thus continuous at zero and $f'(0)=0$

With a bit more work you can show that this function is infinitely differentiable at every point.

• Mariios. Possibly too pedantic. You nicely show that the right hand limit exists. The left hand limit is zero. Left hand limit = Right hand limit , hence differentiable at 0. As you know, y=|x| , right hand limit exists.Would a mention of the (trivial) left hand limit be in place? – Peter Szilas Jan 2 '18 at 15:35
• @PeterSzilas i thought it would be obvious that the left hand side limit is zero..but why not..?? i will edit my answer..thanks! – Marios Gretsas Jan 2 '18 at 15:37
• Mario's. It is , just put in a word or two, looks nicer, I feel. Nice answer. +1 – Peter Szilas Jan 2 '18 at 15:42
• @PeterSzilas i edited..now i think it is complete :) – Marios Gretsas Jan 2 '18 at 15:43
• Marios. Very nice! :)) – Peter Szilas Jan 2 '18 at 15:48