Can you do it using variable and s=d/t formula

Module 0 Week 3 Day 9 Your Turn Explanation Part 3
Can you please explain to me how Prof Loh did the ratio problem. I didn't understand it at all? If possible can you do it using variable and s=d/t formula because I am a physics guy and is used to variables and so understand the concept better by looking at variables. Thank you!

@fabulousgrizzly Certainly, I'm happy to help explain two different ways to solve this Your Turn question, which I'll repeat here for convenience: "You're driving a freight train away from Los Angeles at 20 miles per hour, and notice that passenger trains pass you from behind every 60 minutes, moving at 60 miles per hour. How many minutes apart do the passenger trains depart from Los Angeles?"
First way (Rate equation):
The first step is to find the distance between the faster passenger trains. Once we have this, then we can solve for the minutes between each passenger train departure from the station.
This distance is equivalent to the extra distance that a passenger train overtakes us by after one hour.
Why is this true? It's because after one hour, the second train has caught up to us, so the distance between passenger trains is really the distance between our train and first passenger train.
How many miles did the faster passenger train overtake us by?
Since our train goes at \(20\) mph and the passenger train goes at \(60\) mph, the relative speed of the train compared to us is
$$ \text{ relative speed } = 60  20 = 40 \text{ } \frac{\text{miles}}{\text{hour}} $$
We want the distance between the first passenger train and our train after \(1\) hour, so here \(t = 1 \text{ } \text{hour},\) and we can use the rate equation to solve for the distance \(d:\)
$$\begin{aligned} d &= v_{relative}t \\ d &= 40 \text{ } \frac{\text{miles}}{\text{hour}} \times 1 \text{ } \text{hour} \\ d &= 40 \text{ } \text{miles} \\ \end{aligned} $$Then, since the second passenger train has caught up to us by this time,
$$ \text{ distance between us and the first passenger train } = \text{ distance between the first passenger train and the second passenger train}$$
Thus there are \(40 \text{ } \text{ miles }\) between two adjacent passenger trains, and we can find the hours between their departures using
$$\begin{aligned} t &= \frac{d}{v} \\ t &= \frac{40 \text{ } \text{ miles} }{60 \text{ } \frac{\text{miles}}{\text{hour}}} \\ t &= \frac{2}{3} \text{ } \text{hour} \\ \end{aligned} $$Converting this to minutes, we get \(\frac{2}{3} \text{ } \text{hour} \times 60 \frac{\text{min}}{\text{hour}} = \boxed{40 \text{ } \text{minutes.}} \)
Second way (Prof. Loh's Way, Using a diagram):
Our train goes \(20\) miles in one hour. Now let's add in the passenger train, which has caught up to us at the start, where \(t = 0 \text{ } \text{minutes}.\)
After \(1\) hour, the passenger train has covered \(60\) miles, which is three times the distance that we have gone. Let's mark off three sections: we travel one section, and the passenger train travels three sections.
The next passenger train, colored in \( \textcolor{purple}{\text{purple}},\) is there too.
Now, to find the distance between the two passenger trains, we just count the number of sections. There are two sections, and each section corresponded to \(20\) miles, so there are \(40\) miles between adjacent passenger trains.
To find the time between departures of the passenger trains, notice that they go at the speed of \(60 \text{ } \frac{\text{miles}}{\text{hour}},\) which is the same as \(1 \text{ } \frac{\text{mile}}{\text{min}}.\)
The passenger train takes \(40\) minutes to travel \(40\) miles, so the time between departures of the passenger train is \(\boxed{40 \text{ } \text{minutes}}.\)