Energy of electromagnetic wave

Its given here that energy density of an electromagnetic wave is

$$\vec S=\frac{1}{\mu}(\vec E\times\vec B)$$

How is the above expression derived? And when did energy become a vector? I though work done was a scalar quantity.

I know how to find the energy density of waves on a string.

That is not the energy density of the electromagnetic field. That is the energy flow density vector of the field, also known as the Poynting vector. Energy flows in some direction, so its density must be a vector. You're totally right, energy density is not a vector, and it is given in gaussian units as

$$\mathcal{E}=\frac{1}{8\pi}\ (E^{2}+B^{2})$$

As for the derivation, you can compare the energy densities and flows of the fields and charge distribution. From Maxwell's equations:

$$\vec{\nabla}\times \vec{B}=\frac{1}{c}\frac{\partial\vec{E}}{\partial t}+\frac{4\pi}{c}\,\vec{j}\\ \vec{\nabla}\times \vec{E}=-\frac{1}{c}\frac{\partial\vec{B}}{\partial t}$$ so that, multiplying the first one by $\vec{E}$ and the second one by $\vec{B}$ and subtracting them, $$\frac{1}{c}\,\vec{E}\cdot\frac{\partial\vec{E}}{\partial t}+\frac{1}{c}\,\vec{B}\cdot\frac{\partial\vec{B}}{\partial t}=-\frac{4\pi}{c}\,\vec{j}\cdot\vec{E}-(\vec{H}\cdot\vec{\nabla}\times \vec{E}-\vec{E}\cdot\vec{\nabla}\times \vec{H})$$ Using the vector identity $$\vec{H}\cdot\vec{\nabla}\times \vec{E}-\vec{E}\cdot\vec{\nabla}\times \vec{H}=-\vec{\nabla}\cdot(\vec{E}\times\vec{B})$$ you get $$\frac{1}{2c}\,\frac{\partial}{\partial t} E^{2}+B^{2}=-\frac{4\pi}{c}\,\vec{j}\cdot\vec{E}-\vec{\nabla}\cdot(\vec{E}\times\vec{B})$$ Then you define $$\vec{S}=\frac{c}{4\pi}\,\vec{E}\times\vec{B}$$ so that $$\frac{\partial}{\partial t} \frac{E^{2}+B^{2}}{8\pi}=-\vec{j}\cdot\vec{E}-\vec{\nabla}\cdot\vec{S}$$ Integrating both members over all the three-dimensional space, $$\frac{\partial}{\partial t}\ \int\frac{E^{2}+B^{2}}{8\pi}+\int\vec{j}\cdot\vec{E}=0$$ (the second term of the second member vanishes when you integrate over all space). Rewriting $\vec{j}\cdot\vec{E}$ as $$\vec{j}\cdot\vec{E}=e\vec{v}\cdot\vec{E}=\frac{d}{dt}\mathcal{E}_{kin}$$ you can see that the second integral is the time variation of the kinetic energy of the charges. Then the first one must be the time variation of the energy of the fields (as the total energy is conserved). So, first of all, $$\mathcal{E}=\frac{1}{8\pi}\ (E^{2}+B^{2})$$ is the energy density of the fields, and second of all, going back to the equation containing $\vec{S}$, $$\vec{S}=\frac{c}{4\pi}\,\vec{E}\times\vec{B}$$ must be the (vector) density of its flow. Should you know a bit about Lagrangian dynamics, you can more easily derive that expression from the Lagrangian of the electromagnetic field.

• How this equations get wrong if suppose that the photons electric field component and its magnetic field component are shifted by 90°, like shown in this sketch? – HolgerFiedler Feb 7 '16 at 8:27
• If E or B have a phase shift, then S would just have a phase shift. The equations still work. – aquirdturtle Feb 7 '16 at 9:55
• This equations never get wrong, in the context of classical mechanics. As you can see, their derivation is given in full generality. The only two things that require care is (1) should you use the formalism in which the fields are complex, you must slightly modify the formulas, for example $\mathcal{E}=(8\pi)^{-1}(\vec{E}^{*}\cdot\vec{E}+\vec{B}^{*}\cdot\vec{B})$; (2) plane waves are not integrable over the whole space: their energy densities are well-defined, but their total energy is not. – Giorgio Comitini Feb 7 '16 at 12:07
• And by the way, just as a footnote, you must be careful when talking about the photons' field. It is never stressed enough (and it is often omitted) that a plane wave is not equal to a photon. To go from the electric field to its photonic content requires the heavy machinery of QED. The (quantum mean) electric field of a finite number of photons is indeed alway zero. – Giorgio Comitini Feb 7 '16 at 12:12