Ito formula - How to calculate this differential? Let $W(t)$ be a Brownian motion, how can I calculate the following differential: 
$$\int_t^T\int_0^t e^{uW(s)}dsdu $$ 
I do not know how to apply the Ito formula on this problem. Thanks in advance!
 A: This is a very good question. In a classical Ito calculus the integrand is not allowed to depend on the limit of integration. Your problem introduces precisely such dependence. 
In some circumstances one may by-pass this problem using ad-hoc methods. For example, $Y_t := \int_0^t \mathrm{e}^{s-t}dW_s$ can be written as $Y_t = \mathrm{e}^{-t}\int_0^t \mathrm{e}^{s}dW_s$, and the second part is now a standard stochastic integral (integrand is not changing with $t$), so on defining $X_t:=\int_0^t \mathrm{e}^{s}dW_s$ one obtains $dX= \mathrm{e}^{t}dW$ and $dY = d(\mathrm{e}^{-t}X)=\mathrm{e}^{-t}(dX-Xdt)$. In your case I doubt one can manipulate the problem to apply standard Ito calculus.
When things are sufficiently benign the Leibnitz formula should still work (it does in my example).
A: Define the random variables, $g_{u}:=\int\limits_{0}^{t}\ e^{uW_s}\mathrm ds\ (\mbox{ for }t\leqslant u\leqslant T)$, and note that, by definition, $\mathrm dg_u = e^{uW_t}\mathrm dt$. Then, we may define the random variable
$$
f\left(t, \left\{g_u\right\}_{t\leqslant u\leqslant T}\right) := \int\limits_{t}^{T} \int\limits_{0}^{t}\ e^{uW_s}\mathrm ds\mathrm du = \ \int\limits_{t}^{T}\ g_u\mathrm du\,\,. \tag{1}
$$
Notice that $(1)$ makes obvious how all of the uncertainty for $f$ comes as the limit of linear combinations of the $g_u$ random variables. By using Ito's lemma at the level of these linear combinations and considering the convergence of the resulting random variables, one justifies a limiting application of Ito's lemma:


$
\mathrm d\left(\ \int\limits_{t}^{T} \int\limits_{0}^{t}\ e^{uW_s}\mathrm ds\mathrm du\right) = \mathrm df = \left(\frac{\partial}{\partial t}f\right)\mathrm dt + \int\limits_{t}^{T}\mathrm dg_u\ \mathrm du = \left(- \int\limits_{0}^{t}\ e^{tW_s}\mathrm ds + \int\limits_{t}^{T}\ e^{uW_t}\mathrm du \right)\mathrm dt
$



We can be confident that this application of Ito's lemma is okay, if the stochastic integral suggested by this result is the stochastic integral we started out with. Fubini's theorem will suffice to see this (and serves as an alternative proof):
$$
\begin{eqnarray*}
\int\limits_{0}^{t}\left(\ \int\limits_{r}^{T}\ e^{uW_r}\mathrm du - \int\limits_{0}^{r}\ e^{rW_s}\mathrm ds \right)\mathrm dr &=& \int\limits_{0}^{t}\int\limits_{r}^{T}\ e^{uW_r}\mathrm du\mathrm dr - \int\limits_{0}^{t}\int\limits_{0}^{r}\ e^{rW_s}\mathrm ds\mathrm dr\ = \\
\int\limits_{0}^{t}\int\limits_{r}^{T}\ e^{uW_r}\mathrm du\mathrm dr - \int\limits_{0}^{t}\int\limits_{s}^{t}\ e^{rW_s}\mathrm dr\mathrm ds &=& \int\limits_{0}^{t}\int\limits_{r}^{T}\ e^{uW_r}\mathrm du\mathrm dr - \int\limits_{0}^{t}\int\limits_{r}^{t}\ e^{uW_r}\mathrm du\mathrm dr\\
&=&\int\limits_{t}^{T} \int\limits_{0}^{t}\ e^{uW_r}\mathrm dr\mathrm du\,.
\end{eqnarray*}
$$ 
