Explanation:
let's think this through.
train a goes from A to B in 6 hours. that means with a speed of 1/6 / hour.
train b goes from B to A in 3 hours, so it is twice as fast as train a = 2/6 / hour.
when train b leaves B (at 7pm), train a was already traveling for 2 hours (1/3 of the whole trip) leaving it with 4 hours to go (2/3 if the distance).
that means that at that point now both trains are moving against each other with a relative speed of 3 times the
speed of a (the original speed of a plus the double speed of b).
this is the same as one train standing, and the other going the whole distance with 3 times the speed of a.
the whole distance is 2/3 of AB.
the speed is 3/6 / hour = 1/2 / hour.
so, a single train with that speed would cover the total distance AB in 2 hours. or half of the distance in 1 hour.
the question now, how long for 2/3 of AB.
the distances relate by a factor :
1/2 × f = 2/3
f = 2/3 / 1/2 = 2/3 × 2/1 = 4/3
now we need to multiply also the time in the distance/time speed ratio by this factor.
therefore, 2/3 of the total distance is done in 1×4/3 = 4/3 of an hour.
that means both trains meet after 4/3 of an hour after 7pm.
that is 7pm plus 1 hour and 20 minutes giving us 8:20pm.