# If $\lim\limits_{x \to \pm\infty}f(x)=0$, does it imply that $\lim\limits_{x \to \pm\infty}f'(x)=0$?

Suppose $f:\mathbb{R} \rightarrow \mathbb{R}$ is everywhere differentiable and

1. $\lim_{x \to \infty}f(x)=\lim_{x \to -\infty}f(x)=0$,
2. there exists $c \in \mathbb{R}$ such that $f(c) \gt 0$.

Can we say anything about $\lim_{x \to \infty}f'(x)$ and $\lim_{x \to -\infty}f'(x)$?

I am tempted to say that $\lim_{x \to \infty}f'(x)$ = $\lim_{x \to -\infty}f'(x)=0$.

I started with the following, but I'm not sure this is the correct approach, $$\lim_{x \to \infty}f'(x)= \lim_{x \to \infty}\lim_{h \to 0}\frac{f(x+h)-f(x)}{h}.$$

No. Try $f(x)=\sin(x^a)/x$ for various values of $a$.

Key fact: on small scales, you can change the derivative of a function hugely without changing its values very much. I can introduce a tiny wiggle in a curve that is barely noticeable in size, but very sharp in derivative.

Throw in a few tiny wiggles arbitrarily far along a decaying function of your choice, and you'll get a fucntion which decays but whose derivative keeps spiking.

As a more concrete hint, consider a differentiable function $f$ such that $|f(x)| < 1$ for all $x$, and take $g(x) = \frac{1}{2}f(2x)$. Then $g(x)$ has $|g(y)| < \frac{1}{2}$ for all $y$, so $g$ takes smaller values than $f$, but $g'(z) = f'(2z)$, so the derivative of $g$ gets just as big as the derivative of $f$.

This shows how very small functions can nonetheless have very large derivatives.

To correct a incorrect attempt, let $f(x) = e^{-x^2} \cos(e^{x^4})$, so

\begin{align}f'(x) &= e^{-x^2} 4 x^3 e^{x^4}(-\sin(e^{x^3})) -2x e^{-x^2} \cos(e^{x^3})\\ &= -4 x^3 e^{x^4-x^2} \sin(e^{x^3}) -2x e^{-x^2} \cos(e^{x^3})\\ \end{align}

The $e^{x^4-x^2}$ term makes $f'(x)$ oscillate violently and unboundedly as $x \to \pm \infty$.