A numerical study of aniline production by hydrogenation of nitrobenzene (NBH) and hydrogen production by steam methane reforming (SMR) in a directly coupled membrane reactor is developed. This membrane reactor was proposed aiming to decarbonize heating in SMR and to favor the recovery of all products. Aniline recovery is improved in this reactor as water, a byproduct in NBH, is consumed in SMR. The simulation is performed using a heterogeneous-one dimensional model (Dusty gas model) and results are compared against the homogeneous model. The operating conditions of the reactor were selected using a multi-objective optimization method, genetic algorithms. The aims of the optimization were: methane conversion maximization, minimum membrane area, minimum reactor size, hydrogen yield maximization, nitrobenzene conversion maximization and the maximization of hydrogen recovery. This process was able to achieve complete conversion of methane and nitrobenzene. The hydrogen yield achieved can be as high as the maximum (∼4). 35% of this hydrogen was used as a reactant for aniline production. 99% of the unreacted hydrogen was recovered and purified. As the steam flow was minimized, aniline was obtained with a molar composition (70%), 2.1 times higher than that obtained in a conventional process for aniline production (33%). CO 2 was obtained with a purity of 97%, hence, CO 2 carbon capture and storage techniques were also favored. In addition, the energy requirements of heating of feedstock, reaction and recovery system of this novel process was 2.7 times lower than that of conventional processes carried out independently. • Operating conditions were selected through a multi objective optimization. • Energy requirements were reduced 2.7 times. • The recovery of the final products (aniline, hydrogen, and CO2) was favored. • Complete conversion of reactants was achieved. • A hydrogen efficiency of 99% was achieved.