Explanation:
x = speed of the passenger train
x - 15 = speed of the freight train
remember, the passenger train is traveling 15 mph faster than the freight train. that also means the freight train travels 15 mph slower than the passenger train.
we could define the variable also the other way around (x = freight train, x + 15 = passenger train).
speed = distance/time period
distance = speed × time period
so,
x×4 + (x - 15)×4 = 260
because when both trains meet somewhere in the middle, it means that the sum of both of their ways traveled is the whole distance between both cities : 260 miles.
4x + 4x - 60 = 260
8x = 320
x = 320/8 = 40 mph
so, the passenger train traveled at 40 mph.
the freight train traveled at 40-15 = 25 mph.