Ito Isometry and quadratic variation Here is a confusion regarding stochastic integrals. Let
$Y_t=\int_0^tW_sds$ where $W_t$ is a Brownian Motion. Now $dY_t=W_tdt$. So from this expression one can conclude that $dY_t \cdot dY_t=d[Y_t,Y_t]$ where $[\ ]$ is the quadratic variation process and it must be zero as $dt \cdot dt =0$. But people apply Fubini-stochastic integral exchange trick and see $Y_t=\int_0^t(t-u)dW_u$. So by applying Ito isometry one can see that $E(Y_t^2)=\int_0^t(t-u)^2du \neq 0$. Can someone tell me where I'm going wrong? Why this discrepancy?
 A: Every step is correct, including the identities $Y_t=\displaystyle\int_0^tW_s\mathrm ds=\int_0^t(t-s)\mathrm dW_s$ and $[Y]_t=0$, except the underlying assertion that the process $Y^2-[Y]$ should be a martingale and consequently that $\mathbb E(Y_t^2)$ and $\mathbb E([Y]_t)$ should coincide for every $t$.
Recall that the quadratic variation process $[Y]$ is defined as
$[Y]_t=Y_t^2-2\displaystyle\int_0^tY_s\mathrm dY_s$. In particular, $Y^2-[Y]=2\displaystyle\int_0^\cdot Y\mathrm dY$ is a martingale when $Y$ is, but not otherwise. 
Here, $Y$ is not a martingale since, for every $s\lt t$, $\mathbb E(Y_t\mid\mathcal F_s)=Y_s+(t-s)W_s\ne Y_s$.
Edit: A general method (which is not a trick) to compute $\mathbb E(Y_t^2)$ is indeed to use Itô's formula for $Y^2$. One gets
$$
\mathrm d(Y_t^2)=2Y_t\mathrm dY_t+\mathrm d[Y]_t=2Y_tW_t\mathrm dt.
$$
Fubini on $\Omega\times[0,t]$ with the measure $\mathbb P\otimes\mathrm{Leb}$ yields
$$
\mathbb E(Y_t^2)=\mathbb E\left(\int_0^t2Y_sW_s\mathrm ds\right)=\int_0^t2\mathbb E(Y_sW_s)\mathrm ds.
$$
Fubini again yields
$$
2\mathbb E(Y_sW_s)=2\int_0^s\mathbb E(W_uW_s)\mathrm du=\int_0^s2u\mathrm du=s^2,
$$
hence
$$
\mathbb E(Y_t^2)=\int_0^ts^2\mathrm ds=\frac{t^3}3.
$$
A: Your second representation is correct, but you cannot treat it as a stochastic integral (so will not be a martingale) as the integrand depends on the end point of the integral, $t$. Even if it were a martingale, you cannot apply the Itou isometry to it for the same reason. Basically, the problem is that $Y_t$ are integrands against completely different processes in the second representation.
