Using the magic of algebra!:
The time each train goes in 1 hour will be represented as a / b.
b is 30 more than a, so if we add 30 to a it should equal b.
a + 30 = b
In three hours, the trains are 330 miles apart.
Esentially, we're adding up the distance each train goes from the starting point to find the distance between them.
3b + 3a = 330
Now we have a system of equations to solve.
a + 30 = b
3b + 3a = 330
We want to get the variables on seperate sides of the equation for easy solving.
a + 30 = b
3b = 330 - 3a
Then get the value of the one variable the same so we can use the transitive property.
a + 30 = b
b = 110 - a
a + 30 = 110 - a
2a + 30 = 110
2a = 80
a = 40 mph
(And thus b = 70 mph)