In recent years, to quantify the quality, energy called "exergy" has been widely used in designs, simulations, and evaluation of the performance of various thermal-chemical systems. The main goal of this project is to evaluate the quality of gasoline engines and the efficiency of a gasoline engine using a mixture of gasoline and ethanol. Furthermore, the effects of 2500 rpm and 4500 rpm on analyzing the second law of thermodynamics were investigated with different fuels. The methods examined in this research include efficiency through heat transfer, irreversibility, total efficiency, and efficiency of burned fuel. The results showed that the performance parameters for gasoline and different ethanol compounds increase until the combustion stage then decrease with the beginning of the expansion phase. For fuel E85, 32.323% of the input energy is converted into indicative exergy and this value for E0, E20, E40, and E60 fuels was 26.27%, 28.5%, 30.3%, and 31.8% respectively. By increasing the amount of ethanol, the efficiency of the second law of thermodynamics increases. The second law efficiency at 4500 rpm for E0, E20, E40, E60, and E85 fuels was, 32%, 35.7% 39.8%, 42.8%, and 50% respectively. Furthermore, by reducing the speed to 2500 rpm, the efficiency for E0, E20, E40, E60, and E85 fuels reduced to 26.7%, 30.4%, 31%, 34%, and 36%, respectively.