Non-continuous higher differentiability The standard definition is that a function $f:\mathbb{R}^n\to \mathbb{R}$ is differentiable at a point $x$ if there exists a linear map $\mathrm{d}f_x: \mathbb{R}^n \to \mathbb{R}$ such that
$$f(x+h)  = f(x) + \mathrm{d}f_x(h) + \epsilon \|h\|$$
where $\epsilon\to 0$ as $h\to 0$.  This is stronger than the existence of all partial (or directional) derivatives, but weaker than their continuity.  However, when talking about higher differentiability, one usually switches to talking about partial derivatives, asking them to be continuous in order to prove basic properties.
Suppose that instead we define $f$ to be "twice differentiable" at $x$ if in addition to $\mathrm{d}f_x$ as above there exists a quadratic form $\mathrm{d}^2f_x$ such that
$$f(x+h)  = f(x) + \mathrm{d}f_x(h) + \frac{1}{2}\mathrm{d}^2f_x(h) + \epsilon \|h\|^2$$
where $\epsilon\to 0$ as $h\to 0$.  This is true if $f$ has continous second-order partials (it's the multidimensional Taylor expansion, with $\mathrm{d}^2f_x$ the Hessian matrix).


*

*Does this imply that all second-order partial derivatives of $f$ exist?

*If so, does it imply that the mixed second-order partials are equal?

 A: The funny thing is that I got almost the same question from one of my student last semester. The idea was to neglect both the linear and quadratic parts of the hypothetical expansion (without loss of generality, we may assume they are zero), and focus on $ \epsilon \|h\|^2$.  We came to the following (obvious) one-dimensional counterexample:
$$f(h) = h^3 \sin(\frac{1}{h})$$
for $h \not= 0$, and:
$$f(0) = 0$$
A: No, if I understand the question right, not even in one variable. Let $f(x)$ be $x^3g(x)$ where $g$ is bounded and, except at $x=0$, infinitely differentiable. If $g$ oscillates fast enough near $x=0$ then even though it is the sum of a degree two polynomial (namely zero) and an error term of the kind you are allowing, it will not have a second derivative at $0$.
A: Thanks Michal and Tom for the answer.  Let me improve on it slightly with an example of a function which is well-approximated by a polynomial of every degree near 0 (in fact, the zero polynomial), but is still not even twice differentiable there:
$$f(x) = e^{-1/x^2} \sin(e^{1/x^2}) $$
