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$?

  • 25
    $\begingroup$ Take the second anti-derivative of the Weierstrass function. $\endgroup$
    – user1337
    Commented Jan 27, 2014 at 22:58
  • 7
    $\begingroup$ re edit: Please ask separate questions as... well, separate questions. $\endgroup$ Commented Jan 28, 2014 at 0:39
  • 1
    $\begingroup$ Briefly, if you replace x by z, you have to extend the function to the complex plane, or at least to some open set in the plane. But no matter how you extend the function, it won't be complex-differentiable. Otherwise, the functions you see below are infinitely real-differentiable. For example, if $f(z) = z^3$ for $Re z \geq 0$ and $f(z) = -z^3$ otherwise, then $f(z)$ is not complex-differentiable. The piece-wise break occurs along the imaginary axis, and the calculation that worked for $x = 0$ below doesn't work for nonzero values along the axis. You really should ask a separate question! $\endgroup$ Commented Jan 28, 2014 at 5:23
  • 1
    $\begingroup$ In the complex case, if $\exists f'$ in some open subset then $\forall n\in{\Bbb N}\ \exists f^{(n)}$. In one point the same situation that in the real case is possible. $\endgroup$ Commented Jan 28, 2014 at 9:38

7 Answers 7


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.

  • 8
    $\begingroup$ A good general procedure to produce what was asked for. $\endgroup$ Commented Jan 28, 2014 at 5:28
  • 9
    $\begingroup$ You probably want "integrable discontinuous function" here. $\endgroup$ Commented Jan 28, 2014 at 5:48

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

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

  • 1
    $\begingroup$ Darn it, you got to it just seconds before me. :( $\endgroup$
    – 2012ssohn
    Commented Jan 27, 2014 at 23:05
  • 1
    $\begingroup$ yeah, hadn't seen your post! $\endgroup$
    – JPi
    Commented Jan 27, 2014 at 23:10
  • 3
    $\begingroup$ Well, never mind then $\endgroup$
    – qwr
    Commented Jan 28, 2014 at 4:33
  • $\begingroup$ @LokiClock It's not differentiable at $f'''(x)$, because both sides aren't equal. $\endgroup$
    – qwr
    Commented Jan 28, 2014 at 5:28
  • 14
    $\begingroup$ Note that this can be written $f(x)=|x|x^2$; the function $x\mapsto|x|$ is a classic non-differentiable (at $0$) function, and multiplying it by $x^2$ pushes the non-differentiability two steps up by multiplying by$~0$ the problematic derivative at $x=0$ for the first two derivatives. Note that as a complex function $z\mapsto|z|$ is nowhere differentiable, so this won't work there. $\endgroup$ Commented Jan 28, 2014 at 9:32

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$.

  • $\begingroup$ Ok that makes sense, but if we replace $x->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? $\endgroup$
    – Augmented
    Commented Jan 27, 2014 at 23:08
  • 2
    $\begingroup$ @Augmented: How would you replace $x$ with $z$ exactly? For example, what would it mean for a complex number $z$ to be greater than zero or less than zero? The point is that a given function on the real line can be extended to the complex plane in an infinitude of ways. Functions $\mathbb{R} \to \mathbb{R}$ are different objects as functions $\mathbb{C} \to \mathbb{C}$. For example, $f(x) = x^2$ refers to two completely different functions if we specify domain $\mathbb{R}$ versus $\mathbb{C}$. And of course, not all functions are defined by formulas. $\endgroup$ Commented Jan 27, 2014 at 23:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .