Keywords

1 Introduction

In this work, we consider the Painlevé equation II, which is formulated in the form

$$ y^{{\prime \prime }} = 2y^{3} + xy + \mu $$
(1)

with initial conditions

$$ y\left( 0 \right) = 1\quad \quad y^{{\prime }} \left( 0 \right) = 0 $$
(2)

where µ is an arbitrary parameters. Equations (1) and (2) have been discussed in Dastidar and Majumdar (1972) using an analytic continuation extension method (ACE) and the Chebyshev series method (CSM).

In recent years, many researchers used the analytical, approximate and numerical technique to solve the Painlevé equation II. For instance, Hesameddini and Peyrovi (2010) conducted a comparative study of Painlevé equation II by using the homotopy perturbation method (HPM), ACE and CSM. Meanwhile, Saadatmandi (2012) applied the Sinc-collocation method and variational iteration method (VIM) for solving the equation. Mabood et al. (2015) presented the series solution of Painlevé equation II via the optimal homotopy asymptotic method (OHAM).

Daftardar–Gejji and Jafari Method (DJM) is a new iterative method discovered by Daftardar-Gejji and Jafari (2006) for solving linear and nonlinear functional equations. It is a valuable tool for scientists and mathematicians where it has been extensively and successfully used for the treatment of linear and nonlinear of integer and fractional order (Bhalekar and Daftardar-Gejji 2008, 2011, 2012; Daftardar-Gejji and Bhalekar 2010; Hameeda 2013). Yaseen et al. (2013) used DJM to find the exact solutions of Laplace equations, while Majeed (2014) used DJM for solving the epidemic model and prey and predator problems.

The purpose of this paper is to employ Daftardar–Gejji and Jafari Method (DJM) to find the numerical solution of Painlevé equation II and compare the results obtained by DJM with those obtained by other methods such as OHAM, ACE, CSM, HPM and VIM-Pade.

2 The Basic Idea of DJM Method

The basic idea of Daftardar–Gejji and Jafari method (Daftarda–Gejji and Jafari 2006) is presented in this section. It is a useful and practical method for solving the following general functional equation:

$$ u = N(u) + f, $$
(3)

where \( f \) is a known function and \( N \) is a nonlinear operator. A solution \( u \) of Eq. (2) is in the form of the following series:

$$ u = \sum\limits_{i = 0}^{\infty } {u_{i} } . $$
(4)

The nonlinear operator \( N \) is decomposed as follows:

$$ N\left( {\sum\limits_{i = 0}^{\infty } {u_{i} } } \right) = N\left( {u_{0} } \right) + \sum\limits_{i = 1}^{\infty } {\left\{ {N\left( {\sum\limits_{j = 0}^{i} {u_{j} } } \right) - N\left( {\sum\limits_{j = 0}^{i - 1} {u_{j} } } \right)} \right\}} . $$
(5)

From Eqs. (3) and (4), Eq. (2) is equivalent to

$$ \sum\limits_{i = 0}^{\infty } {u_{i} } = f + N\left( {u_{0} } \right) + \sum\limits_{i = 1}^{\infty } {\left\{ {N\left( {\sum\limits_{j = 0}^{i} {u_{j} } } \right) - N\left( {\sum\limits_{j = 0}^{i - 1} {u_{j} } } \right)} \right\}} . $$
(6)

The recurrence relation is defined as follows:

$$ \begin{aligned} u_{0} & = f, \\ u_{1} & = N\left( {u_{0} } \right), \\ u_{m + 1} & = N\left( {u_{0} + \cdots + u_{m} } \right) - N\left( {u_{0} + \cdots + u_{m - 1} } \right),\quad m = 1,\,2,\, \ldots . \\ \end{aligned} $$
(7)

Then

$$ \left( {u_{1} + \cdots + u_{m + 1} } \right) = N\left( {u_{1} + \cdots + u_{m} } \right),\quad m = 1,2, \ldots $$
(8)

and

$$ u(x) = f + N\,\left( {\sum\limits_{i = 1}^{\infty } {u_{i} } } \right). $$
(9)

The \( m \)-term approximation solution of Eq. (2) is given by \( {\text{u}} = {\text{u}}_{ 0} + u_{1} + \cdots + u_{m - 1} \).

2.1 Solution of Painlevé Equation II by DJM

According to DJM, Eqs. (1) and (2) are equivalent to

$$ y = 1 + \frac{1}{2}\mu x^{2} + \iint {(2y^{3} + xy) {\text{d}}x} $$
(10)

and the iterative solutions are

$$ \begin{array}{*{20}l} {y_{0} = 1 + \frac{1}{2}\mu x^{2} } \hfill \\ {y_{1} = x^{2} + \frac{1}{6}x^{3} + \frac{1}{4}\mu x^{4} + \frac{1}{40}\mu x^{5} + \cdots } \hfill \\ {y_{2} = \frac{1}{2}x^{4} + \frac{1}{10}x^{5} + \left( {\frac{37}{180} + \frac{1}{4}\mu } \right)x^{6} + \cdots \vdots } \hfill \\ \end{array} $$
(11)

Therefore, the series solution is given by

$$ y\left( x \right) = 1 + \left( {\frac{1}{2}\mu + 1} \right)x^{2} + \frac{1}{6}x^{3} + \left( {\frac{1}{4}\mu + \frac{1}{2}} \right)x^{4} + \left( {\frac{1}{40}\mu + \frac{1}{10}} \right)x^{5} + \cdots $$
(12)

3 Results and Discussion

In order to show the feasibility of the DJM, the obtained series solution up to \( x^{25} \) are compared with existing solutions with \( \mu = 0, 1 \) and \( 5 \).

Table 1 shows the comparison of our results with those obtained by Mabood et al. (2015) and Saadatmandi (2012). It shows that the results obtained by DJM are in good agreement with published results using OHAM, Sinc-collocation and VIM-Pade method.

Table 1 Comparison of value of \( y\left( x \right) \) by different method at \( \mu = 1 \)

A graphical comparison for \( \mu = 5 \) is shown in Fig. 1 where it is found that the DJM solutions are exactly same as those obtained by Mabood et al. (2015), Hesameddini and Peyrovi (2010) and Dastidar and Majumdar (1972).

Fig. 1
figure 1

Comparison between DJM, OHAM, HPM and CSM results for \( \mu = 5 \)

Table 2 shows a comparison of the accuracy of methods DJM, OHM, Sinc-collocation and VIM-Pade. The accuracy of the methods is determined by comparing the results obtained through these methods with results by Runge–Kutta method (RK4) which is a built-in coding in MAPLE software, for \( \mu = 1 \). It is found that the accuracy of the DJM deteriorates faster than other methods.

Table 2 Comparison of accuracy by DJM, OHAM, Sinc-collocation and VIM-Pade’ for \( \mu = 1 \), \( \Delta y\left( x \right) = \left| {y_{\text{RK4}} - y_{\text{method}} } \right| \)

The accuracy of DJM for Painlevé equation II with \( \mu = 0, 2 \) and \( 5 \) is determined by comparing the results with the results obtained by Runge–Runge method (RK4). The difference with RK4 results is tabulated in Table 3 where it is shown that the accuracy of the results deteriorated when the values of \( x \) move away from an initial value of \( 0. \) This is due to the range of utility of the power series is limited to the neighbourhood of the origin by its convergence radius that is determined by the singularity closest to that point. Moreover, the Painlevé equation II, which is a type of nonlinear equation, generates singularities spontaneously that move when the initial condition change. Increasing the value of \( \mu \) did not have a significant impact on accuracy. For example, when \( \mu = 5 \) accuracy of the results by DJM is in the magnitude of \( 10^{ - 14} \) at the point \( x = 0.1 \). However, similar to the case of \( \mu = 0 \), the accuracy declined when the value of \( x \) increases.

Table 3 The accuracy of DJM for Painlevé equation II, \( \Delta y\left( x \right) = \left| {y_{\text{RK4}} - y_{\text{DJM}} } \right| \)

4 Conclusion

In this work, we employed the Daftardar–Gejji and Jafari method for solving the Painlevé equation II. The numerical results by DJM are in good agreement with those obtained by OHAM, HPM, ACE, CSM and VIM-Pade method. However, in this paper, we show that the approximate solution loses their accuracy for values of \( x \) away from the initial value of \( 0 \).