# Stochastic calculus: what am I doing wrong?

it is just the computation of a second moment but however is creating debate !!... Can someone spot the error? • It is a regular integral the second step... It becomes such because you are squaring Brownian motion and not considering terms of order higher than dt – Alessandro Balata Jun 2 '15 at 17:20

For a martingale $\{M_t \mid t\geq 0\}$ and the stochastic integral \begin{align*} I_t = \int_0^tZ_s dM_s, \end{align*} we have that \begin{align*} E((I_t)^2) = E\bigg( \int_0^tZ_s^2 d\langle M\rangle_s\bigg), \end{align*} where $\langle M\rangle$ is the quadratic variation. That is, the ito's isometry holds for a martingale integrator only.
However, in your question, $\{X_t \mid t\geq 0\}$ is not a martingale, then \begin{align*} E\big( Y_t^2)\big) \neq E\bigg(\int_0^t (1+s)^2 d\langle X\rangle_s \bigg). \end{align*} Instead, since \begin{align*} Y_t^2 &= \bigg(4\int_0^t(1+s)ds + 6\int_0^t(1+s)W_sdW_s \bigg)^2\\ &=16\bigg( \int_0^t(1+s)ds\bigg)^2 + 48 \int_0^t(1+s)ds\int_0^t(1+s)W_sdW_s + 36 \bigg( \int_0^t(1+s)W_sdW_s\bigg)^2, \end{align*} then \begin{align*} E\big( Y_t^2)\big) &= 16\bigg( \int_0^t(1+s)ds\bigg)^2 + 36 E\bigg[\bigg( \int_0^t(1+s)W_sdW_s\bigg)^2\bigg]\\ &=16\bigg( \int_0^t(1+s)ds\bigg)^2 + 36 E\bigg[\bigg( \int_0^t(1+s)^2W_s^2ds\bigg)\bigg]\\ &= 16\bigg( \int_0^t(1+s)ds\bigg)^2 + 36\int_0^t(1+s)^2 s\, ds. \end{align*}