  Using the Kantorovitch method in combination with a Gaussian ansatz, we
derive the equations of motion for spatial, temporal and spatiotemporal optical
propagation in a dispersive Kerr medium with a general transverse and spectral
gain profile. By rewriting the variational equations as differential equations
for the temporal and spatial Gaussian q parameters, optical ABCD matrices for
the Kerr effect, a general transverse gain profile and nonparabolic spectral
gain filtering are obtained. Further effects can easily be taken into account
by adding the corresponding ABCD matrices. Applications include the temporal
pulse dynamics in gain fibers and the beam propagation or spatiotemporal pulse
evolution in bulk gain media. As an example, the steady-state spatiotemporal
Gaussian pulse dynamics in a Kerr-lens mode-locked laser resonator is studied.
