Use the definition of the derivative to differentiate $e^{-1/x^2}$ Let $f(x)=e^{-1/x^2}$, $x \not=0$. Without using the chain rule, find $f'(x)$. This is an easy problem using the chain rule, however, I am curious to see how one might do it with the definition of the derivative:
$$
\lim_{x\to c} \frac{f(x)-f(c)}{x-c}=\frac{e^{-1/x^2}-e^{-1/c^2}}{x-c},
$$
and
$$
\lim_{h\to 0} \frac{f(x+h)-f(x)}{h}=
\lim_{h\to 0} \frac{e^{-1/(x+h)^2}-e^{-1/x^2}}{h}.
$$
 A: $$\begin{align*}
\frac{d}{dx} e^{-\frac1{x^2}} &= \lim_{h\to0} \frac{e^{-\frac1{(x+h)^2}} - e^{-\frac1{x^2}}}{h} \\[1ex]
&= \lim_{h\to0} \frac{e^{-\frac1{(x+h)^2}} - e^{-\frac1{x^2}}}{-\frac1{(x+h)^2} - \left(-\frac1{x^2}\right)} \times \lim_{h\to0} \frac{-\frac1{(x+h)^2} - \left(-\frac1{x^2}\right)}{h} \\[1ex]
&= -\frac2{x^3} \lim_{h\to0} \frac{e^{-\frac1{(x+h)^2}} - e^{-\frac1{x^2}}}{\frac1{(x+h)^2} - \frac1{x^2}} \\[1ex]
&= -\frac2{x^3} \lim_{H\to0} \frac{e^{-H-\frac1{x^2}} - e^{-\frac1{x^2}}}{H} & H=\frac1{(x+h)^2}-\frac1{x^2} \\[1ex]
&= -\frac2{x^3} e^{-\frac1{x^2}} \lim_{H\to0} \frac{e^{-H} - 1}{H} \\[1ex]
&= \boxed{\frac2{x^3} e^{-\frac1{x^2}}} \lim_{\eta\to0} \frac{e^\eta-1}\eta & \eta=-H
\end{align*}$$
The remaining limit is $1$ as it's the derivative of $e^x$ at $x=0$.
A: The formula for the derivative, $\frac{2}{x^3}e^{-1/x^2}$, is only valid for $x\neq 0$, since the function $e^{-1/x^2}$ is not even defined at $0$. However, if we define
$$
f(x)=
\begin{cases}
e^{-1/x^2} & x\neq0\\
0 & x= 0\\
\end{cases}
$$
then we can evaluate the derivative of $f$ at $0$ using the definition of the derivative by
$$
f'(0)=\lim_{x\to 0}\frac{f(x)-f(0)}{x-0}=\lim_{x\to 0}\frac{e^{-1/x^2}}{x}=0.
$$
