A couple of comments here:
-you did indeed arrive at the correct quadratic equation here;
-if you ever have a factoring problem like this:
2x^2 + 20x - 4000 = 0
the first thing you should do is divide both sides by 2; as long as everything remains an integer, that will always simplify matters:
x^2 + 10x - 2000 = 0
Two numbers whose product is -2000, and which are 10 apart in absolute value: either 40 and -50 or -40 and 50. We need them to add to 10, so the factorization is:
(x - 40)(x+ 50) = 0
x = 40 or -50 --> x = 40, since x can't be negative.
-Of course, there are faster ways to arrive at an answer here. Backsolving is fairly quick if you land on the right answer early. The algebra can also be done much more quickly, if you use t = d/s. We know d = 400; let s be the speed of the slower car. Their times are 400/s and 400/(s+10). We know these times differ by 2 hours:
400/s - 400/(s+10) = 2
That's a single equation, single unknown, and leads to the factoring problem above if you find a common denominator.
Knowing how to do the algebra will definitely serve you well on the harder questions on the test- where you see fewer numbers and more letters.