I need help to get started with writing the equation for the following problem: It takes a freight train 2 hours longer to travel 300 miles than it takes an express train to travel 280 miles. The rate of the express train is 20 miles per hour greater than the rate of the frieght train. Find the times and rates of both trains

let the speed of freigh train be x mph

then speed of express is x+20 mph

time for freight to go 300 miles = 300/x
time for express to go 280 = 280/(x+20)

300/x - 280/(x+2) = 2
multiply by x(x+20)
300(x+20) - 280x = 2x(x+20)
300x + 6000 - 280x = 2x^2 + 40x
2x^2 + 20x - 6000 = 0
x^2 + 10x - 3000 = 0
(x+60)(x-50) = 0
since x > 0, x = 50

speed of freight = 50 mph
time for freight to go 300 miles = 6 hours

speed of express = 70 mph
time to go 280 miles = 4 hours

(sure enough the difference between their times is 2 hours.)

To write the equation for this problem, we need to define some variables. Let's say:

- Let t be the time taken by the express train to travel 280 miles.
- Let r be the rate (speed) of the express train in miles per hour.
- Since it takes the freight train 2 hours longer, the time taken by the freight train will be t + 2.
- The rate of the freight train will be r - 20 (since it is 20 miles per hour slower).

Now, let's break down the given information into equations.

1. The distance formula relates distance, rate, and time: Distance = Rate x Time. Using this formula, we can write equations for both trains:

For the express train:
Distance = Rate x Time
280 = r x t

For the freight train:
Distance = Rate x Time
300 = (r - 20) x (t + 2)

2. We have two unknowns, r and t, so we need to solve the system of equations to find their values.

Let's use the first equation to express t in terms of r:
t = 280 / r

Now, substitute t in the second equation:
300 = (r - 20) x (280 / r + 2)

3. Simplify and solve the equation by multiplying both sides by r:
300r = (r - 20)(280 + 2r)

4. Expand the right side of the equation:
300r = 280r + 2r^2 - 5600 - 40r

5. Combine like terms:
2r^2 - 60r - 5600 = 0

6. Now, we have a quadratic equation. We can solve it by factoring, completing the square, or using the quadratic formula. In this case, let's use the quadratic formula:
r = (-b ± √(b^2 - 4ac)) / (2a)

In our equation, a = 2, b = -60, and c = -5600. Substitute these values into the formula and solve for r.

Once we find the value(s) of r, we can substitute it back into the expression t = 280 / r to find the corresponding values for t.

By following these steps, we can determine the times and rates of both trains.