1 Introduction

Most of the engineering problems, essentially some vibration equations are nonlinear and in general, it is hard to solve such equations, principally in the analytical study. Also, many physics problems can be modeled by differential equations. However, it is hard to obtain closed-form solutions for them, essentially for nonlinear ones. In general, only approximate solutions (either numerical ones or analytical ones) can be anticipated. There are numerous nonlinear problems in the research of the various branches of science that do not have analytical solutions. Due to the shortness of finding exact solutions, numerous analytical and numerical approximations have been investigated. Therefore, these nonlinear equations are imperative to be solved by employing other methods. Many researchers have been working on various analytical methods for solving nonlinear oscillation systems. The earliest approximation method is the method of averaging and the idea of averaging originates from Lagrange in (1788) [1]. Towards the end of the nineteenth century, Poincare in (1890) [2] provided the qualitative analysis of dynamical systems to determine periodic solutions and stability.

The perturbation technique is the most one of the known techniques for solving nonlinear problems analytically. Some of these perturbation methods are demonstrated in Nayfe's books [3, 4]. A summarized literature survey of the perturbation methods in the application is discussed by Albert [5]. The traditional analytical techniques, including the Lagrange, straightforward methods and the method of averaging in the application and the weakness of actual existing approximate techniques are also investigated. Recently, nonlinear oscillator models have been widely considered in engineering and physics. A treatise on nonlinear problems that are presented in most areas of physics and also engineering is very important for scientists. Scanning of the literature with many references has been given by numerous authors utilizing several analytical methods for solving nonlinear oscillation systems. Non-linear problems remain to be a challenge and attention has mainly intensified on qualitative changes in systems bifurcations and instability.

Since the nonlinear phenomena were observed in engineering, Duffing (1918) [6] used the hardening spring model to investigate the vibration of the electromagnetic vibrating beam and since then, the Duffing oscillator has been extensively applied in structural dynamics. Moreover to determining the existence of oscillatory motions of the second-order nonlinear differential equations in mathematics. Nayfeh [3] employed the multiple-scale perturbation methods to improve and obtain an approximate solution of oscillatory motions in the Duffing equations. Nayfeh and Mook [4] applied the perturbation methods to nonlinear structural vibrations via the Duffing oscillators. Thus, the perturbation analysis continues to be applied to get an analytical approximate solution of oscillatory motions. The parameterized perturbation technique is a well-known approach for solving nonlinear oscillators. The method was first proposed by He [7] and is called the homotopy perturbation method. It was hired recently in many studies in physics and engineering, this method is a powerful tool for treating weakly nonlinear problems, but it is lowly effective for analyzing some high nonlinearity problems [8,9,10,11,12]. There are many modifications done by many researchers and scientists to improve the homotopy perturbation method and become a more operative method. He [13, 14] employing the parameter-expanding method as a modification to the homotopy perturbation method to solve a strongly nonlinear oscillator. Liu et al. [15], El-Dib and Moatimid [16] and Nino et. al [17] develop the homotopy perturbation method by modifying it across coupling with the Laplace transform to solve nonlinear problems. Next, we briefly mention some of the last developments of this method; such as the coupling of HPM and Frobenius method [18], multiple scales HPM method [19,20,21,22], parametrized HPM [23], nonlinearities distribution HPM used to find the solution of Troesch problem [24]. Recently, Shen and El-Dib [25] developed a new modification to the homotopy perturbation method for analyzing nonlinear equations having restoring force by changing the linear auxiliary operator by another suitable one, among many others. Anjum and He coupled the homotopy perturbation method with Laplace transform, making the solution process much simple [26].

As we know, the exact solutions to some of these non-linear differential equations do not exist. Therefore, the probing of approximate solutions to these types of equations can play a vital role in the study of non-linear physical phenomena. Serious studies in the literature of forced non-linear oscillators of the Duffing equation [27]. The general form of such equations is called damping Duffing equations and is given as follows:

$$\ddot{y} + \mu \dot{y} + \omega_{0}^{2} y + Qy^{3} = g(t);\,\,\,y = y(t)$$
(1)

This equation presents a tremendous domain of well-known behavior in nonlinear dynamical systems and is applied by many researchers to illustrate such behavior. The equation seems simple at the first look but has a lot of awesome features. The traditional perturbation method contains many shortcomings. They are not useful, especially, for damping nonlinear Eq. (1) see Ref. [28]. To overcome the shortcomings, it requires a new perturbation technique. Surprisingly, the application of the fractional derivative with the homotopy perturbation has been used to overcome the shortcoming of Eq. (1) [29,30,31,32,33,34,35,36,37,38,39,40]. In the current work, we propose a new scheme to modify HPM applied to Eq. (1). Usually, to find an approximate solution of Eq. (1), a two iterations method is used. The iteration of the suggested solution and the iteration of the frequency parameter, these two iterations are not enough to work [28]. Here an additional iteration is used to overcome the difficulty in the damping nonlinear oscillator.

2 The enhanced homotopy perturbation approach with three expansion technology

Utilizing the homotopy perturbation method HPM [7, 8, 11,12,13], a general nonlinear equation is considered in the type,

$$L(y) + N(y) = g(t),$$
(2)

where \(L\) is an auxiliary linear operator, N is a nonlinear operator and \(g(t)\) is the inhomogeneous part. The idea of homotopy to establish the following one-parameter family of equations

$$L(y) + \rho \left( {N(y) - g(t)} \right) = 0;\,\,\rho \in \left[ {0,1} \right]\,$$
(3)

where \(\rho\) is the artificial parameter called a bookkeeping parameter. This parameter monotonically increases from zero to unity. As \(\rho \to 1,\) it turns to the original nonlinear one. So the growth process of \(\rho\) from zero to unity is completely that of Eq. (3) to Eq. (2). The homotopy equation corresponding to Eq. (1) is

$$\ddot{y} + \omega_{0}^{2} y = - \rho \left( {\mu \dot{y} + Qy^{3} - g(t)} \right);\,\,\,\rho \in \left[ {0,1} \right]$$
(4)

The HPM utilizes the parameter \(\rho\) as an expanding parameter to get

$$y(t) = y_{0} (t) + \rho y_{1} (t) + \rho^{2} y_{2} (t) + ...$$
(5)

It is obvious that when \(\rho \to 0,\) Eq. (4) becomes a linear differential equation

$$\ddot{y}_{0} + \omega_{0}^{2} y_{0} = 0.$$
(6)

In which an exact solution can be calculated, which have the form

$$y_{0} (t) = A_{0} \cos (\omega_{0} t + \theta ),$$
(7)

where the amplitude \(A\) and the phase \(\theta\) are real constants determine by the initial conditions.

Oftentimes, one expanded method cannot act due to the difficult nonlinear equation. Accordingly, an additional expanded method was used. The perturbed for the natural frequency \(\omega_{0}\) may be useful

$$\omega_{0}^{2} (\rho ) = \omega^{2} - \rho \omega_{1} - \rho^{2} \omega_{2} + ...$$
(8)

where \(\omega_{0}\) is known as a linear frequency, \(\omega\) and, \(\omega_{j}\) are unknowns arriving from by removing the security conditions due to inhomogeneity in the perturbed equation.

In the case of, \(\rho > 0,\) unfortunately, the use of the two expansions (5) and (8) cannot work with Eq. (4) because a shortcoming is presented. Therefore, an additional iteration method is needed to overcome this failure. It is convenient to take the amplitude \(A\) as a function of the time \(t,\) besides that the frequency \(\omega_{0}\) as a function of the parameter, \(\rho ,\) therefore, the above solution may be modified to become

$$y_{0} (t;\rho ) = A(t;\rho )\cos \left( {\omega_{0} (\rho )t + \theta } \right)\,.$$
(9)

Generally, the two expansions (5) and (8) cannot be work due to the presence of the damping part in the nonlinear equation, in which, a shortcoming is presented. Therefore, a new technique is needed. According to this failure, the perturbed amplitude \(A\) is useful. Let the amplitude \(A\) is expanded as a power series in \(\rho ,\) accounting unknowns functions of the variable \(t,\) so that when \(\rho \to 0,\) it becomes a constant

$$A(t,\rho ) = \alpha (1 + \rho C_{1} (t) + \rho^{2} C_{2} (t) + ...),$$
(10)

where the unknowns \(C_{j} (t)\) will be determined by solving the equations arising from removing the secular terms. Put (8) and (10) into (9), yields

$$y_{0} (t;\rho ) = \alpha (1 + \rho C_{1} (t) + \rho^{2} C_{2} (t) + ...)\cos \left( {\omega t + \theta } \right)\,.$$
(11)

It is worthwhile to observe that, in the limiting case as \(\rho \to 0,\) we have \(A \to A_{0}\) and \(\omega \to \omega_{0} .\) Consequently, expansion (11) will convert to the solution (7). Thus, we have

$$y_{0} (t;0) = A_{0} \cos \left( {\omega_{0} t + \theta } \right),$$
(12)
$$y_{0} (t;1) = \alpha (1 + C_{1} (t) + C_{2} (t) + ...)\cos \left( {\omega t + \theta } \right)\,.$$
(13)

3 Solution of the homotopy Eq. (4)

To obtain an approximate solution of the undertaken homotopy equation, we put the expansions (5), (8) and (11) in Eq. (4), letting \(g(t) = 0\) and reorganize the coefficients of the same powers of \(\rho\). Making these coefficients tends to zero, a system of a differential equation is obtained. The zero-order solution will satisfy automatic, while the remaining orders are solved sequentially. The first and second-order problems are as follows:

$$\ddot{y}_{1} + \omega^{2} y_{1} = - \alpha \left( {\ddot{C}_{1} + \tfrac{3}{4}Q\alpha^{2} - \omega_{1} } \right)\cos (\omega t + \theta ) + \alpha \omega \left( {\mu + 2\dot{C}_{1} } \right)\sin (\omega t + \theta ) - \tfrac{1}{4}Q\alpha^{3} \cos (3\omega t + 3\theta ),$$
(14)
$$\begin{gathered} \ddot{y}_{2} + \omega^{2} y_{2} = - \alpha \left[ {\ddot{C}_{2} + \mu \dot{C}_{1} + \left( {\tfrac{9}{4}Q\alpha^{2} - \omega_{1} } \right)C_{1} - \omega_{2} } \right]\cos (\omega t + \theta ) + \alpha \omega \left( {2\dot{C}_{2} + \mu C_{1} } \right)\sin (\omega t + \theta )\, \hfill \\ \,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, - \mu \dot{y}_{1} + \left( {\omega_{1} - \frac{3}{2}Q\alpha^{2} \left( {1 + \cos (2\omega t + 2\theta } \right)} \right)y_{1} - \frac{3}{4}Q\alpha^{3} C_{1} \cos (3\omega t + 3\theta ). \hfill \\ \end{gathered}$$
(15)

To eliminate the secular terms from Eq. (14), the following should be satisfied

$$\ddot{C}_{1} = \omega_{1} - \tfrac{3}{4}Q\alpha^{2}$$
(16)
$$\dot{C}_{1} = - \tfrac{1}{2}\mu .$$
(17)

In the light of the conditions (16) and (17) the bounded solution of Eq. (14) is presented in the form

$$y_{1} (t) = \frac{{Q\alpha^{3} }}{{32\omega^{2} }}\cos (3\omega t + 3\theta ).$$
(18)

Substituting (18) into Eq. (15), using (16) and (17), removing the secular terms requires

$$\omega_{2} = \ddot{C}_{2} + \mu \dot{C}_{1} + \left( {\tfrac{9}{4}Q\alpha^{2} - \omega_{1} } \right)C_{1} + \frac{{3Q^{2} \alpha^{4} }}{{128\omega^{2} }},$$
(19)
$$\dot{C}_{2} = - \tfrac{1}{2}\mu C_{1} .$$
(20)

The solution of Eq. (15) without secular terms is given by

$$\begin{gathered} y_{2} (t) = \frac{{Q\alpha^{3} }}{{256\omega^{4} }}\left( { - \omega_{1} + \frac{{3Q\alpha^{2} }}{2}} \right)\cos (3\omega t + 3\theta )\, - \frac{{3\mu Q\alpha^{3} }}{{256\omega^{3} }}\sin (3\omega t + 3\theta )\,\, + \frac{{3Q^{2} \alpha^{5} }}{{3072\omega^{4} }}\cos (5\omega t + 5\theta ) \hfill \\ \,\,\,\,\,\,\,\,\,\,\, - \frac{{3Q\alpha^{3} }}{{4\left( {D^{2} + \omega^{2} } \right)}}C_{1} (t)\cos (3\omega t + 3\theta ). \hfill \\ \end{gathered}$$
(21)

Integrating the condition (17) and making the integration constant be zero yields

$$C_{1} (t) = - \tfrac{1}{2}\mu \,t.$$
(22)

Besides, integrating condition (20), we have

$$C_{2} (t) = \tfrac{1}{8}\mu^{2} t^{2} .$$
(23)

Putting \(\rho = 1,\) in (5), (8) and (10) the approximate solution, frequency and the amplitude, therefore, can be readily obtained.

$$y(t) = y_{0} (t) + y_{1} (t) + y_{2} (t) + ...,$$
(24)
$$\omega^{2} = \omega_{0}^{2} + \omega_{1} + \omega_{2} + ...,$$
(25)
$$A(t) = \alpha (1 + C_{1} (t) + C_{2} (t) + ...).$$
(26)

4 The amplitude-frequency equation and stability analysis

It is worthwhile to note that the solvability conditions presented in (16), (18) and (19) represent four unknowns in four equations. By combing the two conditions presented in (16) yields

$$\omega_{1} = \frac{{3Q\alpha^{2} }}{4}.$$
(27)

Inserting (17), (20) and (22) into the condition (19) yields the following relation:

$$\omega_{2} = - \frac{1}{4}\mu^{2} - \frac{3}{4}Q\alpha^{2} \mu t + \frac{{3Q^{2} \alpha^{4} }}{{128\omega^{2} }}.$$
(28)

To construct the frequency-amplitude equation, we may insert the solvability conditions (27) and (28) into the expansion (25), yields

$$\omega^{2} = \omega_{0}^{2} - \frac{1}{4}\mu^{2} + \frac{{3Q\alpha^{2} }}{4}\left( {1 - \mu t + ...} \right) + \frac{{3Q^{2} \alpha^{4} }}{{128\omega^{2} }}.$$
(29)

It is worthwhile to observe the bract in (29) represents the first two terms in the exponential function \(e^{ - \mu t} .\) Therefore, in the compact form, the frequency equation arises in the form

$$\omega^{2} = \omega_{0}^{2} - \frac{1}{4}\mu^{2} + \frac{{3Q\alpha^{2} }}{4}e^{ - \mu t} + \frac{{3Q^{2} \alpha^{4} }}{{128\omega^{2} }}.$$
(30)

This is the modified frequency included the influence of the damping forces. When \(\mu \to 0\) the classical frequency arises [7].

Further, inserting (22) and (23) into the expansion (26) gets

$$A(t) = \alpha \left[ {1 - \left( {\tfrac{1}{2}\mu \,t} \right) + \tfrac{1}{2}\left( {\tfrac{1}{2}\mu \,t} \right)^{2} + ...} \right].$$
(31)

It is worthwhile to observe that (31) represents the first three terms in the expansion of the exponential function \(e^{{ - \,\tfrac{1}{2}\mu \,t}} ,\) therefore, the compact form of (31) is

$$A(t) = \alpha e^{{ - \tfrac{1}{2}\,\mu t}} .$$
(32)

Employing (32) to (11) the results coincide with the normal form solution of the linear harmonic equation as known in the classical differential calculus.

The second-order approximate solution is derived by inserting (32), (18) and (21) in the expansion (24), which yields

$$y(t) = \alpha e^{{ - \tfrac{1}{2}\,\mu t}} \cos \left( {\omega t + \theta } \right)\, + \frac{{Q\alpha^{3} }}{{32\omega^{2} }}\left( {e^{{ - \tfrac{3}{2}\mu t}} \, + \frac{{3Q\alpha^{2} }}{{32\omega^{3} }}} \right)\cos (3\omega t + 3\theta )\, + \frac{{3\mu Q\alpha^{3} }}{{128\omega^{3} }}\sin (3\omega t + 3\theta ) + \frac{{3Q^{2} \alpha^{5} }}{{3072\omega^{4} }}\cos (5\omega t + 5\theta ).$$
(33)

This represented an enhanced homotopy solution. It is noted that the classical approximate solution is found as \(\mu \to 0.\)

It is worthwhile to note that the stability criteria require that the parameter \(\mu\) is positive and \(\omega\) be real. To solve the frequency \({\text{Eq}}{.}\) (30), we may apply the perturbation technique. We introduce a small parameter \(\varepsilon\) to put \({\text{Eq}}{.}\)(30) in a perturbed form

$$\omega^{2} = \omega_{0}^{2} - \frac{1}{4}\mu^{2} + \varepsilon \left( {\frac{{3Q\alpha^{2} }}{4}e^{ - \varepsilon \mu t} + \frac{{3Q^{2} \alpha^{4} }}{{128\omega^{2} }}} \right);\,\,\,\varepsilon \in \left[ {0,1} \right]$$
(34)

Supposing that the frequency \(\omega\) is expanded as

$$\omega^{2} = \Omega_{0}^{2} + \varepsilon \Omega_{1} + \varepsilon^{2} \Omega_{2} + ...$$
(35)

Substituting (35) into (34) and equating to being zero, the identical powers of \(\varepsilon ,\) yields

$$\Omega_{0} = \sqrt {\omega_{0}^{2} - \tfrac{1}{4}\mu^{2} } ,$$
(36)
$$\Omega_{1} = \frac{{3Q\alpha^{2} }}{4} + \frac{{3Q^{2} \alpha^{4} }}{{128\left( {\omega_{0}^{2} - \tfrac{1}{4}\mu^{2} } \right)}}.$$
(37)

To the first-order approximation, we insert (36) and (37) into (35) and taking \(\varepsilon = 1,\) we obtain

$$\omega^{2} = \omega_{0}^{2} - \tfrac{1}{4}\mu^{2} + \frac{3}{4}Q\alpha^{2} + \frac{{3Q^{2} \alpha^{4} }}{{128\left( {\omega_{0}^{2} - \tfrac{1}{4}\mu^{2} } \right)}}.$$
(38)

It is noted that the necessary conditions for stability are

$$\mu > 0,\,\&\, \omega_{0}^{2} - \tfrac{1}{4}\mu^{2} + \frac{3}{4}Q\alpha^{2} + \frac{{3Q^{2} \alpha^{4} }}{{128\left( {\omega_{0}^{2} - \tfrac{1}{4}\mu^{2} } \right)}} > 0.$$
(39)

In the absence of the parameter \(\mu\) in the above condition the classical stability condition is found [19].

5 Numerical illustration

In this part, we will utilize the outlined approximate scheme in Eq. (33) and Eq. (34) to obtain numerical simulations for solving the damping Duffing Eq. (1).To show the high accuracy of the present approach, the comparison of the numerical solution with the analytical approximate solution is displayed in Fig. 1. This numerical solution has been done using the algorithm building in the Mathematica for finding the numerical solution of the Duffing Eq. (1). The analytical approximate solution is derived from the modification of the homotopy perturbation method with the three expansion techniques given by (33). The full nonlinear frequency \(\omega\) given by (30) is used in this calculation. The graph of Fig. 1 shows the excellent agreement between the numerical solution (Red curve) and the analytical solution (Blue curve). The damping influence is clear in this illustration, in which the wave solution will decay as time \(t\) is increased. The influence of the variation of the damping coefficient \(\mu\) of the analytical solution (33) has been illustrated in Fig. 2. This graph shows that the periodic solution without damping is found as \(\mu \to 0.\) When \(\mu\) is different from zero the decaying in the wave solution is observed. This decay speeds up as \(\mu\) increases. The variation of the constant amplitude \(\alpha\) has been displayed in Fig. 3.

Fig. 1
figure 1

Graphic to the comparison between the numerical solution of Eq. (1) and its analytical solution (33), for a system of \(\omega_{0} = 2,\,\mu = 0.5,\,Q = 0.5,\,\theta = 0\,\& \,\alpha = 1.\)

Fig. 2
figure 2

The analytical solution (33) with a variety of the damping coefficient \(\mu\), for the same system as given in Fig. 1

Fig. 3
figure 3

The analytical solution (33) with a variety of the constant amplitude \(\alpha\), for the same system as given in Fig. 1

Further, the stability condition (39) has been illustrated numerically as shown in Fig. 4. The graph contains the classical stability condition in the case of \(\mu = 0\) which plotted in blue color. The region labeled with the symbol “S” refers to the stable region, while the unstable region is labeled by the symbol “U”. Also, this graph represents the modified stability condition in the presence of the effect of the damping parameter, where \(\mu\) have the consequence values \(\mu = 0.5,\,1.0,\,1.5\). It is observed that the increase in \(\mu\) leads to the stable region increases steadily.

Fig. 4
figure 4

The illustration of the stability condition (39) with a variety of the damping coefficient \(\mu\), for the same system as given in Fig. 2

6 Conclusion

In the present paper, we have successfully employed the Homotopy Perturbation Method with three expanded expansions to solve the damping nonlinear Duffing equation. Besides the two known expansions used in the homotopy perturbation method, an additional approach of the amplitude-expanding method. We also find the accuracy of this method which gives us very attractive results in the terms of the exponential of the negative damping parameter. The comparison between our analytical solution and the numerical solution shows a more excellent agreement. This is proved to be a powerful mathematical tool for nonlinear oscillators, can be easily extended to the damping nonlinear oscillators and the present proposal can be used as paradigms for many other applications in searching for a period or frequency of various nonlinear oscillators.