To prove the time dilation formula consider the following observers.

The observer on the right is stationary in his reference frame, and the observer on the left sees the other moving to the right with speed![]()
The observer on the right bounces a light signal between the ceiling and the floor. It takes a time
to return to the floor, so that
The observer on the left sees the moving framer of reference moving to the right, and will see the ray of light travel a distance
in a time
where
He will observe the ray of light to take a time
to return to the floor, so that![]()
Substitute
and
into

Square both sides to give
hence![]()
Move the last term to the left.
![]()
Divide by
to give
Factorise with
to give
Hence