  We derive the invariant imbedding equations for plane electromagnetic waves
propagating in stratified magnetic media, where both dielectric and magnetic
permeabilities vary in one spatial direction in an arbitrary manner. These
equations allow us to obtain the reflection and transmission coefficients of
the waves and the field amplitudes inside the media exactly for any
polarization and incident angle of the incoming wave by solving an initial
value problem of a small number of ordinary differential equations. We apply
our results to one-dimensional photonic crystals, where the periodic variations
of both dielectric and magnetic permeabilities create photonic band gaps in the
frequency spectrum.
