We develop the theory for the generalized first invariant for adiabatic motion of charged particles in regions where there are large gradients in magnetic or electric fields. The general condition for an invariant to exist in such regions is that the potential well in which the particle oscillates change its shape slowly as the particle drifts. We show how the Kruskal (1962) procedure can be applied to obtain expressions for the invariant and for drift velocities that are asymptotic in a smallness parameter ϵ. We illustrate the procedure by obtaining the invariant and drift velocities for particles traversing a perpendicular shock, and we compare the generalized invariant with the magnetic moment, and the drift orbits with the actual orbits, for a particular case. In contrast to the magnetic moment, the generalized first invariant is better for large gyroradii (large kinetic energies) than for small gyroradii. We also give expressions for the invariant when an electrostatic potential jump is imposed across the perpendicular shock, and when the particle traverses a rotational shear layer with a small normal component of the magnetic field. |