  A nonrelativistic particle released from rest at the edge of a ball of
uniform charge density or mass density oscillates with simple harmonic motion.
We consider the relativistic generalizations of these situations where the
particle can attain speeds arbitrarily close to the speed of light;
generalizing the electrostatic and gravitational cases requires special and
general relativity, respectively. We find exact closed-form relations between
the position, proper time, and coordinate time in both cases, and find that
they are no longer harmonic, with oscillation periods that depend on the
amplitude. In the highly relativistic limit of both cases, the particle spends
almost all of its proper time near the turning points, but almost all of the
coordinate time moving through the bulk of the ball. Buchdahl's theorem imposes
nontrivial constraints on the general-relativistic case, as a ball of given
density can only attain a finite maximum radius before collapsing into a black
hole. This article is intended to be pedagogical, and should be accessible to
those who have taken an undergraduate course in general relativity.
