Answer: 15 gallons and 35 gallons were consumed by first and second car respectively.
Step-by-step explanation:
Since we have given that
Number of gallons of total gas consumption = 50
Number of total miles = 1700
Efficiency of first car = 20 miles per gallon
Efficiency of second car = 40 miles per gallon
Let the number of gallons consumed by first car be 'x'.
Let the number of gallons consumed by second car be '50-x'.
According to question, we get that
[tex]20x+40(50-x)=1700\\\\20x+2000-40x=1700\\\\-20x=1700-2000\\\\-20x=-300\\\\x=\dfrac{300}{20}=15[/tex]
So, 50-x = 50-15 = 35 gallons.
Hence, 15 gallons and 35 gallons were consumed by first and second car respectively.