.
Having the solution, as it is written and presented in the post by @josgarithmetic,
I feel the need to REWRITE it from the scratch,
since his presentation is below any acceptable level.
Let x be the car's rate, in miles per hour.
Then the car's time traveled is = hours.
According to the condition, then the train's time traveled is = = = hours.
Thus the train's rate is = = .
We are given that the difference of rates is 8 miles per hour. It means
- x = 8.
To solve this equation, multiply both sides by 5. You will get
6x - 5x = 40
x = 40.
Thus the rate of the car is 40 miles per hour.
--------------
Solved and presented in a way, as it SHOULD be DONE.