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

-
Take the second anti-derivative of the Weierstrass function. – user1337 Jan 27 '14 at 22:58
re edit: Please ask separate questions as... well, separate questions. – Colonel Thirty Two Jan 28 '14 at 0:39
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! – Hugh Denoncourt Jan 28 '14 at 5:23
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. – Martín-Blas Pérez Pinilla Jan 28 '14 at 9:38

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.

-
A good general procedure to produce what was asked for. – Ross Millikan Jan 28 '14 at 5:28
You probably want "integrable discontinuous function" here. – Pete L. Clark Jan 28 '14 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.

-
Darn it, you got to it just seconds before me. :( – 2012ssohn Jan 27 '14 at 23:05
yeah, hadn't seen your post! – JPi Jan 27 '14 at 23:10
Well, never mind then – qwr Jan 28 '14 at 4:33
@LokiClock It's not differentiable at $f'''(x)$, because both sides aren't equal. – qwr Jan 28 '14 at 5:28
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. – Marc van Leeuwen Jan 28 '14 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.

-

e.g.

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

Examples:

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

-
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? – Augmented Jan 27 '14 at 23:08
@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. – Jesse Madnick Jan 27 '14 at 23:20

## protected by Willie WongJan 30 '14 at 8:06

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).