Does Frechet differentiability of the first order partials imply twice Frechet differentiability? Let $f:\mathbb{R}^n \to \mathbb{R}$. If all first order partial derivatives of $f$ are Frechet differentiable, must $f$ be twice Frechet differentiable?
This question is inspired by my comment on this answer: https://math.stackexchange.com/a/1181928/95800
 A: Yes, it's true; the proof is a simple matter of carefully organizing everything you know. We can prove the following general theorem:

Let $E_1,\dots, E_n, F$ be Banach spaces over the same field, let $E:= E_1\times \cdots E_n$ and $U\subset E$ be a non-empty open set. Suppose $f:U\to F$ is a function such that all its first order partials $\partial_if$ (which are maps $U\to L(E_i,F)$) are differentiable on $U$. Then, $f$ is twice differentiable on $U$.

It is a classic theorem that continuity of first order partials implies $f$ is $C^1$, so it makes sense to even talk about $f$ being twice differentiable. Next, recall that for $a\in U,h\in E$, we have
\begin{align}
Df_a(h)&= \sum_{i=1}^n(\partial_if)_a(h_i) \equiv\sum_{i=1}^n \partial_if_a(h_i)
\end{align}
In other words, we take the $i^{th}$ partial derivative at the point $a\in U$, $(\partial_if)_a$, and evaluate on $h_i\in E_i$. Now, introduce the projections $\pi_i:E\to E_i$. The above equation can be written more concisely as
\begin{align}
Df_a&=\sum_{i=1}^n\partial_if_a \circ \pi_i
\end{align}
(this is essentially the meaning of the equation $df=\sum_{i=1}^n\frac{\partial f}{\partial x^i}\, dx^i$ which you may have seen several times before). Now that we have related the first derivative to the partial derivatives, we can now compute: for any $a\in U$ and $h\in E$ with sufficiently small norm so that $a+h\in U$, we have
\begin{align}
Df_{a+h}&=\sum_{i=1}^n (\partial_if)_{a+h} \circ \pi_i\\
&=\sum_{i=1}^n \bigg(\partial_if_a + D(\partial_if)_a[h] + \phi_i(h)\bigg)\circ \pi_i
\end{align}
for some $\phi_i:U\to L(E_i,F)$ such that $\frac{\lVert \phi_i(h)\rVert}{\lVert h\rVert} \to 0$ as $h\to 0$ (hopefully it's clear which norm is which). This is simply due to the differentiability assumption on $\partial_if$ at the point $a\in U$. Now, we simplify some more:
\begin{align}
Df_{a+h}&=\sum_{i=1}^n (\partial_if)_a\circ \pi_i + \sum_{i=1}^n \left(D(\partial_if)_a[h]\right)\circ \pi_i + \sum_{i=1}^n \phi_i(h) \circ \pi_i \\
\end{align}
The first term is simply $Df_a$. The second term defines a bounded linear function of $h$, which we shall call $T(h)$. Finally, I claim the last term is $o(\lVert h\rVert)$ as $h\to 0$. To see this, we just calculate:
\begin{align}
\dfrac{1}{\lVert h\rVert}\left\lVert\sum_{i=1}^n \phi_i(h)\circ \pi_i \right\rVert &\leq \sum_{i=1}^n \frac{\lVert \phi_i(h)\circ \pi_i\rVert}{\lVert h\rVert}
\leq \sum_{i=1}^n\frac{\lVert \phi_i(h)\rVert}{\lVert h\rVert} \cdot \lVert \pi_i\rVert.
\end{align}
There are a bunch of different norms here, so you should make sure you know which is which. As $h\to 0$, each of the fractions approaches $0$, therefore, the entire RHS approaches $0$. In other words, we have shown that
\begin{align}
Df_{a+h}&= Df_a + T(h) + \rho(h)
\end{align}
for some bounded linear map $T:E \to L(E,F)$ and some function $\rho:U\to L(E,F)$ such that $\frac{\lVert\rho(h) \rVert}{\lVert h\rVert}\to 0$ as $h\to 0$. This is precisely what it means for $Df$ to be differentiable at $a$.

By the way, the above even gives a formula for $D^2f_a$, which is $T$. If you want, you can verify (after identifying with appropriate bilinear maps) that
\begin{align}
D^2f_a[h,\cdot] &= \sum_{i=1}^n D(\partial_if)_a(h) \circ \pi_i(\cdot)
=\sum_{i,j=1}^n (\partial_j\partial_if)_a[h_j, \pi_i(\cdot)].
\end{align}
Also, it's a classic theorem that $D^2f_a$ is a symmetric function of its two arguments. So, we can be sloppy with the order of indices, and this is essentially the meaning of the formula $D^2f = \sum_{i,j=1}^n \frac{\partial^2f}{\partial x^i \partial x^j}\,dx^i\, dx^j$ which you may have seen before.
