1 Introduction

Mild steel is an affordable engineering material by virtue of its properties such as strength, ductility, toughness, malleability, machinability and weldability. It finds applications in automobile body components, structural shapes, sheets, etc. The microstructure consists of ferrite and pearlite and has tensile strength in the range 415–550 MPa [1]. Material is used in various environments including mild acidic environments and can undergo electrochemical oxidation resulting in destruction of metal. This corrosion induced in the material, besides loss in weight and cross section, can lead to hostile effects on the material properties [2] Corrosion of MS is an important problem in industrial processes having acid environment. In the construction of oil, gas or water wells, pickling acid washing, matrix acidizing and acid fracturing are operations performed during the production stimulation processes [3]. Generally, acid solutions are used at room temperature for removing soil and light rust [4]. For example, in acid pickling, these are widely used as it is more economical and trouble free. The main advantage of these acids over other acids in cleaning and pickling operations lies in their ability to form metal chloride and metal sulphates which are fairly soluble in aqueous medium, compared to phosphate, nitrate and sulphamate ions [5]. But extreme care has to be taken in handling it even in small concentration as it is corrosive to many metals including MS. Hence, the destruction in acid environment is more crucial to be addressed as huge amount of material loss occurs worldwide due to acid wash every year.

Even though various techniques like surface modifications, anodic and cathodic protections, and coating (painting) for the metal are available, the use of inhibitors in the medium is found to be one of the simple and cost-effective choices to protect metals against corrosion, particularly for a closed system [6]. Some organic compounds containing electron donating groups or polar functional groups, heteroatoms, aromatic rings with π- electrons are widely used as effective corrosion inhibitors in industrial applications for various metals including MS. These inhibitors get adsorbed on the metal surface either chemically or physically forming a blanket on the metal surface, and thus isolate metal from the corrosive ions present in the medium [7, 8].

The well-known biological applications of hydrazides and their condensation products are in using them as antibacterial, antituberculosis and antifungal [9, 10]. The chemistry of –CN group of hydrazides is becoming the backbone of condensation reaction in benzo-fused heterocycle [11] and also it constitutes an important class of compounds for developing new drugs [12]. The ability of the hydrazide derivatives [13,14,15,16,17], thiosemicarbazide derivatives, thiosemicarbazone, hydrazone derivatives [18,19,20,21] to inhibit corrosion of MS in acid medium is well established due to the presence of electron donating groups, heteroatoms, π- electrons and lone pair of electrons in them. The formation of an adsorption film on the metal surface is determined by the planarity of the entire structure of the compound [22, 23].

Saliyan et al. [13, 20] have investigated the effect of quinoline-based hydrazide derivatives (QH 1 and QH2) on mild steel in HCl and H2SO4. QH 1 showed the maximum efficiency of 90.8% in 1 M HCl and 86% in 2 M HCl at 500 ppm, respectively, whereas QH2 showed maximum efficiency of 94.8% in 1 M HCl and 98.5% in 0.5 M H2SO4 at 11.086 × 10–4 M at 60 °C, respectively. The influence of N'-(4-methoxybenzylidene) benzohydrazide as corrosion inhibitor for mild steel in 1 M HCl was studied by Mohan et al. [14]. The inhibitor showed maximum IE of 93% and followed Langmuir’s adsorption. Several benzohydrazide derivatives were studied as potential inhibitors towards steel corrosion in HCl medium by Fouda et al. [15]. All the studied compounds exhibited an average IE in the range of 80% at their optimum concentration. The adsorption takes place through physisorption and obeyed Langmuir adsorption isotherm. Yadav et al. [16] discussed the inhibition performance of two acetohydrazide derivatives on mild steel in 15% HCl. Both the derivatives showed more than 90% inhibition efficiency at 400 ppm.

This work aims at investigating the corrosion inhibition behaviour of N-[(3,4-dimethoxyphenyl) methyleneamino]-4-hydroxy-benzamide (DMHB) on MS in 0.5 M H2SO4 (of pH 0.29) and 0.5 M HCl (of pH 0.3) using electrochemical techniques. DMHB is basically a Schiff base compound obtained by the simple condensation of aromatic aldehyde and benzo-fused hydrazide. It includes an imine group (containing π electrons and lone pair of electrons on the nitrogen atom), two phenyl units and electron-rich oxygen atoms in the moiety. The presence of two electron donating methoxy groups, one hydroxyl and carbonyl group play a significant role in enhancing the inhibition efficiency of DMHB, which is further compared with structurally similar reported compounds. The activation and thermodynamic parameters were calculated for the dissolution process (corrosion) and adsorption process (protection), respectively. SEM and AFM were carried out for the MS coupons exposed to acids with and without the inhibitor. DFT calculations were done and the values obtained were in agreement with the experimental results.

2 Experimental Details

2.1 Material

MS (skin rolled plain carbon steel) rod having composition (%wt), C: (0.17); Si: (0.16); Mn: (0.41); P: (0.06); S: (0.05); Cr (0.02) and Fe (Balance) was used in this investigation. The cylindrical coupon of 1 cm2 area of cross section was prepared and it was mounted using cold setting resin. The exposed flat surface of the mounted sample was disc polished with levigated alumina as per standard metallographic practice.

2.2 Preparation of DMHB

The inhibitor N'-(3,4-dimethoxybenzylidene)-4-hydroxybenzohydrazide (DMHB) was synthesized as per the reported procedure [24] and characterized using 1H NMR spectroscopic technique. The synthetic route for the preparation of DMHB is given in scheme 1.

Scheme 1
scheme 1

Synthetic route for DMHB

2.3 Preparation of Medium

The AnalaR Grade acids (Merck) and distilled water were used for the preparation of the aggressive solutions. 0.5 M HCl was prepared by using HCl (37%) and 0.5 M H2SO4 prepared using H2SO4 (98%). DMHB inhibitor solution of 5 mM was first prepared by dissolving the calculated quantity of the DMHB separately in 0.5 M HCl and 0.5 M H2SO4 solution. The required concentration of inhibitor solutions was then prepared by dilution method using prepared acids.

2.4 Electrochemical Measurements

Since corrosion is an electrochemical process, electrochemical methods of determination of corrosion rates are adopted. Potentiodynamic polarization (PDP) and electrochemical impedance spectroscopy (EIS) studies were done using electrochemical workstation with beta software. The corrosion study cell consisted of saturated calomel electrode (reference electrode), platinum electrode (counter electrode) and working electrode, i.e. MS as mounted sample. The PDP studies were conducted by measuring the current continuously by altering the potential of the metal from − 0.25 V cathodic to + 0.25 V anodic with respect to open-circuit potential (OCP) with a scan rate of 0.001Vsec─1. Extrapolating the linear portion of cathodic and anodic polarization curves in the potential versus log (current density) to meet at the intersection point corresponding to corrosion potential (Ecorr) and corrosion current density (icorr). Corrosion rate was calculated using Eq. (1) given below [24].

$${\text{CR}}({\text{mmy}}^{ - 1} ) = \frac{{3270 \times EW \times i_{{{\text{corr}}}} }}{d}.$$
(1)

The constant, 3270, indicates the conversion unit, icorr is corrosion current density in A cm−2, d is the density of the corroding metal (7.725 g cm−3), and EW (equivalent weight) equal to M/Z where M is atomic mass of the metal (55.85) and Z is the number of electron transferred per metal atom (Z = 2). The percentage inhibition efficiency (% IE) of the compound and surface coverage on the metal surface by the inhibitor (θ) are calculated using Eqs. (2) and (3), respectively.

$${\text{IE}}(\% ) = \frac{{i_{{{\text{corr}}}} - i_{{\text{corr(inh)}}} }}{{i_{{{\text{corr}}}} }} \times 100$$
(2)

where icorr represents the corrosion current density in uninhibited solution and icorr (inh) is in the inhibited condition [25].

$$\theta = \frac{IE(\% )}{{100}}.$$
(3)

In Electrochemical impedance spectroscopy studies, the frequency ranges of 100 kHz to 0.01 Hz and small amplitude AC signal of 10 mV at the OCP were applied. The real (resistance) and imaginary (capacitance) components of the impedance response of the system were recorded by the EIS instrument. Depending upon the shape of the EIS spectrum, different circuit models were tried to fit in for the Nyquist plot using ZSimpWin software of version 3.21.

The % IE is calculated using Eq. (4).

$${\text{\% IE}} = \frac{{R_{{\text{ct(inh)}}} - R_{{{\text{ct}}}} }}{{R_{{\text{ct(inh)}}} }} \times 100,$$
(4)

where Rct(inh) and Rct are the charge-transfer resistances obtained under condition of inhibited and uninhibited solution, respectively [26].

The double-layer capacitance (Cdl) was calculated using Eq. (5).

$$C_{{{\text{dl}}}} = \frac{1}{{2\pi R_{{{\text{ct}}}} f_{\max } }},$$
(5)

where fmax is the frequency at the top of the semicircle (where-Z'' is maximum).

2.5 Surface Characterization

The SEM and AFM images were recorded using analytical scanning electron microscope (JEOL JSM-6380 L) model and 1B342 Innova model, respectively. The polished MS specimen was first dipped in acid solution for about 3 h, then gently washed with distilled water, and dried and its SEM and AFM images were taken. Similarly, the above procedure was then repeated with MS specimen immersed in acid medium with DMHB.

2.6 Quantum Chemical Study

Corrosion inhibition effectiveness is dependent on the molecular structure of the inhibitor. The quantum chemical parameters of DMHB were evaluated using Gaussian maestro material science software with the correlation factor (B3LYP) and 631 + G as basis set [27]. DFT calculations were used to arrive at the optimized structure of DMHB with definite highest and lowest occupied molecular orbital levels.

3 Results and Discussion

3.1 Characterization of DMHB

Characterization of inhibitor compound was done by recording H1 NMR spectra of DMHB.

Molecular formula: C16H16N2O4.

1H NMR: δ = 3.38 (d, 6H, OCH3), δ = 11.512 (s,1H, OH), δ = 10.097 (s,1H, NH), δ = 8.351(CH = N), δ = 6.8–7.8 (Ar.CH). Fig. 1 represents the 1H NMR spectrum of DMHB molecule.

Fig. 1
figure 1

1H NMR spectrum of DMHB

3.2 Potentiodynamic Polarization Studies

The Tafel polarization technique was used in studying the rate of corrosion of MS in acid media and role of the inhibition effect of DMHB. The dissolution of the MS in 0.5 M H2SO4 and 0.5 M HCl solution at 303 and 323 K with and without the inhibitor DMHB is shown by the Tafel polarization curves in Fig. 2a, b respectively. Eqs. (1), (2) and (3) were used to calculate CR, % IE and θ [28].

Fig. 2
figure 2

PDP curves for mild steel with varying concentrations of DMHB a 0.5 M H2SO4 at 313 K and b 0.5 M HCl at 303 K

Electrochemical corrosion kinetic parameters such as Ecorr, icorr, % IE, cathodic slope (βc), anodic slope (βa) and CR are obtained for 0.5 M H2SO4 and 0.5 M HCl and given in Tables 1 and 2. From the tables, it is seen that in the absence of DMHB, the CR increases with increase in temperature due to increase in the conductance of the medium as well higher dissolution of metal because of overcoming the binding energy. Addition of DMHB resulted in an increase in % IE which is due to its blockading effect, i.e. bonding interaction with the MS surface due to greater electron density present at active functional groups in DMHB. In the present study, the maximum inhibition efficiency obtained is 86% in 0.5 M H2SO4 and 81% in 0.5 M HCl at 303 K. For the same concentration (3 × 10–3) M of inhibitor, the % IE of DMHB was more in 0.5 M H2SO4. This may be due to the fact that H2SO4 with two protons will stimulate the constituents of DMHB to the greater extent than HCl and helps DMHB to adsorb to a greater extent. Though H2SO4 is a dibasic acid, pH of 0.5 M H2SO4 is 0.29 which is almost equal to that of 0.5 M HCl (pH 0.3). Besides the surface damaging nature of Cl causing the desorption of inhibitor molecules is more than that of SO42−. Since the maximum displacement in Ecorr is found to be less than ± 20 mV, DMHB acts as mixed type of inhibitor affecting both hydrogen evolution and metal dissolution to the same extent [28, 29]. Further, there is not much variation observed in the values of βc and βa in the absence and presence of DMHB. This suggests that the mechanism of corrosion and its inhibitive action remains unchanged [30].

Table 1 PDP results for mild steel corrosion in 0.5 M H2SO4 with and without the inhibitor DMHB at different temperatures
Table 2 PDP results for mild steel corrosion in 0.5 M HCl with and without the inhibitor DMHB at different temperatures

3.3 Evaluation of Kinetic Parameters

Usually, the corrosion rate increases with the increase in temperature in all corrosive medium and especially in acid medium the over potential decreases due to the evolution of hydrogen [31]. From Tables 1 and 2, it is seen that with the increase in temperature, inhibition efficiency decreases in both 0.5 M H2SO4 and 0.5 M HCl. This is because at increased temperature, dissolution rate of the metal is high and there is the possibility of desorption of the adsorbed inhibitor molecules from the metal surface. Arrhenius equation (Eq. (6)) was used for calculation of the activation energy (Ea) from corrosion rate of MS in the acid medium [32].

$$\ln \left( {CR} \right) = B - \frac{{E_{a} }}{RT},$$
(6)

where B is Arrhenius pre-exponential constant, T is temperature and R is universal gas constant.

Figure 3a, b is the Arrhenius plot of ln (CR) v/s 1/T and from this straight line graph, the slope (Ea/R) was obtained. From the slope, the activation energy was calculated. According to Bentiss et al. [33] and Hegazy et al. [34], (a) if inhibition efficiency of inhibitor increases with increase in the temperature, then the energy of activation is smaller for inhibited solution in comparison with uninhibited solution. (b) If there is no change in the inhibition efficiency of inhibitor, then energy of activation values remains constant. (c) If inhibition efficiency of inhibitor decreases with increase in the temperature, then the energy of activation is higher for inhibited solution in comparison with uninhibited solution. The Ea values obtained for 0.5 M H2SO4 and 0.5 M HCl are given in Table 3. In both the acid solutions, in the presence of DMHB, the Ea values are greater than in its absence. The increase is proportional to the inhibitor concentration which indicates the increase in the energy barrier for corrosion reaction.[29].

Fig. 3
figure 3

Arrhenius plot of ln(CR) v/s (1/T) for mild steel in a 0.5 M H2SO4 and b 0.5 M HCl solutions with varying concentrations of DMHB

Table 3 Activation parameters for the corrosion of mild steel in 0.5 M H2SO4 and 0.5 M HCl solutions containing different amounts of DMHB

The enthalpy and entropy of activation for metal dissolution is evaluated using the transition state equation:

$$CR = \frac{RT}{{Nh}}\exp \left( {\frac{{\Delta S^{\# } }}{RT}} \right)\exp \left( {\frac{{ - \Delta H^{\# } }}{RT}} \right),$$
(7)

where h is Planck’s constant and N is Avogadro’s number. Plot of ln (CR/T) v/s 1/T shown in Fig. 4a, b gives a straight line with slope \(\frac{{-\Delta H}^{\#}}{RT}\) and intercept ln (R/Nh) + (ΔS#/R). With increase in inhibitor concentration, the activation energy increases indicating that adsorption of DMHB takes place. The negative values of entropy (ΔS#) imply that there is a decrease in randomness in moving from the reactants to the activated complex [35].

Fig. 4
figure 4

Plot of ln(CR/T) v/s 1/T for mild steel in a 0.5 M H2SO4 and b 0.5 M HCl solutions with varying DMHB concentrations

Thermodynamic calculations are helpful to understand the feasibility of corrosion process. The tendency of the material to corrode depends upon the energy associated with the chemical reaction occurring during the corrosion process [36]. The data obtained for θ were fitted into different adsorption isotherms and the best fit was for Langmuir adsorption. Fig. 5a, b shows linear plots of Cinh/θ v/s Cinh for both 0.5 M H2SO4 and 0.5 M HCl. The Langmuir equation assumes that the adsorption reaction involves the formation of unimolecular layer with a constant energy of adsorption. Langmuir isotherm points to homogeneous adsorption over the metal surface, wherein the inhibitor molecule has constant enthalpies and adsorption activation energy [37].

Fig. 5
figure 5

Langmuir adsorption isotherm of mild steel in a 0.5 M H2SO4 and b 0.5 M HCl solutions

The conventional form of the Langmuir isotherm is expressed as in Eq. (8):

$$\frac{{C_{{{\text{inh}}}} }}{\theta } = \frac{1}{K} + C_{{{\text{inh}}}},$$
(8)

where the concentration of inhibitor is Cinh and Kads is the equilibrium constant for adsorption process and these are obtained from the inverse of Langmuir’s plot. The values of Kads indicate that a stable adsorbed layer is formed on the surface of the metal. It also represents the strength between adsorbate and adsorbent. Larger values of Kads indicate efficient adsorption and hence better inhibition efficiency. In the present study, Kads values decreased with increase in the temperature suggesting that adsorption of DMHB on MS surface was not favourable at higher temperature [38, 39]. The small deviations in the curve might be because of the interaction of the adsorbed species replacing the water molecules that were previously adsorbed.

The standard free energy change of adsorption (Δads) is related to the Kads by the relation:

$$K = \frac{1}{55.5}\exp \left( {\frac{{ - \Delta G^\circ_{{{\text{ads}}}} }}{RT}} \right),$$
(9)

where R is universal gas constant, and T is absolute temperature. 55.5 is the concentration of water in solution in mol dm−3. Table 4 gives the thermodynamic parameters derived from Langmuir adsorption isotherms for the studied compound. The negative values of ΔG°ads show the adsorption process is spontaneous and the adsorbed layer is stable [40].

Table 4 Thermodynamic parameters for the corrosion of mild steel in 0.5 M H2SO4 and 0.5 M HCl solutions containing different amounts of DMHB

Plot of Δads v/s T is shown in Fig. 6a, b. Entropy of adsorption (ΔS°ads) and enthalpy of adsorption (ΔH°ads) are the adsorption parameters that can be obtained from the slope and the intercept of the graph using Eq. (10):

$$\Delta G^{{\text{o}}}_{{{\text{ads}}}} = \, \Delta {\text{H}}^{{\text{o}}}_{{{\text{ads}}}} - T\Delta S^{{\text{o}}}_{{{\text{ads}}}}.$$
(10)
Fig. 6
figure 6

Plot of ΔG°ads v/s T for the adsorption of mild steel in a 0.5 M H2SO4 and b 0.5 M HCl solutions

Generally, the Δads values of − 20 kJ mol−1 or less negative are associated with physisorption and those with -40 kJ mol−1 or more negative involve chemisorption [41].

The Δads values for the DMHB in 0.5 M H2SO4 and 0.5 M HCl lie between − 20 and − 40 kJ mol−1. The negative values of ΔH°ads suggest that the adsorption of inhibitor on MS follows physisorption. The negative ΔS°ads values in both 0.5 M H2SO4 and 0.5 M HCl indicate that decrease in randomness takes place on moving from the reactant to the adsorbed species [42].

3.4 Electrochemical Impedance Spectroscopy (EIS) Studies

The characteristic features and kinetics of the electrochemical reactions that occur at the interface of MS and acid media can be determined by EIS technique. The impedance responses of MS without and with different concentrations of DMHB at different temperature ranges in both acids separately were studied by EIS and are expressed in terms of Nyquist plot as shown in Fig. 7a, b. These plots are non-ideal and consist of depressed semicircles. The slight deviation from the perfect semicircle can be attributed to the inhomogeneity and impurities (other elements in ferrite phase) of the metal surface. Increase in concentration of DMHB increases the diameters of the semicircles in the Nyquist plots. This indicates that the addition of DMHB increases the corrosion resistance of the metal due to its adsorption [43].

Fig. 7
figure 7

Nyquist plots for the corrosion of MS in a 0.5 M H2SO4 at 313 K and b 0.5 M HCl at 303 K containing various concentrations of DMHB

The data obtained were fitted into the suitable equivalent circuit using the ZSimpWin software version 3.21. Figure 8 shows the equivalent circuit used for DMHB in 0.5 M H2SO4. Similar circuit was used in case of 0.5 M HCl. In the equivalent circuit, RS represents the solution resistance, Rf represents the film resistance and Rct represents the charge-transfer resistance. Among two constant phase elements (CPE), CPE1 denotes the time constant of the electrical double layer and CPE2 is the film capacitance. The CPE is introduced to compensate for the heterogeneity in the solution system. The CPE impedance is calculated using the following equation [44]:

$$Z_{{{\text{CPE}}}} = \, Q^{ - 1} \left( {i \, w_{{\max}} } \right)^{ - n},$$
(11)
Fig. 8
figure 8

Equivalent circuit fitment for the corrosion of MS in 0.5 M H2SO4 containing 3 × 10–3 M DMHB at 313 K

where Q represents the proportionality coefficient, iwmax the angular frequency with ‘i’ being the imaginary number and ‘n’ is the exponent which is associated to the phase shift and its values lie between 0 and 1(i.e. 0 ≤ n ≤ 1). The observed n values range from 0.81 to 0.9 suggesting the occurrence of little or no considerable roughness on the surface and also deviation of CPE from the ideal capacitive behaviour [45]. The % IE and the disparity in the capacitance to its real value (Cdl) are calculated by using Eqs. (4) and (5), respectively.

The value of Rct is due to electron transfer across the metal surface and is inversely proportional to the corrosion rate. Table 5 shows that in the absence of the inhibitor the Rct value is less as compared to the Rct value in its presence. As the concentration of the DMHB increases, the Rct values also increase and the Cdl values decrease. Decrease in the capacitance indicates the decrease in local dielectric constant and/or an increase in the thickness of the electrical double layer. This suggests that the inhibitor molecules get adsorbed at the metal/solution interface [46].

Table 5 EIS results for mild steel corrosion in 0.5 M H2SO4 with and without the inhibitor DMHB at different temperatures

3.5 Corrosion Inhibition Mechanism

Factors such as nature of the metal, medium, pH, inhibitor concentrations and the functional groups present in it decide the mechanism of adsorption. From the literature, it is known that Cl ions can get easily adsorbed compared to SO42− ions [47]. The surface charge of the metal when in contact with the electrolyte can be determined by comparing the potential of zero charge (PZC) and the OCP of MS in the corresponding medium. The surface charge of the mild steel at OCP was found to be positive in the inhibited and uninhibited 0.5 M HCl and 0.5 M H2SO4 solutions with respect to PZC [48]. In acid media (i.e. 0.5 M HCl and 0.5 M H2SO4), the hydrazide derivatives get protonated and form positively charged species in the metal–solution interface. These positively charged inhibitor molecules cannot directly approach the positively charged metal surface due to electrostatic repulsive forces. However, the anions (Cl and SO42− ions) derived from the acids can directly get attached to the metal surface. Due to this, the chloride and sulphate ions are adsorbed first at the interface by electrostatic force of attraction. As a result of this, the charge of the solution side changes from positive to negative and the protonated inhibitor molecules are attracted towards the negative charge which facilitate the adsorption of DMHB. Thus, the protonated DMHB molecules will electrostatically adsorb on the MS surface through the chloride and sulphate bridges leading to physisorption. These protonated DMHB molecules can also be adsorbed at the cathodic sites of the metal in competition with the hydrogen ions and thus can reduce the rate of hydrogen evolution [49, 50]. The schematic representation of electrostatic interaction of protonated DMHB molecules on the MS surface is shown in Fig. 9.

Fig. 9
figure 9

A schematic representation of electrostatic interaction of protonated DMHB molecules on the MS surface

3.6 Surface Morphology Studies

3.6.1 Scanning Electron Microscopy (SEM)

The SEM images of surface of MS immersed in 0.5 M H2SO4 and 0.5 M HCl solutions for 3 h in the absence and presence of the inhibitor DMHB are represented in Fig. 10a, b. The rough surface with pits and cracks indicate the uniform corrosion of the corroded sample. The SEM images of MS specimen immersed in (a) 0.5 M H2SO4 and (b) 0.5 M HCl containing 3.0 mM DMHB are shown in Fig. 11a, b, respectively. After the addition of the inhibitor, the metal surface has become smoother and this indicates a surface film of DMHB is formed.

Fig. 10
figure 10

SEM images of mild steel specimen immersed in a 0.5 M H2SO4 and b 0.5 M HCl

Fig. 11
figure 11

SEM images of mild steel specimen immersed in a 0.5 M H2SO4 and b 0.5 M HCl containing 3.0 mM DMHB

3.6.2 Atomic Force Microscopy (AFM)

Figure 12a, b shows the AFM images of the polished specimen immersed in 0.5 M H2SO4 and 0.5 M HCl solution, respectively. The average surface roughness (Ra), root mean square (RMS) roughness (Rq) and peak-valley maximum (PV) values are calculated and recorded in Table 6. However, with 3 mM DMHB in solution the surface of the MS test coupon gets smoothened in H2SO4 and HCl as shown in Fig. 13a, b. The decrease in the values of Ra and Rq observed in case of inhibited specimen was possibly due to the protective film of DMHB formed on the MS surface.

Fig. 12
figure 12

AFM images of mild steel specimen immersed in a 0.5 M H2SO4 and b 0.5 M HCl

Table 6 AFM results obtained for mild steel in 0.5 M H2SO4 and 0.5 M HCl in the absence and presence DMHB
Fig. 13
figure 13

AFM images of mild steel specimen immersed in a 0.5 M H2SO4 and b 0.5 M HCl containing 3.0 mM DMHB

3.7 Quantum Chemical Study

The structure activity relationship between the molecular structure of DMHB and its inhibition efficiency was analysed by Quantum chemical calculations. The information about electron donating and proton accepting sites in the molecules, frontier molecular (HOMO and LUMO) orbital energies, the energy gap between HOMO and LUMO are calculated using DFT. The energy of the highest occupied molecular orbital EHUMO was found to be − 5.2926 eV and that of lowest occupied molecular orbital ELUMO is − 1.2136 eV. The values of energy gap ΔEgap and the fraction of electron transferred ΔN are calculated and recorded in Table 7.

Table 7 Calculated quantum chemical parameters of DMHB

The optimized geometry, HOMO and LUMO of DMHB are shown in Fig. 14. The figure clearly shows the distribution of electron density is over the entire DMHB molecule. From Table 7, the high value of EHUMO suggests that DMHB has tendency to provide electrons to suitable acceptor molecules possessing low energy or unfilled electron orbital. The lower the value of ELUMO, the greater is the probability that the molecule will accept electrons [51, 52]. Whenever the value of ΔN is greater than zero, it suggests that the electron is transferred from the inhibitor molecule to the surface of the metal. In the literature, it is reported that if the value of ΔN is < 3.6 then the inhibitor molecule has greater capability to donate the electrons [53]. From Table 7, it is observed that ΔN = 0.3841 and is lower than 3.6 which clearly shows that DMHB molecules have the ability of donating electrons to the vacant d orbitals of the metal.

Fig. 14
figure 14

Optimized molecular structure and frontier orbitals distribution HOMO and LUMO of DMHB

3.8 Comparison of DMHB with the Reported Hydrazide Derivatives as Corrosion Inhibitors

The inhibition efficiency of DMHB is further compared with other reported inhibitors [54,55,56,57] of similar type in Table 8

Table 8 Comparison of DMHB with the reported hydrazide derivatives as corrosion inhibitors

From the table, it can be inferred that DMHB is a potential inhibitor for corrosion inhibition of mild steel as it is showing nearly the similar inhibition efficiencies in comparison with the other reported inhibitors of this class. It is also seen that the maximum inhibition efficiency is obtained at a relatively lower concentration of (3 × 10−3 M) of DMHB when compared to those reported in the table.

3.9 Statistical Analysis

3.9.1 Optimization of Parameters for % IE

The response surface technique (RSM) relates to a combination of mathematical and statistical models that offer a method for problem analysis of a multivariable system. The RSM provides a platform to determine the optimized conditions in terms of input parameters to obtain a desired response [58]. This is a convenient technique to punctuate values with substantial variations and optimize the phenomena by minimizing the variability of outcomes. A Box Behnken Design (BBD) was executed to evaluate the effect of the temperature, H2SO4 concentration and DMHB concentration on the corrosion inhibition efficiency (% IE). All the variables were chosen at three levels as illustrated: temperatures of 30 40, and 50 ℃; concentration of DMHB-300, 600 and 900 ppm; concentration of acid–0.5, 0.75, 1.0 M. The efficiency of the inhibitor and the factors such as temperature and concentration of the medium was related through the obtained regression model.

The factors of RSM analysis in the coded and uncoded form are illustrated in Table 9.

Table 9 Factors of BBD in coded and uncoded form

Screening tests revealed that temperature, the concentration of DMHB inhibitor and concentration of acid remarkably influenced the % IE. Accordingly, they were chosen as investigation factors for further examination. The impacts of temperature (A), the concentration of H2SO4 (B) and concentration of DMHB (C) were found by strategies for a Box–Behnken design (BBD). To optimize the three individual factors, there were a total of 15 experimental runs in the BBD, which are listed in Table 10.

Table 10 Actual and predicted results of % IE acquired from the potentiodynamic polarization and Box–Behnken design

A quadratic model was developed to indicate the inhibitor efficiency as a function of the independent variables in the chosen ranges:

$$\begin{aligned} {\text{IE}} & \, = \, - {98}.0 \, + {4}.{95} {\text{A }} - {87}.0 {\text{B }} + 0.{3792} {\text{C }} - 0.0{725} {\text{A}}*{\text{A }} + {44}.0 {\text{B}}*{\text{B }} \\ & \quad - 0.000{158} {\text{C}}*{\text{C }} + 0.{8}00 {\text{A}}*{\text{B }} - 0.00{1833} {\text{A}}*{\text{C }} - 0.0{8}00 {\text{B}}*{\text{C}} \\ \end{aligned}.$$
(12)

The positive sign indicates the favourable effects of the independent parameter on the response, while the negative sign indicates the reverse effect [59].

Regression coefficient of Eq. (12) explained that A and C have positive effect, while B has negative effect on the inhibitor efficiency. Likewise, an interaction term AC was favourable for decreasing inhibition efficiency, while the AB led to the increase of the inhibition efficiency. The quadratic term A2 had a negative effect on the inhibition efficiency. This can be explained on the basis that higher temperature increases the corrosion rate and hence decreases the corrosion inhibition efficiency. The coefficient of determination (R2) obtained for the predictive model is 0.9803, which reveals a good fit illustrating predicted model sufficiently reflecting the observed values. Hence, the output can be readily explained by the model [60].

The performance of the influence of three factors measured separately on % IE is presented in Fig. 15. It illustrates the main effects of individual parameters. As the concentration of the DMHB increased from 300 to 900 ppm (i.e. 1 × 10─3 M to 3 × 10─3 M), the % IE increased, the reason being the coverage of the active sites on the metal with more and more DMHB molecules.

Fig. 15
figure 15

Main effects plot for % IE for MS in H2SO4

At 1 M H2SO4 concentration, the % IE showed a drastic decrease due to the intensified corrosion attack on the metal. The inhibitor showed physisorption mode of adsorption as the % IE decreased with an increase in temperature. The results are in line with the PDP and EIS study results.

The interactive effects of the process variables on the % IE were investigated by plotting a two-dimensional contour against two independent variables. Figure 16 shows the two-dimensional contour plots for the response. The corrosion inhibition efficiency was at the highest value when the DMHB concentration was 900 ppm and H2SO4 concentration was 0.5 M as indicated by Fig. 16a. While temperature and inhibitor concentration were considered for their effect on the response, the best output response was found at room temperature and 900 ppm concentration of the inhibitor. Figure 16c depicts the appearance of highest % IE at the lowest study temperature and H2SO4 concentration.

Fig. 16
figure 16

Contour plots correlating dependent and independent variables

3.9.2 Response Optimization

Response optimization of the model in Eq. (12) was carried out to determine the concentration of DMHB and temperature at which the corrosion rate of MS was at a minimum in H2SO4 to facilitate the maximum % IE. The desirability function method was applied to optimize the process factors for the maximum possible inhibition efficiency. Figure 17 shows the response optimization plot of the % IE. The optimum parameter was 300 K at H2SO4 concentration of 0.5 M and DMHB concentration of 900 ppm which gave the best output response of 90% inhibition efficiency.

Fig. 17
figure 17

Response optimization plots for corrosion inhibition efficiency

4 Conclusions

The conclusions drawn from the present study are as follows:

  1. 1.

    DMHB acts as a mixed inhibitor.

  2. 2.

    Percentage inhibition efficiency increased with the increase in DMHB concentration and decreased with temperature increase.

  3. 3.

    The maximum inhibition efficiency shown by DMHB at its optimum concentration (3 × 10−3 M) was about 90%.

  4. 4.

    The corrosion rates obtained by Tafel extrapolation technique are in agreement with EIS results.

  5. 5.

    Adsorption of DMHB on MS surface in acid media follows Langmuir adsorption isotherm.

  6. 6.

    Inhibition efficiency exhibited by DMHB is substantiated by DFT calculations.

  7. 7.

    The coefficient of determination R2 obtained was 0.9803 comprehending that the actual results fit well with the predicted results applying the quadratic model.