Here are the rates of the trains:
(n represents train A's speed)
A: n
B: n + 10
We know it is 5 hours, and total distance, so:
5(n) + 5(n + 10) = 1250
5n + 5n + 50 = 1250
10n = 1200
Divide:
n = 120
One train goes 120, the other goes 130
The answer is 2x+1..... i Recommend you downloading the app called Photomath… It really helps for problems like these and any problem really.