The thrust efficiency of a two-dimensional heaving airfoil is studied computationally for a low Reynolds number using a vortex force decomposition. The auxiliary potentials that separate the total vortex force into lift and drag (or thrust) are obtained analytically by using an elliptic airfoil. With these auxiliary potentials, the added-mass components of the lift and drag (or thrust) coefficients are also obtained analytically for any heaving motion of the airfoil and for any value of the mean angle of attack α. The contributions of the leading- and trailing-edge vortices to the thrust during their down- and up-stroke evolutions are computed quantitatively with this formulation for different dimensionless frequencies and heave amplitudes (Stc and Sta), and for several values of α. Very different types of flows, periodic, quasi-periodic and chaotic, are described as Stc, Sta and α are varied. The optimum values of these parameters for maximum thrust efficiency are obtained, and explained in terms of the interactions between the vortices and the forces exerted by them on the airfoil. As in previous numerical and experimental studies on flapping flight at low Reynolds numbers, the optimum thrust efficiency is reached for intermediate frequencies (Stc slightly smaller than one) and a heave amplitude corresponding to an advance ratio close to unity. The optimal mean angle of attack found is zero. The corresponding flow is periodic, but it becomes chaotic and with smaller average thrust efficiency as |α| becomes slightly different from zero.