Solution of the time-dependent Maxwells's equations for the electric field