In the present investigation, an environmental, thermal, economic, and social analysis of an integrated system is carried out, which has as its function the production of hydrogen through the recovery of residual thermal energy from exhaust gases. The proposed integrated system consists of a thermoelectric generator and a hydrogen production bench based on the water electrolysis process. For the development of the research, an internal combustion engine fueled with natural gas was used, operating under four load conditions (25%, 50%, 75%, and 100%). From the environmental assessment, it is demonstrated that the implementation of the integrated system allows a decrease of 12.30%, 6.26%, and 7.90% in CO, CO2, and HC emissions. However, the addition of hydrogen causes a 9.9% increase in NOx emissions. Additionally, the implementation of the integrated system allows a 4.9% decrease in brake specific fuel consumption and a 4.9% increase in engine thermal efficiency. The improvement in engine thermal performance contributes to the 7% reduction in engine operating costs. On the other hand, it demonstrates an 8.7% reduction in the environmental and social impact cost and a 9% reduction in the ecological cost. Additionally, the integrated system minimizes the cost of environmental and social impact, as well as the ecological cost of polluting gases CO, CO2, and HC. The mixture of natural gas and hydrogen allows for a 4.70% and 7.59% increase in pressure and maximum heat release rate. In general, the proposed integrated system is a way to harness the thermal energy of exhaust gases for hydrogen production. In this way, it is possible to obtain an auxiliary fuel that improves the efficiency of the combustion process of the natural gas engine. This allows for minimizing energy losses in self-generation activities in Colombia, achieving better energy management and a reduction in operating costs.