Conservation of energy look it up.
The required kinetic energy to accelerate and then keep a vehicle at velocity, plus waste heat is easily calculated, a highschool student can do it. The amount of energy in a gallon of gasoline is known, these numbers have to match.