# Counter example: Derivative value at a single point doesn't imply function monotony

I'm trying to come up with the example that value of derivative at a single point doesn't imply function monotony.

My idea is to come up with function that oscillates infinite many times around some point (0 for example) such as $\sin\frac{1}{x}$. On top of that, multiply by $x^3$ to squeeze it to 0, and also add $x$ to make overall increasing trend such that derivative at 0 is 1 ($>0$). It looks something like this $$g(x) = x + x^3\sin\frac{1}{x}$$

My main function looks like this: $$f(x) = \begin{cases} g(x) & x \neq 0 \\ 0 & x = 0 \end{cases}$$ This function $f(x)$ is defined and continuous everywhere, derivative of $g(x)$, $g'(x) = 1 + 3x^2\sin\frac{1}{x} - x\cos\frac{1}{x}$ is defined everywhere but at $x=0$.

Derivative of function $f(x)$ should be something like this: $$f'(x) =\begin{cases} g'(x) & x\neq 0 \\ 1 &x = 0.\end{cases}$$

Because $f(x)$ is continuous in 0-neighborhood, it is differentiable in 0-neighborhood, and $g'(x)$ has limit at 0 which is 1, we can deduce that $f(x)$ is also differentiable at 0 and it's derivative there is equal to 1.

Now, i'm having trouble showing that this is not monotonic in any 0-neighborhood that we pick (assuming that my previous work is correct at all :D)

• Then don't make it so complicated. Just take $f(x)=x$ but change the values at $x=1/n$, for $n=1,2,3,..$ to be a bit larger, say $f(1/n)=1/n+1/n^2$. – orole Feb 11 '18 at 16:37
• If everything works the way you intended, then for any neighborhood of $0$, you can find a tiny interval (contained in the neighborhood) such that $g'$ is negative in that interval. – Jeppe Stig Nielsen Feb 11 '18 at 16:44
• It is because $f''(0)$, the second derivative does not exist. – hamam_Abdallah Feb 11 '18 at 16:58

Your idea is fine, but the factor $x^3$ was just too much. Try $$g(x):=x+2 x^2\sin {1\over x}\ .$$ Then $$g'(x)=1+4x\sin{1\over x}-2\cos{1\over x}$$ takes both signs in intervals arbitrarily close to $0$.
• Correction suggested: $g'$ takes both $+$ and $-$ values in every nbhd of $0$ ................+1 – DanielWainfleet Feb 11 '18 at 18:54