So, my book says that the Poynting Vector associated to an electromagnetic wave in matter with permeability $\mu$ is $\mathbf{S} = \frac{1}{\mu} \mathbf{E} \times \mathbf{B}$. The thing is, I am unsure whether I can compute this vector with the complex fields "associated" to my original waves, and then get the real part, or if this formula is only valid when using the original real fields.
My exercise in particular gives me the wave $E(y,z,t)=E_0cos(ay+bz-wt) \hat{x}$, which has associated complex wave $$E(y,z,t)=E_0e^{i(ay+bz-wt)} \hat{x}$$ The magnetic field (which I got from Maxwell's third equation) is:
$$B(y,z,t)=\dfrac{E_0}{w}(b\hat{y}-a\hat{z}) e^{i(ay+bz-wt)} $$ Now, if I compute the poynting vector with the first method(complex waves and then extract real part) I get: $\mathbf{S}=\dfrac{E_0^2}{\mu w}(b\hat{z}+a\hat{y})cos(2(ay+bz-wt))$
Whereas if I use directly the real fields I get: $\mathbf{S}=\dfrac{E_0^2}{\mu w}(b\hat{z}+a\hat{y})cos^2(ay+bz-wt)$.
Obviously they cannot both be right, since one has $cos(2\alpha)$ and the other $cos^2(\alpha)$.I also have a similar confusion with the formula for the energy density $\frac{1}{2}\epsilon_0 E^2 + \frac{1}{2\mu_0} B^2$. Should I use the modules of the complex waves, or the modules of the real waves? Thanks in advance.