Freight Train

The engineer of a train moving at a speed sights a freight train a distance d ahead of him on the same track, moving in the same direction with a slower speed
He puts on the brakes and gives his train a constant deceleration

Show that:
At the first moment, the relative speed between the two trains is
If the two trains reach a relative speed of 0 they will crash.

We need the formula:
This formula is in your book, but you can also get it by taking and plugging it into the formula
In our case we take the relative speed between them as v(t), and and if the trains will not collide.