What function can be differentiated twice, but not 3 times?

In complex analysis class professor said that in complex analysis if a function is differentiable once, it can be differentiated infinite number of times. In real analysis there are cases where a function can be differentiated twice, but not 3 times.

Do anyone have idea what he had in mind? I mean specific example where function can be differentiated two times but not three?

EDIT. Thank you for answers!
but if we replace $x\to z$ and treat it as a complex function. Why are we not getting in the same problem? Why according to my professor it is still differentiable at $0$?

Solutions Collecting From Web of "What function can be differentiated twice, but not 3 times?"

What function cannot be differentiated $3$ times?

Take an integrable discontinuous function (such as the sign function), and integrate it three times. Its first integral is the absolute value function, which is continuous: as are all of its other integrals.

$f(x) =\begin{cases}
x^3, & \text{if $x\ge 0$} \\
-x^3, & \text{if $x \lt 0$} \\

The first and second derivatives equal $0$ when $x=0$, but the third derivative results in different slopes.

Functions of the form $$f(x) = x^{\alpha} \sin \left(\frac{1}{x^{\beta}}\right)$$

and $f(0) = 0$ are very useful for finding examples of functions which have various (dis)-continuities and singularities at $0$. I’ll leave it to you to arrange the powers appropriately to get a function that’s differentiable exactly twice.

These are nice to study since the oscillation of the sine terms can be partially damped by the polynomial term at the beginning – but when differentiating, the oscillations are “increased” while the damping disappears.

Alternatively, choose a function that’s not differentiable at a given point (or collection of points) and take some antiderivatives of it.


$$f(x)=\begin{cases} 0, & x<0, \\
x^3, & x\geq 0.\end{cases}$$

Idea. Take a continuous and not differentiable function and integrate it twice. Then you get such a function.


  1. $f(x)=|x|^a$, where $a\in[3,4)$.

  2. $f(x)=\max\{0,x^3\}$.

  3. $f(x)=x^a\sin x^{-b}$, for $x\ne 0$, and $f(0)=0$, where $3b+3>a>2b+2$.

The differentiability condition in complex analysis is much stronger than that in real analysis, because it requires that the limit
$$\lim_{\substack{h\in\mathbf C\setminus\{0\}\\h\to0}}\frac{f(z+h)-f(z)}{h}$$
is uniquely defined, that is, if you consider a continuous path $\eta:t\mapsto
\eta(t)\in\mathbf C\setminus\{0\}$, where $t\in]0,1]$ such that $\lim_{t\to0}\eta(t)=0$ the limit
$$\lim_{t\to0}\frac{f(z+\eta(t))-f(z)}{\eta(t)}$$ is the same whatever $\eta$ is.
The function $\varphi:z\mapsto\frac{\Re\mathrm e(z)}{1+\|z\|^2}$ for instance, is not differentiable at $z=0$ because if you take $\eta(t)=t\mathrm e^{\mathrm i\alpha}$ the limit is $\mathrm e^{-\mathrm i\alpha}\cos\alpha$ and therefore depends on $\alpha$. But if you restrict this function on $\mathbf R$, $\varphi:x\mapsto x/(1+x^2)$ is infinitely differentiable.

The differentiability conditions for complex functions are called Cauchy-Riemann conditions and a complex function differentiable at every point is called holomorphic.
Cauchy demonstrated that every holomorphic function is analytic, that is it can be differentiated infinitely many times. The Cauchy-Riemann conditions are so strong that they imply infinite differentiability.
Cauchy’s demonstration is based on the Cauchy integral. You can find it here in the Wikipedia.

How about $\displaystyle f(x) = \frac{x^3}{6}$ if $x \ge 0$, $\displaystyle -\frac{x^3}{6}$ otherwise?

It can be differentiated once to form $\displaystyle f'(x) = \frac{x^2}{2}$ if $x \ge 0$, $\displaystyle -\frac{x^2}{2}$ otherwise.

Differentiating it again, we get $\displaystyle f”(x) = x$ if $x \ge 0$, $-x$ otherwise. (This is equivalent to $f”(x) = |x|$.)

When we try a third time, though, we see that it’s not differentiable at $x = 0$.