Quadratic variation of a stochastic integral w.r.t. a local martingale I am trying to prove the (seemingly simple) property: for a continuous local martingale $M$ and an $M$-integrable process $H$, the quadratic variation $\langle\int H\,dM\rangle$ of $\int H\,dM$ is given by $\int H^2\,d\langle M\rangle$. It's clear that the only property that's left to show in order for $\int H^2\,d\langle M\rangle$ to be the quadratic variation in question is that $(\int H\,dM)^2-\int H^2\,d\langle M\rangle$ is a (continuous) local martingale. I thought I get that directly from Ito's formula, but apparently I'm doing a mistake somewhere. Letting $f(x)=x^2$, we have (writing in short hand notation, i.e. $H dM=\int H\,dM$ etc.):
$$
d\left(H\,dM\right)^2=df\left(H\,dM\right)=f'\left(H\,dM\right)d\left(H\,dM\right)+\frac{1}{2}f''\left(H\,dM\right)d\left(H\,dM\right)d\left(H\,dM\right)
$$
$$=2HdMHdM+\frac{1}{2}2HdMHdM=3H^2d\langle M\rangle
$$
using $dMdM=d\langle M\rangle$. But then
$$d\left((HdM)^2-H^2d\langle M\rangle\right)=3H^2d\langle M\rangle -H^2d\langle M\rangle=2H^2d\langle M\rangle$$
is of finite variation and definitely not a local martingale. What am I doing wrong?
 A: The computation of $d(HdM)^2$ is incorrect, and actually seems to be assuming what you are trying to show.  The term $f'(H dM)d(H dM)$ is a local martingale, but when you rewrite it as $$f'(H dM)d(H dM) = 2 HdM HdM = 2 H^2 d\langle M \rangle$$ you get something that is finite variation and hence not a local martingale.  If you write this out in integral notation, you can see the mistake: \begin{align*}\int_0^t f'((H dM)_s) d(H dM)_s &= \int_0^t f'\left(\int_0^s(H_u dM_u)\right) d(H dM)_s \\
&= 2 \int_0^t \left(\int_0^s H_u dM_u \right) H_s dM_s.\end{align*}  Basically the time indices don't line up correctly.
The term $\frac 12 f''( H dM) d(H dM) d(H dM) = d(H dM) d(H dM)$ is indeed equal to $H^2 d \langle M \rangle$, but that's because the notation $d(H dM) d(H dM)$ is just shorthand for $d \langle H dM \rangle$.  When you write $d(H dM) d(H dM) = H^2 d \langle M \rangle$ you're already using that $\langle H dM \rangle_t = \int_0^t H_s^2 d\langle M \rangle_s$, which is what you wanted to prove.
