If $f$ is the function defined by $$f(x)=\begin{cases}xe^{-x^2-x^{-2}}&\text{if $x\neq0$},\\0&\text{if $x=0$},\end{cases}$$ at how many values of $x$ does the graph of $f$ have a horizontal tangent line?
(A) None. (B) One. (C) Two. (D) Three. (E) Four.
By solving the derivative of the function we get two solutions. But do we prove that the third solution is at $x=0$?
The answer is (D).
Use the limit definition of derivative.
$f'(0)=\lim\limits_{x\to0}\dfrac{f(x)-f(0)}{x-0}=\lim\limits_{x\to0}\dfrac{xe^{-x^2-x^{-2}}}{x}=\lim\limits_{x\to0}\dfrac1{e^{x^2+\frac1{x^2}}}$.
Notice that $\frac1{x^2}\to\infty$ as $x\to0$, hence $e^{x^2+\frac1{x^2}}\to\infty$ and $\dfrac1{e^{x^2+\frac1{x^2}}}\to0$.
Thus $f'(0)=\lim\limits_{x\to0}\dfrac1{e^{x^2+\frac1{x^2}}}=0$ and $f$ does indeed have a horizontal tangent line at $(0,0)$.