# Proving that a stochastic process is a martingale using Ito's Lemma

Assume a Wiener process W and a bounded F-adjusted stochastic process a. Show that the following process is a martingale on F

$$X(t)=(\int_{0}^{t}a(s)dW(s))^{2}-\int_{0}^{t}a^{2}(s)ds,\ t\geq0$$

Can someone help me on the above exercise? I tried to apply Ito's lemma but I got stuck

$$d Y \left(t\right) := d \left[\int_0^t{a \left(s\right)\mathrm{d}W_s}\right] = a \left(t\right) dW_t$$ Note that since $$Y$$ is a driftless process, it is a local martingale, and because $$a$$ is bounded, a true martingale. Its quadratic variation is given by $$\langle Y \left(\cdot\right)\rangle_t = \int_0^t{a^2 \left(s\right)\mathrm{d}s}$$ by definition of the stochastic integral with respect to the Wiener process.

Using Itō's lemma, $$d \left[\left[Y \left(t\right)\right]^2\right] = 2 Y \left(t\right) d Y\left(t\right) + d \langle Y \left(\cdot\right)\rangle_t$$ Subtracting the differential of the time integral, i.e. $$a^2 \left(t\right) \, dt$$, removes the drift term due to $$d \langle Y \left(\cdot\right)\rangle_t$$ and you are done.

Alternatively, we can use Ito isometry ($$X$$'s integrability and adaptability are assured by $$a$$'s boundness and adaptability, respectively):
$$E[X_t|{\cal F}_s] = E[X_s\big|{\cal F}_s] + E\left[\left(\int_s^t a_udW_u\right)^2 - \int_s^t a_u^2du \big|{\cal F}_s \right]$$
$$= X_s + E\left[\left(\int_s^t a_udW_u\right)^2\big|{\cal F}_s\right] - E \left[ \int_s^t a_u^2du \big|{\cal F}_s \right] =X_s$$