I outline the theory of relativistic charged-particle motion in the
magnetosphere in a way suitable for undergraduate courses. I discuss particle
and guiding center motion, derive the three adiabatic invariants associated
with them, and present particle trajectories in a dipolar field. I provide
twelve computational exercises that can be used as classroom assignments or for
self-study. Two of the exercises, drift-shell bifurcation and Speiser orbits,
are adapted from active magnetospheric research. The Python code provided in
the supplement can be used to replicate the trajectories and can be easily
extended for different field geometries.Comment: 10 pages, 7 figures. Submitted to American Journal of Physic