# Only once differentiable

Is there any example of a real function that is one-time-only differentiable, meaning there is $f'(x)$, but no $f''(x)$? I haven't been able to find any example... Of course it would be preferred if f had a closed-form expression and if it wasn't an integral.

Answers on the proposed as duplicate are not quite my case, because in the other post the answer proposed does have a second derivative, just not at 0. I would like the second derivative to exist at no point.

• Duplicated question: see math.stackexchange.com/questions/78825/… – Asydot Aug 30 '15 at 14:06
• If you are happy with examples where $f''(x)$ doesn't exist at finitely many points, explicit examples are easy to give. If you want $f''(x)$ to exist at no point, examples are harder to come by. – Daniel Fischer Aug 30 '15 at 14:06
• @DanielFischer I would prefer the case where $f''(x)$ exists at no point... – Jason Aug 30 '15 at 14:20
• @Asydot Edited to reflect that it is not a duplicate. – Jason Aug 30 '15 at 14:27

Consider the Weierstrass function (https://en.wikipedia.org/wiki/Weierstrass_function); call that $f$. Define $$F(x) = \int_0^x f(t) ~dt$$ Then $F$ is once differentiable everywhere, but twice differentiable nowhere.

I know that this includes an integral, but to be honest, it's hard to avoid that, at least if you want the derivative of your function to not only exist, but be continuous. (It doesn't have to be continuous, but writing down a function where it isn't is probably even messier...and I'm certainly not going to attempt it.)

Any function that's continuously-differentiable everywhere is expressible as an integral. And the integrand in that case, for any function that's everywhere not-twice-differentiable, must be a function that's continuous everywhere but differentiable nowhere ... and the Weierstrass function is the classic example of such a function.

Indeed, if you look carefully at that function's construction, you'll see why it's so tough to create such a thing, and recognize that this is pretty much "the easy case", believe it or not.

Looking back at the definition of the W-function, it's written as a series...which we can integrate term by term. So I guess my revised answer is this, using the Weierstrass function with $a = 9/10$ and $b = 7$, and eliminating an irrelevant factor of $\pi$:

Let $$G(x) = \sum_{n=0}^\infty \frac{9^n}{10^n 7^n} \sin(7^n \pi x)$$

Then $G$ is continuous and everywhere differentiable, but nowhere twice-differentiable.

Of course, proving that $G$ is once-but-not-twice differentiable is still pretty tough ... but at least you've got a concrete answer to your question. If you read Spivak's Calculus, you can work through a very nice exposition of the Weierstrass function in one of the later chapters, and you'll be able to do the requisite proof when you're finished with that chapter.

Final Informal Remarks

Why isn't there a "simple expression" for such a function, without integrals, or infinite sums? Well, a "simple expression" (in my mind) has only finitely many operations (addition, subtraction, composition, etc.), and the building blocks we like to use are generally continuous and non-constant, and mostly (aside from $x \mapsto |x|$) differentiable. So while you can get a function that's not differentiable at a countable set of points via something like $x \mapsto |sin(x)|$, in general such "simple expressions" will be non-differentiable on a tiny set. I suppose that with the right tools and energy you could formulate some kind of proof that finite combinations of a particular set of "basic" functions lead to non-differentiability on at most a set of measure zero. Of course, once you allow "cases" functions (like the characteristic function of the rationals), things can get far worse...but if you're hoping for a "formula" like the ones in algebra I, you're probably not going to find an everywhere-nondifferentiable function among them.

• Why can't the derivative be discontinuous? A priori it can be discontinuous on a meagre (but very infinite, e.g. full measure) set. In which case the initial function does not have to be (again a priori) an integral, as FTC does not apply. – tomasz Aug 30 '15 at 15:14
• Good point, Tomasz. It has to have the intermediate value property, but not necessarily be continuous. On the other hand, I suspect that if the deriv is discontinuous, it'll be even harder to write down the function. :) Anyhow, I'll edit my answer slightly. – John Hughes Aug 30 '15 at 16:08
• $10^{\hspace{.02 in}n}\hspace{-0.02 in}\cdot \hspace{-0.02 in}7^n \:$ can certainly be simplified. $\;\;\;\;$ – user57159 Aug 30 '15 at 20:48
• Yes; I left it in that form deliberately because it makes it easy to see both $(9/10)^n$ (i.e., $a^n$ in the Wikipedia description) and $7^n$, i.e., $b^n$. – John Hughes Aug 30 '15 at 21:37
• Weierstrass' discovery of a continuous nowhere-differentiable real function in the latter 19th century was a surprise at the time. – DanielWainfleet Sep 21 '17 at 0:12

I don't think there is a really simple counterexample if you want that $f''$ exists nowhere. The Weierstraß function is a continuous function that is nowhere differentiable. Its antiderivative satisfies the desired conditions.

There are simpler examples for functions that are once differentiable, but don't have a second derivative at a single point. One such function is $f(x) = x \cdot |x|$, whose derivative $f'(x) = 2|x|$ is not differentiable at $0$.

• $f'(x) = 2\cdot |x|$ ? (Not that it really matters) – chi Aug 30 '15 at 18:49
• @chi You are right, I've fixed the mistake. – Dominik Aug 30 '15 at 18:50