[Math] Partial derivatives exist, but the function is not differentiable

derivativesmultivariable-calculustensor-products

It is well-known that a function $f:\mathbb{R}^n\to \mathbb{R}$ can have the property that it is differentiable along any line through the origin, but not even continuous at the origin.

Can the same thing happen at any level of differentiability? I.e., could we have a function that is differentiable at zero, and such that the partial derivatives of order $n$ exist, but $d^{(n-1)}f$ is not even continuous?

Here I suppose we are interpreting $d^nf$ as a tensor field on $\mathbb{R}^n$, which takes values in $(\mathbb{R}^{n*})^{\otimes n}\otimes \mathbb{R}$, so that it makes sense to ask whether it is a continuous tensor field or not.

Best Answer

If I understood your question correctly, you could just construct a function that has a discontinuous first derivative. For example, let $f = x^2 \sin(1/x)$ if $x \ne 0$ and $f = 0$ if $x = 0$. This piecewise functions has a discontinuous first derivative. This can be generalized, of course.