Divergence of Magnetic Field in an Electromagnetic Wave In many text books of physics (especially those coping with Electromagnetic Theory), we see that an electromagnetic wave (EMW) is drawn as an electric field varying with a sinusoidal form and exactly perpendicular to it we see the magnetic field varying in the same manner. One of the fundamental equations of EM is the equation that states that $\nabla\cdot\mathbf B=0$ which means that the magnetic monopole doesn't exist. I've always thought of this equation as an equivalent of the affirmation: "The magnetic field lines are always closed ones."
My question is: How can I demonstrate that in an EMW, the equation $\nabla\cdot\mathbf B=0$ still holds if the magnetic field lines are open ones?
 A: If you have an explicit solution $B(\mathbf{r},t)$, then calculate $\nabla\cdot B(\mathbf{r},t)$ to make sure it holds. The magnetic lines are not obligatorily closed. They can be infinitely long too (I even heard they could be infinitely winding in a limited space).
A: It is clear that $\nabla \cdot {\bf B}=0$ for any EM wave you can come up with. e.g. ${\bf B} = \sin (kx - \omega t) \hat{\bf j}$ for instance. Here the wave propagation is in the positive x-direction. The B-field is perpendicular to the wave motion, which is required by Maxwell's equations. i.e. $B_x =0 = B_z =0$ and $B_{y} \neq f(y)$ so that $\nabla \cdot {\bf B}=0$.
The meaning of this equation is that the net flux per unit volume of B-field is equal to zero. i.e if you draw a small volume there are just as many field lines entering the volume as there are exiting the volume. So long as the number of field lines does not change within the small volume you are considering, then Maxwell is happy.
So that would be my answer. Don't consider a divergence-free field as one where the field lines close in on themselves; rather think of it as a field where the field lines have no beginning or end (which handles fields with an infinite spatial extent) and where the number of field lines entering a volume equals the number of field lines exiting the volume.
