Question related to Square Integrable Martingale 
Let $X_n$ and $Y_n$ be martingales with $EX_n^2<\infty$ and $EY_n^2<\infty$ for all $n$. Show that $EX_nY_n-EX_0Y_0=\sum_{m=1}^nE(X_m-X_{m-1})(Y_m-Y_{m-1})$.

I tried to expand the right hand side as follows:
$\sum_{m=1}^nE(X_m-X_{m-1})(Y_m-Y_{m-1})=\sum_{m=1}^n(X_mY_m-X_{m-1}Y_{m}+X_{m-1}Y_{m-1}-X_mY_{m-1})$. However, these terms cannot cancel out as I hoped. 
I know that martingales satisfy $E(X_n|\cal F_m)=X_m$. But I do not know how to use the condition here. 
Could someone kindly help? Thanks!
 A: The comments below your question suggest two ways to tackle this question; here is another one:
First, consider the case $X=Y$. Since $X_n - X_0 = \sum_{j=1}^n (X_j-X_{j-1})$, we have
$$\begin{align*} X_n^2 -X_0^2 &= (X_n-X_0)^2 + 2 (X_n-X_0) X_0 \\ &= \sum_{j=1}^n \sum_{k=1}^n (X_j-X_{j-1}) (X_k-X_{k-1}) + 2 (X_n-X_0) X_0. \tag{1} \end{align*}$$
Fix $j<k$. Then $\Delta_j := X_j-X_{j-1}$ is $\mathcal{F}_j$ measurable, and therefore the tower property implies
$$\mathbb{E}(\Delta_j \Delta_k) = \mathbb{E}(\mathbb{E}(\Delta_j \Delta_k \mid \mathcal{F}_j))= \mathbb{E}(\Delta_j \mathbb{E}(\Delta_k \mid \mathcal{F}_j)) = 0 \tag{3}$$
Here we have used in the last "=" that $(X_n)_n$ is a martingale. Exactly the same argumentation shows $$\mathbb{E}((X_n-X_0) X_0) = 0.$$ Plugging this into $(1)$, we find
$$\mathbb{E}(X_n^2-X_0^2) = \sum_{j=1}^n \mathbb{E}((X_j-X_{j-1})^2).$$
(Note that the mixed terms vanish because of $(3)$.)
Finally, for the general case, the claim follows from the polarization identity
$$X_j Y_j = \frac{1}{4} ((X_j+Y_j)^2-(X_j-Y_j)^2).$$
