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:
![35x+25y=1025](https://img.qammunity.org/2023/formulas/mathematics/college/lgyjy6zzy5rx5a3qj50nf0sg6bs5s3e74u.png)
We also know that the sum of their efficiencies was 35, then we have:
![x+y=35](https://img.qammunity.org/2023/formulas/mathematics/college/pjb5avu3901lwvczhnggm9z6ipq6l4xqhy.png)
Hence we have the system of equations:
![\begin{gathered} 35x+25y=1025 \\ x+y=35 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/y4c2uj5uciqkevi0jrs94ugkwojpyp10mm.png)
To find the solution of the system let's solve the second equation for y:
![y=35-x](https://img.qammunity.org/2023/formulas/mathematics/college/sful6cku0tei2hrhfg2usd2o3fm69yz9is.png)
Plugging this in the first equation we have:
![\begin{gathered} 35x+25(35-x)=1025 \\ 35x+875-25x=1025 \\ 10x=1025-875 \\ 10x=150 \\ x=(150)/(10) \\ x=15 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/ybw617tvkdboppml9fgege1ak734duc2m2.png)
Now that we have the value of x we plug it in the expression for y:
![\begin{gathered} y=35-15 \\ y=20 \end{gathered}](https://img.qammunity.org/2023/formulas/mathematics/college/j523re9pjlb19eq8npvmgjiaoinehfat2q.png)
Therefore the efficiency of the first car was 15 miles per gallon and the efficiency of the second car was 20 miles per gallon