In order to reduce the investment of corrosion inhibitors, based on experimental and theoretical studies, the corrosion inhibition and mechanism of new imidazoline derivatives (SMIS) and 2‐aminopyridine (AMP) were investigated carefully. The best corrosion inhibition effect was at 0.7‐g/L SMIS and 0.3‐g/L AMP, the corrosion inhibition efficiency of weight loss, electrochemical impedance spectroscopy, and potentiodynamic polarization (Tafel) were 90.54%, 98.56% and 97.68%, respectively. Electrochemical research shows that SMIS& belongs to cathodic corrosion inhibition. SMIS& mainly increased the film resistance and charge transfer resistance in 1‐M HCl, thus playing a certain role in corrosion inhibition. X‐ray photoelectron spectroscopy and energy dispersive spectrometer proved that SMIS& can be adsorbed on the surface of Q235, molecular dynamics showed that there was a certain synergy between SMIS and AMP. This study confirmed that SMIS and AMP have a good synergistic effect, improve the corrosion inhibition efficiency, reduce the synthesis cost of SMIS, and have a certain guiding significance for synergistic corrosion inhibition.