Mathematical physics problem. Eletric and Magnetic field. Velocity of propagation of the electromagnetic energy. 
If we define the velocity of propagation of the electromagnetic energy, for an arbitrary field in the vacuum, for $\vec{S} = U\vec{v}$ , where $U$ is the density of electromagnetic energy, then
$$\left(1-\frac{v^{2}}{c^{2}}\right)U^{2} = (U_{E} - U_{M})^{2} + \frac{\epsilon_{0}}{\mu_{0}}(\vec{E}.\vec{B})^{2}$$

I'm trying to use the equations:
$$\vec{S}=\frac{1}{\mu_{0}}(\vec{E}\times\vec{B})$$
and
$$(\vec{a}\times\vec{b})^{2} + (\vec{a}.\vec{b}) = a^{2}b^{2}$$
But I'm not getting that equality. Can someone help me?
 A: This is straightforward. Use $c^2=1/\sqrt{\epsilon_0\mu_0}$.
\begin{align}
\left(1-\frac{v^2}{c^2}\right)U^2&=U^2-\frac{v^2}{c^2}U^2=U^2-\frac{1}{c^2}\left\|\mathbf{S}\right\|^2\\
&=\left[\frac{1}{2}\left(\epsilon_0\left\|\mathbf{E}\right\|^2+\frac{1}{\mu_0}\left\|\mathbf{B}\right\|^2\right)\right]^2-\frac{1}{c^2}\left\|\frac{1}{\mu_0}\mathbf{E}\times\mathbf{B}\right\|^2\\
&=\frac{1}{4}\left(\epsilon_0^2\left\|\mathbf{E}\right\|^4+2\frac{\epsilon_0}{\mu_0}\left\|\mathbf{E}\right\|^2\left\|\mathbf{B}\right\|^2+\frac{1}{\mu_0^2}\left\|\mathbf{B}\right\|^4\right)-\frac{1}{c^2\mu_0^2}\left(\left\|\mathbf{E}\right\|^2\left\|\mathbf{B}\right\|^2-\left(\mathbf{E}\cdot\mathbf{B}\right)^2\right)\\
&=\frac{1}{4}\left(\epsilon_0^2\left\|\mathbf{E}\right\|^4+2\frac{\epsilon_0}{\mu_0}\left\|\mathbf{E}\right\|^2\left\|\mathbf{B}\right\|^2+\frac{1}{\mu_0^2}\left\|\mathbf{B}\right\|^4\right)-\frac{\epsilon_0}{\mu_0}\left(\left\|\mathbf{E}\right\|^2\left\|\mathbf{B}\right\|^2-\left(\mathbf{E}\cdot\mathbf{B}\right)^2\right)\\
&=\frac{1}{4}\left(\epsilon_0^2\left\|\mathbf{E}\right\|^4-2\frac{\epsilon_0}{\mu_0}\left\|\mathbf{E}\right\|^2\left\|\mathbf{B}\right\|^2+\frac{1}{\mu_0^2}\left\|\mathbf{B}\right\|^4\right)+\frac{\epsilon_0}{\mu_0}\left(\mathbf{E}\cdot\mathbf{B}\right)^2\\
&=\left[\frac{1}{2}\left(\epsilon_0\left\|\mathbf{E}\right\|^2-\frac{1}{\mu_0}\left\|\mathbf{B}\right\|^2\right)\right]^2+\frac{\epsilon_0}{\mu_0}\left(\mathbf{E}\cdot\mathbf{B}\right)^2.
\end{align}
