This paper discusses the minimization of the fuel consumption of a gasoline engine through dynamic optimization. The minimization uses a mean value model of the powertrain and vehicle. This model has two state variables: the pressure in the engine intake manifold and the engine speed. The control input is the throttle valve angle. The model is identified on a universal engine dynamometer. Optimal state and control trajectories are calculated using Bock’s direct multiple shooting method, implemented in the software MUSCOD-II. The developed approach is illustrated both in simulation and experimentally for a generic test case where a vehicle accelerates from 1100 rpm to 3700 rpm in 30 s. The optimized trajectories yield minimal fuel consumption. The experiments show that a linear engine speed trajectory yields an extra fuel consumption of 13% when compared to the optimal trajectory. It is shown that, with a simple model, a significant amount of fuel can be saved without loss of the fun-to-drive.