As they are traveling in opposite directions you need to do 50 + 40 to find out how far apart they travel every hour. 50 + 40 = 90. So you know that they are 90 miles apart every hour. 180 / 90 = 2. so you know that it takes them 2 hours to be 180 miles apart.