Two light sources are at rest and at distance D apart on the x-axis of some inertial frame. They emit photons simultaneously in that frame in the positive x direction. Show that in a frame in which the sources have velocity u along the x-axis, the photons are separated by a constant distance

$\displaystyle D\sqrt\frac{c-u}{c+u}$

In frame O' in which sources are at rest

Photon 1

$\displaystyle x_1'= ct'$

Photon 2

$\displaystyle x_2'=ct'+D$

then applying the two dim lorentz transformation into frame O which is going speed u in negative x direction

$\displaystyle x_1=\gamma(c+u)t'$

$\displaystyle x_2=\gamma(c+u)t'+\gamma D$

However

$\displaystyle x_2-x_1=\gamma D$ which is not right

I have tried to eliminate the $\displaystyle t'$ but this did not help

not sure where to go now