TITLE: I found a theorem? Is this consistent with the change of variables formula?
QUESTION [5 upvotes]: Let $f$ be a ${C}^{\infty}$ function defined on ${\mathbb{R}}^{2} $.
I considered the following function, $G$ and I probably found the following Theorem. However, I feel that something is wrong.
$G(t,s):={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} f({u}_{1}\textbf{a}+{u}_{2}\textbf{b})\ d{u}_{1}d{u}_{2}$


Theorem?
Let $f:{\mathbb{R}}^{2}\to {\mathbb{R}}$ be ${C}^{\infty}$ function, $\textbf{a},\textbf{b}\in {\mathbb{R}}^{2}$:
  These are linearly independent, $t,s\in\mathbb{R}$, and G and g are defined as follows.
$\ \ g(t,s):=f(t\textbf{a} + s\textbf{b})$ 
$\ \ G(t,s):={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} f({u}_{1}\textbf{a}+{u}_{2}\textbf{b})\ d{u}_{1}d{u}_{2}$
  Then,
$\ $(1)$\frac{\partial^2 G}{\partial t\partial s}(t,s)=f(t\textbf{a}+s\textbf{b})$
$\ $(2)$\frac{\partial^2 g}{\partial t\partial s}(t,s)={}^{T}\textbf{a}(Hf)_{(t\textbf{a}+s\textbf{b})}\textbf{b}$
$\ $(3)$f(t\textbf{a} + s\textbf{b})={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} 
\ {}^{T}\textbf{a}(Hf)_{({u}_{1}\textbf{a}+{u}_{2}\textbf{b})}\textbf{b}
\ d{u}_{1}d{u}_{2}$
Here, ${}^{T}\textbf{a}$ is the 
  Transpose vector of $\textbf{a}$ , and $(Hf)$ is Hessian matrix of $f$ .


Proof of (1)?
$G(t,s)={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} g({u}_{1},{u}_{2})\ d{u}_{1}d{u}_{2}$
and, according to Fubini's theorem, the following is correct:
$$g(t,s)=\frac{\partial^2}{\partial t\partial s}{\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} g({u}_{1},{u}_{2})\ d{u}_{1}d{u}_{2}
=\frac{\partial^2 G}{\partial t\partial s}(t,s)
,$$ and 
$g(t,s):=f(t\textbf{a} + s\textbf{b})$. Therefore,
$$\frac{\partial^2 G}{\partial t\partial s}(t,s)=f(t\textbf{a} + s\textbf{b}).$$　
Proof of (2)?
$$\frac{\partial{g}}{\partial{t}}(t,s)
= \left\langle gradf(t\textbf{a}+s\textbf{b})|\textbf{a}\right\rangle,
$$ 
and
$$\frac{\partial}{\partial s} (gradf(t\textbf{a}+s\textbf{b}))
=(\frac{\partial gradf}{\partial x}(t\textbf{a}+s\textbf{b}),
\frac{\partial gradf}{\partial y}(t\textbf{a}+s\textbf{b})
)\cdot\textbf{b}
=(Hf)_{(t\textbf{a}+s\textbf{b})}\cdot\textbf{b}.
$$ 
Here, $gradf$ is the gradient vector of $f$, and 
$\left\langle \ \ |\ \ \right\rangle$ is dot product of $\mathbb{R}^2$. 
Therefore, 
$$\frac{\partial^2 g}{\partial t\partial s}(t,s)={}^{T}\textbf{a}(Hf)_{(t\textbf{a}+s\textbf{b})}\textbf{b}\ \ $$■
Proof of (3)?
Differentiate both sides of the following expression.
$$G(t,s)={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} g({u}_{1},{u}_{2})\ d{u}_{1}d{u}_{2}$$
Differentiation and integration are interchangeable. Therefore, considering (2)
$$\frac{\partial^2}{\partial t\partial s}G(t,s)
=\frac{\partial^2 }{\partial t\partial s}{\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} g({u}_{1},{u}_{2})\ d{u}_{1}d{u}_{2}$$
$$={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} \frac{\partial^2 }{\partial t\partial s}g({u}_{1},{u}_{2})\ d{u}_{1}d{u}_{2}={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} 
\ {}^{T}\textbf{a}(Hf)_{({u}_{1}\textbf{a}+{u}_{2}\textbf{b})}\textbf{b}
\ d{u}_{1}d{u}_{2}$$
On the other hand, considering (1), The left side of the above formula is:
$$f(t\textbf{a} + s\textbf{b}) = \frac{\partial^2}{\partial t\partial s}G(t,s)$$
Therefore,
$$f(t\textbf{a} + s\textbf{b}) 
={\int}_{{{u}_{2}}=0}^{{{u}_{2}}=s}{\int}_{{{u}_{1}}=0}^{{{u}_{1}}=t} 
\ {}^{T}\textbf{a}(Hf)_{({u}_{1}\textbf{a}+{u}_{2}\textbf{b})}\textbf{b}
\ d{u}_{1}d{u}_{2}$$   ■


My question
  Are these Theorem? (1)-(3) correct? If it is correct, is it consistent with the variable conversion formula?

P.S.
I'm not very good at English, so I'm sorry if I have some impolite or unclear expressions.

REPLY [3 votes]: Note that differentiation and integration only interchange when the boundaries of the integral do not depend on the variable with respect to which you are differentiating. In the easiest case of dependency, namely $\int_0^t$, we have
$$
\frac d{dt}\int_0^t\phi(s)\,ds = \phi(t), \quad\text{while}\quad\int_0^t\phi'(s)\,ds = \phi(t)-\phi(0).
$$
Hence,
$$
G_{ts}(t,s) = \frac{\partial}{\partial s}\int_0^s\frac{\partial}{\partial t}\int_0^tg(u,v)\,du\,dv = \frac{\partial}{\partial s}\int_0^sg(t,v)\,dv = g(t,s),
$$
which is  (1). From the first line above we also get $\frac d{dt}\int_0^t\phi(s)\,ds = \phi(t) = \phi(0) + \int_0^t\phi'(s)\,ds$. Using this twice, we obtain
\begin{align*}
G_{ts}(t,s)
&= \frac{\partial}{\partial s}\int_0^s\frac{\partial}{\partial t}\int_0^tg(u,v)\,du\,dv = \frac{\partial}{\partial s}\int_0^s\left(g(0,v)+\int_0^tg_t(u,v)\,du\right)\,dv\\
&= g(0,0) + \int_0^tg_t(u,0)\,du + \int_0^s\left(g_s(0,v) + \int_0^tg_{st}(u,v)\,du\right)\,dv\\
&= g(0,0) + \int_0^tg_t(u,0)\,du + \int_0^s g_s(0,v)\,dv + \int_0^s\int_0^tg_{st}(u,v)\,du\,dv.
\end{align*}
The rightmost summand is your term with the Hessian. Now, $g(t,s) = f(ta+sb)$, hence $g_t(t,s) = f'(ta+sb)a$, so that $g_t(u,0) = f'(ua)a = \phi'(u)$, where $\phi(u) = f(ua)$. Therefore, $\int_0^tg_t(u,0)\,du = \phi(t)-\phi(0) = f(ta)-f(0,0)$. Similarly, $\int_0^s g_s(0,v)\,dv = f(sb)-f(0,0)$. So, you get

$$ f(ta+sb) = f(ta)+f(sb)-f(0,0) + \int_0^s\int_0^t a^TH_f(ua+vb)b\,du\,dv. $$

Let's check this with an example. Let $a=(1,1)^T$ and $b=(1,-1)^T$ and $f(x,y) = x^2 + xy^2$ (random choice ;-)). Then
$$
f(ta+sb) = f((t,t)+(s,-s)) = f(t+s,t-s) = (t+s)^2+(t+s)(t-s)^2.
$$
The Hessian of $f$ is
$$
H_f(x,y) = 2\begin{pmatrix}1&y\\y&x\end{pmatrix}.
$$
Hence,
$$
a^TH_f(ua+vb)b = 2(1,1)\begin{pmatrix}1&u-v\\u-v&u+v\end{pmatrix}\begin{pmatrix}1\\-1\end{pmatrix} = 2(1-u-v).
$$
Integrating this over $[0,t]\times [0,s]$ gives $2ts-t^2s-ts^2$. Moreover,
$$
f(ta)+f(sb)-f(0,0) = t^2+t^3+s^2+s^3.
$$
Now, it is not difficult to see that
$$
t^2+t^3+s^2+s^3 + 2ts-t^2s-ts^2 = (t+s)^2+(t+s)(t-s)^2.
$$