Two spaceships approach an observer from an equal distance and from an opposite direction with an equal speed $v$ in the observer's intertial reference frame $O$. The speed of a spaceship in the intertial reference frame of the other spaceship $S$ is $0.8c$, what is the speed of one of the spaceships in $O$?
I proceeded as follows:
Let $2l'$ be the distance between the two spaceships in $S$. In S the two spaceships will collide after a time $t' = \frac{2.5l'}{c}$.
Let $\gamma$ be the squareroot of $1 - v²/c²$. In $O$ the two spaceships will collide when $vt = l$ or $v\gamma t' = \frac{l'}{\gamma}$ ($O$ has to correct for what he perceives as the time dilations and space contractions of the measurements made in $S$)
Substituting we get the equation $x(1-x^2) = 0.4$ with $x = \frac{v}{c}$, if you solve the equation you conclude that this line of reasoning was wrong (but when we replace $0.4$ by $0.375$ we do get the right solution, which is $0.5c$).
Where's the flaw?