How do I derive the Lorentz contraction from the invariant interval? While reviewing some basic special relativity, I stumbled upon this problem:
From the definition of the proper time:
$$c^2d\tau^2=c^2dt^2-dx^2$$
I was able to derive the time dilation formula by using $x=vt$:
$$c^2d\tau^2=c^2dt^2-v^2dt^2=c^2dt^2\left(1-\frac{v^2}{c^2}\right)\rightarrow d\tau = dt\sqrt{1-\frac{v^2}{c^2}}=dt/\gamma$$
Now, I would very much like to be able to derive the length contraction formula in a similar fashion, and feel strongly that this should be possible. The definition of the invariant interval is:
$$ds^2=dx^2-c^2dt^2$$
using $t=\frac{x}{v}$ I tried:
$$ds^2=dx^2-\frac{c^2}{v^2}dx^2=dx^2\left(1-\frac{c^2}{v^2}\right)\rightarrow ds=dx\sqrt{1-\frac{c^2}{v^2}}$$
This is where I'm stuck: I don't see how this can be converted to a Lorentz factor...
Any help that will allow me to arrive at the desired result $ds=\gamma dx$ would be very much appreciated.
 A: Suppose we have a rod of length $l$ at rest in the unprimed frame and we watch an observer in the primed frame speeding past:

We'll take the origins in both frames to coincide when the observer in the primed frame passes the first end of the rod, so Event A is $(0, 0)$ in both frames.
In the unprimed frame the far end of the rod is at $x = l$, and we see the speeding observer pass it at $t = l/v$, so Event B is $(l/v, l)$. The interval between these events is therefore:
$$ s^2 = \frac{c^2l^2}{v^2} - l^2 $$
In the primed frame the stationary observer sees the rod, of length $l'$ coming towards him at speed $v$. The $x$ coordinate of both events is zero, and the time of Event B is $t = l'/v$, so the interval is:
$$ s'^2 = \frac{c^2 l'^2}{v^2} $$
The intervals must be the same, $s^2 = s'^2$, so:
$$ \frac{c^2 l'^2}{v^2} = \frac{c^2l^2}{v^2} - l^2 $$
and a quick rearrangement gives:
$$ l'^2 = l^2 \left(1 - \frac{v^2}{c^2} \right) $$
$$ l' = l \sqrt{1 - \frac{v^2}{c^2} } = \frac{l}{\gamma} $$
Response to comment:
To work out the time dilation you use a different pair of events. In the unprimed frame you have a clock, ticking with period $T$, stationary at the origin. So the events for the first and second ticks are $(0, 0)$ and $(T, 0)$. The interval $s^2 = c^2 T^2$.
As usual we choose the primed frame so the origins of the frames coincide, and the first tick is at $(0, 0)$. The second tick is at $t = T'$, and because the clock is moving at velocity $v$, the $x$ coordinate of the second tick is $x = vT'$ giving $(T', vT')$. The interval is therefore $s^2 = c^2T'^2 - v^2T'^2$.
As before, we set the intervals equal so:
$$ c^2 T^2 = c^2T'^2 - v^2 T'^2 $$
or:
$$ T'^2 = T^2 \frac{c^2}{c^2 - v^2} $$
Now just divide the top and bottom of the RHS by $c^2$ and take the square root to get:
$$ T' = T \frac{1}{\sqrt{1 - v^2/c^2}} $$
