This came from the solution to the differential equation that came
from the Newton's second law in the
direction, which was
. The solution to this equation is a
sinusoid, and the most general sinusoidal solution to this DE can be
written
, where
(try
plugging it in!).
and
are constants to be determined by
initial conditions.