Let s be the speed of the slowest train and t the time it takes to travel 300 miles.
We know that:
![s\cdot t=300\text{ miles}](https://img.qammunity.org/2023/formulas/mathematics/high-school/2s48644u2lsz50igp5cjrk5zd8dnnrsine.png)
Since the second train has a speed of s+20 mph and travels the same 300 miles using 4 hours less time, then:
![(s+20mph)\cdot(t-4h)=300\text{ miles}](https://img.qammunity.org/2023/formulas/mathematics/high-school/kh0iu6h2gupme680jxfbyod3tjoq48ehjz.png)
Isolate t from the first equation:
![t=\frac{300\text{ miles}}{s}](https://img.qammunity.org/2023/formulas/mathematics/high-school/r7va1t9i0q56ew8artdjff7xptxfhc0lyp.png)
Substitute the expression for t in the second equation to find an expression only in terms of s:
![(s+20mph)(\frac{300\text{miles}}{s}-4h)=300\text{miles}](https://img.qammunity.org/2023/formulas/mathematics/high-school/a72fenzvw3cmzz9t7qmsrpx7yw9b5kzk2u.png)
Use the distributive property to rewrite the product of the quantities on the left hand side of the equation:
![\begin{gathered} (s+20mph)(\frac{300\text{miles}}{s}-4h)=300\text{miles} \\ \Rightarrow \\ (s+20\text{mph)}\cdot\frac{300\text{miles}}{s}-(s+20\text{mph)}\cdot4h=300\text{miles} \\ \Rightarrow \\ s\cdot\frac{300\text{miles}}{s}+20\text{mph}\cdot\frac{300\text{miles}}{s}-4h\cdot s-4h\cdot20\text{mph}=300\text{miles} \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/high-school/otstikb80xhpauyom6fmx96yboml2wvgtj.png)
Simplify the products when possible. 4h times 20 mph is equal to 80 miles:
![300\text{miles}+\frac{(20\text{mph)}(300\text{miles)}}{s}-4h\cdot s-80\text{miles}=300\text{miles}](https://img.qammunity.org/2023/formulas/mathematics/high-school/rfxnaglgika96uw1obsnukhs0o0meexlft.png)
Substract 300 miles from both sides of the equation:
![\frac{(20\text{mph)}(300\text{miles)}}{s}-4h\cdot s-80\text{miles}=0](https://img.qammunity.org/2023/formulas/mathematics/high-school/r72dzru2m21xkfha2epdqynaoi140j902h.png)
Multiply both sides by s:
![(20\text{mph)}(300\text{miles)}-4h\cdot s^2-80\text{ miles}\cdot s=0](https://img.qammunity.org/2023/formulas/mathematics/high-school/560gd2j5mpgwizlppn0li0bzz7reet68hn.png)
This is a quadratic equation for s. Write the equation in standard form:
![-4h\cdot s^2-80\text{ miles}\cdot s+(20\text{ mph})(300\text{miles)}=0](https://img.qammunity.org/2023/formulas/mathematics/high-school/i65sb4v35kwox350g2ks6bde2qli27bbzh.png)
Use the quadratic formula to isolate s:
![s=\frac{80\text{ miles}\pm\sqrt[]{(80\text{ miles})^2-4(-4h)(20mph)(300miles)}}{2(-4h)}](https://img.qammunity.org/2023/formulas/mathematics/high-school/415bj6sxfmv8msyqph5h4oho893i5a55iq.png)
Observe that the term -4(-4h)(20mph)(300miles) is equal to +96000 squared miles, and 80 miles squared is equal to 6400 squared miles:
![s=\frac{80\text{ miles}\pm\sqrt[]{6400+96000}\text{ miles}}{-8h}](https://img.qammunity.org/2023/formulas/mathematics/high-school/4w76e5fus66ej2td5av14t2rzouakqjeft.png)
Factoring out the units, we get:
![s=\frac{80\pm\sqrt[]{102400}}{-8}\text{ mph}](https://img.qammunity.org/2023/formulas/mathematics/high-school/5elrveg7zy8extx9akn0ks4anr8zfv4ope.png)
Since the square root of 102400 is equal to 320:
![s=(80\pm320)/(-8)\text{mph}](https://img.qammunity.org/2023/formulas/mathematics/high-school/ry844vsv895mdnopkmvw503p3llc6xxsxb.png)
Taking the positive value of the plus/minus sign, we get:
![s=(80+320)/(-8)\text{ mph}=(400)/(-8)\text{ mph }=-50\text{ mph}](https://img.qammunity.org/2023/formulas/mathematics/high-school/iqf1gax2ky7lbu24ji7uzth9ifjsnct3hx.png)
Taking the negative value of the plus/minus sign, we get:
![s=(80-320)/(-8)\text{ mph}=(-240)/(-8)\text{ mph}=30\text{ mph}](https://img.qammunity.org/2023/formulas/mathematics/high-school/jpby1agc2v8lxbrzwhkeupn779lzytb020.png)
Since we first stated that s*t=300 miles and the time cannot be a negative number, the only acceptable answer is s=30 mph.
Since the velocity of the second train is s+20 mph and s=30mph, then the velocity of the second train is 50 mph.
Check the answer by verifying if all the conditions are satisfied. The problem says that the second train arrives 4 hours earlier.
The first train takes a time of 300 miles / 30 mph = 10 h.
The second train takes a time of 300 miles / 50 mph = 6h, 4 hours earlier.
Therefore, the velocities of the trains are 30 mph and 50 mph.