[Math] Examples of functions that are $C^2$ but not $C^3$

real-analysis

I am trying to find examples of functions that are in $C^2(\mathbb{R})$ but not in $C^3(\mathbb{R})$. I am also wondering about $C^2[0,1]$ and $C^3[0,1]$.

If I am not mistaken about the definitions, a function is said to be in $C^p(A)$ if it is a real-valued function with the set $A$ as its domain and its $p$-th derivative being defined on all of $A$ and continuous.

Thanks!

Best Answer

Take some function $f \in C^0(\mathbb R) \setminus C^1(\mathbb R)$, for example $f\colon x \mapsto \left|x-\frac 12\right|$. Taking the antiderivative twice, gives you $$ F \colon x \mapsto \int_0^x \int_0^\xi \left|t - \frac 12\right| \, dt\,d\xi $$ which is in $C^3(\mathbb R) \setminus C^2(\mathbb R)$ (no, you don't want $C^2(\mathbb R)$-functions to be bounded). Restricting $F$ to $[0,1]$ gives you an example there.

Related Question