Let x be the efficiency for the first car and let y be the efficiency for the second car.
We know that the firt car consumed 35 gallons, the second 25 gallons and that they drove a combined total of 1025 miles, then we have the equation:
[tex]35x+25y=1025[/tex]We also know that the sum of their efficiencies was 35, then we have:
[tex]x+y=35[/tex]Hence we have the system of equations:
[tex]\begin{gathered} 35x+25y=1025 \\ x+y=35 \end{gathered}[/tex]To find the solution of the system let's solve the second equation for y:
[tex]y=35-x[/tex]Plugging this in the first equation we have:
[tex]\begin{gathered} 35x+25(35-x)=1025 \\ 35x+875-25x=1025 \\ 10x=1025-875 \\ 10x=150 \\ x=\frac{150}{10} \\ x=15 \end{gathered}[/tex]Now that we have the value of x we plug it in the expression for y:
[tex]\begin{gathered} y=35-15 \\ y=20 \end{gathered}[/tex]Therefore the efficiency of the first car was 15 miles per gallon and the efficiency of the second car was 20 miles per gallon