We'll use variables to represent the speeds of the eastbound and westbound trains.
x will represent the speed of the eastbound train.
y will represent the speed of the westbound train.
The eastbound train is 16 mph faster than the westbound train. An equation can be made from this:
![x - y = 16](https://img.qammunity.org/2019/formulas/mathematics/high-school/6a3j3g5ylvfdhc1q9io8gvmlbfj6dmf387.png)
Subtraction is used, because it represents the difference in distances between the two trains if they travel the same direction.
After 4 hours, the trains are 800 miles apart. An equation can be made from this:
![4x + 4y = 800](https://img.qammunity.org/2019/formulas/mathematics/high-school/mww1cf27k2ytumfyt9vgzcsreh2n05jzbm.png)
Addition is used, because the trains are heading in opposite directions, which means their distances from the starting point are added together.
Set the two equations up vertically:
![x - y = 16](https://img.qammunity.org/2019/formulas/mathematics/high-school/6a3j3g5ylvfdhc1q9io8gvmlbfj6dmf387.png)
![4x + 4y = 800](https://img.qammunity.org/2019/formulas/mathematics/high-school/mww1cf27k2ytumfyt9vgzcsreh2n05jzbm.png)
We will use elimination to solve for x.
Multiply the entire first equation by 4 so that the coefficients for y will be opposite numbers:
![(x - y = 16) * 4 = 4x - 4y = 64](https://img.qammunity.org/2019/formulas/mathematics/high-school/esageemo8soydbi3a9npmhb6kavj5vuwj7.png)
![4x - 4y = 64](https://img.qammunity.org/2019/formulas/mathematics/high-school/3igk6v2gyazzdehnteenpj0lzknhycjb07.png)
![4x + 4y = 800](https://img.qammunity.org/2019/formulas/mathematics/high-school/mww1cf27k2ytumfyt9vgzcsreh2n05jzbm.png)
Combine the two equations together to cancel out y:
![8x = 864](https://img.qammunity.org/2019/formulas/mathematics/high-school/ypfuwzhhvyg15te0hi7nsbi7sz9egg0do6.png)
Divide both sides by 8 to get x by itself:
![x = 108](https://img.qammunity.org/2019/formulas/mathematics/high-school/x58h4lpndc28uoiyhc41dpe7lnq1cke3ac.png)
The speed of the eastbound train is
108 mph.