Abstract

In this work, we study the Duffing equation. Analytical solution for undamped and unforced case is provided for any given arbitrary initial conditions. An approximate analytical solution is given for the damped or trigonometrically forced Duffing equation for arbitrary initial conditions. The analytical solutions are expressed in terms of elementary trigonometric functions as well as in terms of the Jacobian elliptic functions. Examples are added to illustrate the obtained results. We also introduce new functions for approximating the Jacobian and Weierstrass elliptic functions in terms of the trigonometric functions sine and cosine. Results are high accurate.

1. Introduction

Many physical phenomena are modeled by nonlinear systems of ordinary differential equations. The Duffing equation is an externally forced and damped oscillator equation that exhibits a range of interesting dynamic behavior in its solutions. The Duffing oscillator is an important model of nonlinear and chaotic dynamics. It was introduced by Germanic engineer Duffing in 1918 [1]. The Duffing oscillator is described by the differential equation:

It differs from the classical forced and damped harmonic oscillator only by the nonlinear term , which changes the dynamics of the system drastically. Motivated by potential applications in physics, engineering, biology, and communication theory, the damped Duffing equationis considered. Equation (2) is a ubiquitous model arising in many branches of physics and engineering, such as the study of oscillations of a rigid pendulum undergoing with moderately large amplitude motion [2, 3], vibrations of a buckled beam, and so on [35].

It has provided a useful paradigm for studying nonlinear oscillations and chaotic dynamical systems, dating back to the development of approximate analytical methods based on perturbative ideas [2], and continuing with the advent of fast numerical integration by the computer, to be used as an archetypal illustration of chaos [2, 57]. Various methods for studying the damped Duffing equation and the forced Duffing equation (1) in feedback control, strange attractor, stability, periodic solutions, and numerical simulations have been proposed, and a vast number of profound results have been established [2].

The Duffing equation has been studied extensively in the literature. However, only few works are devoted to the study of its analytical solutions not using perturbation methods [8, 9]. Our aim is to avoid using such perturbation methods. This study is organized as follows. In the first section, we give exact analytical solution for the undamped and unforced Duffing equation for any given arbitrary initial conditions. In the second section, we provide formulas for obtaining a good approximate analytical solution using a new ansatz. The problems are solved for any arbitrary initial conditions. Finally, in the last section, we give approximate analytical solution to (1) and we compare it with Runge–Kutta numerical solution. Other useful methods are the homotopy perturbation method (HPM) [1017], the Lindstedt–Poincaré method, and the Krylov–Bogoliubov–Mitropolsky method. The importance of numerical solution of differential equations in different fields of science and engineering is given in [18, 19].

2. Undamped and Unforced Duffing Equation

This is the equation:and given the initial conditions,

The general solution to equation (3) may be written in terms of any of the twelve Jacobian elliptic functions [20]. Let, for example,

Then,

Equating to zero, the coefficients of cnj to zero gives an algebraic system whose solution is

Thus, the general solution to the Duffing equation is

The values for the constants and are determined from the initial conditions.

Definition 1. The number is called the discriminant for the Duffing equations (3) and (4).
We will distinguish three cases depending on the sign of the discriminant [20].

2.1. First Case:

The solution to the i.v.p. (3) and (4) is given by

Making use of the addition formula,

The solution (9) may be expressed aswhere

Solution (11) is a periodic solution with period

Example 1. Let us consider the i.v.p.Using formula (9), the exact solution to (14) is given byAccording to the relations (11) and (12), the exact solution to the i.v.p. (14) may also be written asThe period is given byIn Figure 1, the comparison between the exact analytical solution (??) and the approximate numerical RK4 solution is presented. Full compatibility between the two analytical and numerical solutions is observed.

2.2. Second Case:

In this case, . Define

Observe that

Letwhere is a solution to Duffing equationwith initial conditions

Inserting ansatz (21) into the ode and taking into account the relation,we get

Equating to zero, the coefficients of give an algebraic system. A solution to this system is

Observe that the Duffing equations (21) and (22) have a positive discriminant given by

Then, the problem reduces to the first case.

Example 2. Let us assume the following i.v.p.:The solution of i.v.p. (27) according to the relation (??) readsThe period of solution (28) is given byComparison between the exact solution and numerical solution is shown in Figure 2.

2.3. Third Case: and

If the discriminant vanishes , then , and the only solution to problem (??) withreadswhich may be verified by direct computation.

2.4. Fourth Case: and

The solution is given by

Remark 1. The solution to the i.v.p.is

Remark 2. Let . Then, the solution to the i.v.p.is

Remark 3. Using the identitythe solution to the Duffing equations (3) and (4) may be written in terms of the Weierstrass elliptic function . More precisely, if , thenwhereThe solution (38) is periodic with periodwhere is the greatest real root to the cubic andOn the other hand,where is a root to the sexticThus,

3. Approximate Analytical Solution Using Elementary Functions

We define the generalized sine and cosine functions as follows:

These functions are good approximations to the Jacobian elliptic functions sn and cn for . For example, let

Then,

Table 1 provides the errors for different values of .

More accurate approximations are obtained by letting

For these new approximations, we will have

Table 2 provides the errors for different values of .

From Tables 1 and 2, it is seen that for the values , the approximations (46) and (47) are better than (53) and (54). Thus, we have

We may write approximate elementary solution to Duffing equations (3) and (4) as follows:whereThe values for the constants in (62) are the same as in (??).

Remark 4. In the case when , we use the approximations:Then, formula (60) takes the following form when and :Similar formula for (62) when .
In the case when , we may use the following approximations:

Example 3. Let us return to Example 1.The approximate elementary analytical solution isThe exact period is given by . The approximate period is that of (59), and it is given byThis value differs from the exact value by 0.00278457. The error of the approximate solution comparted with exact solution isComparison between the exact solution and the approximate analytical solution is shown in Figure 3.

Example 4. Let us return to Example 2. Let (Figure 4)

Remark 5. From (47)–(44) or (53)–(44), we obtain the following approximate expression for the Weierstrass elliptic function by means of the cosine function:where is a root to the sextic (44).

Example 5. Let and . For this choice, . We haveThe period is , and the error on the interval in the sup norm is . Comparison between the approximate analytical solution and the numerical solution is shown in Figure 5. The reciprocals of the two functions are plotted on the interval .

4. Analytical Solution to a Generalized Duffing Equation

Let us consider the i.v.p. [21]:given that

We will say that (75) is a constantly forced Duffing equation. When , that becomes an undamped and unforced Duffing equation, and we already know how to solve it for arbitrary initial conditions. Letwhere , , , and are some constants to be determined. Plugging ansatz (77) into (75) giveswhere . Equating to zero, the coefficients of in the right-hand side of (78) gives an algebraic system. A nontrivial solution to this system is

Now, to find the values of and , we make use of the addition formula:

We then find that

The number must be a solution to the quartic

Using (75), we also may obtain an approximate analytical solution in terms of the cosine function.

Remark 6. The i.v.p.given the initial conditionsis a particular case of (75) and (76). Indeed, let . Then, problems (83) and (84) reduce to the problem

Example 6. LetThe exact solution iswith periodAn approximate analytical solution iswith periodThe error isComparison between the approximate analytical solution and the numerical solution is shown in Figure 6.

5. Damped and Unforced Duffing Equation

Let us consider the i.v.p.given that

We will suppose that . Define the residual as

5.1. First Case:

Assume the ansatz

Then, from results in [22],so thatbeing

The numbers , , and are obtained from the following conditions:

Solving the two equations in (88) gives

The number is a root to the septic. To avoid solving this, the seventh-degree equation, we may set the default value . Taking this value for , we get the following simplified expressions:

Remark 7. In the integrable case, we have and then From (99) and (100), and . Thus, our approach covers the only integrable case for the damped Duffing equation.

Example 7. LetThe error of the approximate analytical solution compared with numerical solution isComparison between the approximate analytical solution and the numerical solution is shown in Figure 7.

Example 8. LetThe error of the approximate analytical solution compared with numerical solution isComparison between the approximate analytical solution and the numerical solution is shown in Figure 8.

Remark 8. Let . An approximate analytical solution to the i.v.p.is given bywhere and are given by (98) and (99).

5.2. Second Case:

Let

Assuming the ansatz [22],we will have

Then,

The number is found form the initial condition , and its value reads

The number is a solution to some decic equation. Default value is .

Example 9. LetThe error of the approximate analytical solution compared with numerical solution isComparison between the approximate analytical solution and the numerical solution is shown in Figure 9.

6. Damped and Forced Duffing Equation

Let us consider the Duffing equation as originally was introduced by Georg Duffing:given the initial conditions

Let

We will suppose that the function is a solution to the Duffing equationwhere

The numbers and are chosen, so that

Example 10. LetThe error of the approximate analytical solution compared with numerical solution isThe approximate solution iswhereComparison between the approximate analytical solution and the numerical solution is shown in Figure 10.
Finally, let us compare the accuracy of the obtained results in comparation with the homotopy perturbation method (HPM). This method gives the approximate solution:The error of this approximation compared with numerical solution isComparison between the approximate analytical solution and the homotopy solution is shown in Figure 11.

7. Analysis and Discussion

We have solved the undamped and constantly forced Duffing equation exactly. Trigonometric approximant was also provided. For the damped or forced case, we derived approximate analytical solution. As far as we know, the Duffing equation (1) has not been solved using the tools we employed in this work. For the damped unforced case, author in [8] obtained approximate analytical solution using generalized Jacobian elliptic functions. More exactly, author considered the following equation:

The obtained solution in [8] has the formwhere

The constants and are determined from the initial conditions as follows:

This approach is different from the method we used in this work. Let us compare the solution (136) with the solution we obtained in Example 8:

Using formula gives the approximate analytical solution

The error of this solution compared with the Runge–Kutta numerical method equals 0.00142148. The error obtained in our method equals 0.00135922. We may try a simpler ansatz in the formwith

The numbers and are determined from the system

Using this ansatz, we obtain the approximate analytical solution:

The error of the trigonometric solution (146) compared with the numerical solution using the Runge–Kutta method equals 0.00195254, so that the trigonometric solution is good as well.

8. Conclusions and Future Work

The methods employed here may be useful to study other nonlinear oscillators of the formwhere the function is odd: . To this end, we approximate this function on some interval by means of Chebyshev polynomials in the form

Then, the i.v.p. is replaced with the i.v.p.

On the other hand, we may study the following cubic quintic Duffing oscillator:

For the unforced and damped cases, we may try the ansatzwhereand

The number is a free parameter that is chosen in order to minimize the residual error

Data Availability

No data were used to support this study.

Conflicts of Interest

The authors declare that they have no conflicts of interest.