# Is a monotone differentiable function continuously differentiable?

If $f:\mathbb{R}^+\to\mathbb{R}$ is monotonic and differentiable, does it follow that $f$ is continuously differentiable?

(This question arose from discussion here: problem on continuous and differentiable function)

Let $f(x)=x|x|(\sin(1/x))+2x|x|+2x$. Then:

• For $x > 0$, $f'(x)=2x \sin(1/x)-\cos(1/x)+4x+2=2x(\sin (1/x)+2)+2-\cos(1/x)$, which is positive for $x>0$.
• For $x < 0$, $f'(x)=-2x \sin(1/x)+\cos(1/x)-4x+2 =-2x(\sin (1/x) + 2) + 2 + \cos(1/x)$, which is positive for $x<0$.
• We can evaluate $f'(0)$ directly: $$f'(0)=\lim_{x \to 0} \frac{f(x)}{x}=\lim_{x \to 0} \left(|x|\sin (1/x) + 2|x| + 2\right)=2 \, .$$

So $f$ is everywhere differentiable with positive derivative; thus it is monotone. But $f'$ is discontinuous at $0$.

• But the function needs to have domain $\mathbb{R}^+$ – mez Jan 24 '13 at 17:13
• @mezhang Can't everything just be shifted right? – user7530 Jan 24 '13 at 17:15
• well, $f$ is not defined at zero, however it can be continuously extended at this point – Masacroso Apr 16 at 10:54

$g(x)=x^2\sin(1/x)$, $x\neq 0$, $g(0)=0$, is a function differentiable everywhere on $\mathbb R$ with discontinuous derivative at $0$. It isn't monotone yet.

Since $|g'(x)|\leq 2|x|+1$ for all $x$, we can add a function like $x^3+4x$ to make the derivative always positive, because $3x^2+4+g'(x)\geq 3x^2+4-|g'(x)|\geq 3x^2+4-2|x|-1\geq\begin{cases} 3x^2+1>0, & \text{if$|x|\leq1$} \\ x^2+3>0, & \text{if$|x|\geq 1$} \\ \end{cases}.$

Thus $f(x) = x^2\sin(1/x)+x^3+4x$ is everywhere differentiable, increasing, with discontinuous derivative at $0$.

Alternatively, we could start with an example that has everywhere bounded derivative discontinuous at $0$, like $h(x)=e^{-x^2}x^2\sin(1/x)$, and then we only need to add a term $cx$, where $c>0$ is an upper bound for the absolute value of the derivative of $h$ ($c=2$ suffices I think).

or every $x\in (-1,1).$ Define, $$f(x) =100000+ 100x+ x^2\sin\frac{1}{x} \qquad\text{with f(0)=100000}$$ which is differentiable, and $$f'(x) = 100+ 2x\sin\frac{1}{x}-\cos\frac{1}{x} \qquad\text{with f'(0)=100}$$ $f'$ is not continuous a $x=0$. Also $f'\ge 0$ indeed, $$f'(x)=100+2x\sin\frac{1}{x}-\cos\frac{1}{x} \ge 100+ 2x\sin\frac{1}{x}-1$$

Since $|\sin a| \le |a|$ and $-1\le-\cos a\le 1$ then $|2x\sin\frac{1}{x}|\le 2$ i.e $$2x\sin\frac{1}{x}\ge -2$$

therefore

$$f'(x)=100+2x\sin\frac{1}{x}-\cos\frac{1}{x} \ge 100-2-1= 97>0$$ for every $x\in \mathbb R$. so $f$ is increasing and $f'$ is not continuous at $x=0$.

Also $|x^2\sin\frac{1}{x}|\le 1$ for all $x\in (-1,1)$ so that $$f(x) =100000+ 100x+ x^2\sin\frac{1}{x} > 100000-100 -1 >0$$ for every $x\in (-1,1).$