Answer: Hello there!
We know this:
The distance between the cars at t= 0 is D.
car 2 has an initial velocity of v0 and no acceleration.
car 1 has no initial velocity and a acceleration of ax that starts at t = 0
then we could obtain the acceleration of the car 1 by integrating the acceleration over the time; this is v(t) = ax*t where there is not a constant of integration because the car 1 has no initial velocity.
Because the cars are moving against each other, we want to se at what time t they meet, this is equivalent to see:
position of car 1 + position of car 2 = D
and in this way we could ignore constants of integration :D
for the position of each car we integrate again:
P1(t) = (1/2)ax*t^2 and P2(t) = v0t
v0t + (1/2)ax*t^2 = D
v0t + (1/2)ax*t^2 - D = 0
now we can solve it for t using the Bhaskara equation.
that we cant solve witout knowing the values for v0, D and ax. But you could replace them in that equation and obtain the time, where you must remember that you need to choose the positive solution (because this quadratic equation has two solutions).
Now we want to know the velocity of car 1 just before the impact, this can be calculated by valuating the time in the as the time that we just found in the velocity equation for the car 1, this is:
where again, you need to replace the values of v0, D and ax.