First step in a word problem like this is to assign variables. Since we're looking for the gallons consumed by each car, let A be the gallons consumed by the first and B be the gallons consumed by the second. Then, distance will be mileage times fuel consumed, so
Distance by first car = 30A
Distance by second car = 20B
We know that the total was 45 gallons, so
A + B = 45
and we know that the total distance was 1200 miles, so
30A + 20B = 1200
If we solve the first equation for A, we get
A = 45 - B
We can then substitute this into the second equation to get
30(45 - B) + 20B = 1200
1350 - 30B + 20B = 1200 (multiplying out the parenthesis)
-10B = -150 (subtracting 1350 from both sides and simplifying)
B = 15 (dividing by -10)
Therefore,
A = 45 - B = 45 - 15 = 30
To doublecheck our work, we see that A + B = 30 + 15 = 45 and that
30A + 20B = 30*30 + 20*15 = 900 + 300 = 1200.
So the first car used 30 gallons and the second car used 15 gallons.
If you still have any questions on that, please let me know.
Whitnee S.
12/21/16