Introduction

Nonlinear singular boundary value problems represent a significant class of boundary value problem and have a great application in several branches of science and engineering. For example, the oxygen diffusion [1, 2], the heat conduction [3], and the thermal explosion [4] are modeled by the singular boundary value problems. A lot of nonlinear singular problems depending on the boundary conditions usually given by Dirichlet boundary conditions, mixed boundary conditions and Neumann boundary conditions. The Neumann boundary conditions are usually the most physically reasonable choice [5].

We consider the following Lane–Emden equation with the Neumann-Robin and Neumann boundary conditions [6,7,8,9,10,11]

$$\begin{aligned} \left\{ \begin{array}{ll} \displaystyle u''+\frac{\alpha }{x}u'=f(x,u),~~~x\in (0,1),\\ u'(0)=0,~~~a u(1)+b u'(1)=c, \\ u'(0)=0,~~~~~~~u'(1)=c, \end{array} \right. \end{aligned}$$
(1)

where \(a>0\), b and c are any finite real constants. The second kind Lane–Emden equation is used to model a thermal explosion in an infinite cylinder or a sphere [12]. Several methods are available for analytical [13,14,15,16,17] and numerical solutions [18, 19] to solve the Lane–Emden equation.

In this paper, we propose the homotopy perturbation method for the approximate solution of the Lane–Emden equation with boundary conditions. In the proposed method, the integral form of the Lane–Emden equations is considered before designing the recursion scheme for obtaining the approximations to solutions.

The Homotopy Perturbation Method

Recently, the idea of the HPM and its applicability to different types of differential and integral equations has been used in [20, 21]. Consider

$$\begin{aligned} u(x)=g(x)+\int _{a}^{b} k(x,s) f(s,u(s)) ds,~~x\in \Omega . \end{aligned}$$
(2)

To apply the HPM, we reconstitute (2) as

$$\begin{aligned} L(u)=u(x)-g(x)-\int _{a}^{b} k(x,s) f(s,u(s)) ds=0,~~x\in \Omega , \end{aligned}$$
(3)

with solution \(u(x) =y(x)\). We construct the homotopy of (3), H(up)

$$\begin{aligned} H(u,p) = (1-p)(u-g) +p(L(u))= 0,~~p\in [0,1],~x\in \Omega \end{aligned}$$
(4)

where p is an embedding parameter, it is clear that for \(p=0\), then \(H(u, 0)=u-g=0\) or \(u_0=g\), and for \(p=1\), then \(H(u,1)=L(u)= 0\). As the parameter p increases monotonically from 0 to 1, the changing process of p from 0 to 1 is just that of u(xp) from \(u_0\) to u.

According to the HPM, we can first view the embedding parameter p as a small parameter, and construct the solution as a power series in p, i.e.,

$$\begin{aligned} u=\sum _{k=0}^{\infty } p^{k}u_k=u_0+p u_1+p^2 u_2+ \cdots . \end{aligned}$$
(5)

where the coefficients \(u_{k}\), \(k =0,1,2,...,\) are to be determined. The result, nonetheless, is valid for any p. Setting \(p=1\), we obtain the solution of Eq. (2) given by

$$\begin{aligned} \displaystyle y(x)=\lim _{p\rightarrow 1} u=\sum _{k=0}^{\infty }u_k. \end{aligned}$$
(6)

The series (6) is a convergent series and the rate of convergence depends on the nature of Eq. (2), [22].

Lane–Emden Equation with Neumann-Robin Boundary Conditions

Integrating Eq. (1) twice and utilizing boundary conditions \(u'(0)=0,~~~au(1)+b u'(1)=c\), we obtain

$$\begin{aligned} u(x)=\frac{c}{a}-\frac{b }{a}\int \limits _{0}^{1}t^{\alpha }f(t,u(t))dt-\int \limits _{x}^{1}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha }f(t,u(t))dt\bigg ) ds~~~{a>0}. \end{aligned}$$
(7)

The homotopy for (7) is constructed as

$$\begin{aligned} u(x)-\frac{c}{a}+p\bigg \{\frac{b }{a}\int \limits _{0}^{1}t^{\alpha }f(t,u(t))dt +\int \limits _{x}^{1}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha }f(t,u(t))dt\bigg ) ds\bigg \}=0. \end{aligned}$$
(8)

Substituting the series (5) into (8), we obtain

$$\begin{aligned}&\sum _{k=0}^{\infty } p^{k}u_k-\frac{c}{a}+p\bigg \{\frac{b }{a}\int \limits _{0}^{1}t^{\alpha }f\bigg (t,\sum _{k=0}^{\infty } p^{k}u_k\bigg )dt\nonumber \\&\quad +\int \limits _{x}^{1}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } f\bigg (t,\sum _{k=0}^{\infty } p^{k}u_k\bigg )dt\bigg ) ds\bigg \}=0. \end{aligned}$$
(9)

The nonlinear term in above expression is decomposed as

$$\begin{aligned} f\bigg (x,\sum _{k=0}^{\infty } p^{k}u_k\bigg )=\sum _{k=0}^{\infty } p^{k}H_k \end{aligned}$$
(10)

where \(H_n\) [21] is given by

$$\begin{aligned} H_n=\frac{1}{n!}\frac{d^n}{d p^n}\bigg \{f\bigg (x,\sum _{k=0}^{\infty } p^{k}u_k\bigg )\bigg \}_{p=0},~~~~~n\ge 0. \end{aligned}$$
(11)

Equation (9) can be written as

$$\begin{aligned} \sum _{k=0}^{\infty }p^{k}u_k-\frac{c}{a}+p\bigg \{\frac{b }{a}\int \limits _{0}^{1}t^{\alpha }\sum _{k=0}^{\infty } p^{k}H_kdt+\int \limits _{x}^{1}\frac{1}{s^{\alpha }}\bigg (\int \limits _{0}^{s}t^{\alpha }\sum _{k=0}^{\infty } p^{k}H_k dt\bigg ) ds\bigg \}=0. \end{aligned}$$
(12)

Collecting terms in powers of p and setting their coefficients to zero, we find

$$\begin{aligned} \left. \begin{array}{ll} &{}k=0~~~~~~u_{0}(x)=\displaystyle \frac{c}{a},\\ &{}k=1~~~~~~\displaystyle u_1(x)=-\frac{b}{a}\int \limits _{0}^{1}t^{\alpha }H_0dt-\int \limits _{x}^{1}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } H_0dt\bigg ) ds,\\ &{}\vdots \\ &{}k=n~~~~~~~ \displaystyle u_n(x)=-\frac{b}{a}\int \limits _{0}^{1}t^{\alpha }H_{n-1}dt-\int \limits _{x}^{1}\frac{1}{s^{\alpha }}\bigg (\int \limits _{0}^{s}t^{\alpha } H_{n-1}dt\bigg ) ds. \end{array} \right\} \end{aligned}$$
(13)

The nth-order approximate solution will be obtained as

$$\begin{aligned} \psi _n(x) =\displaystyle \sum _{k=0}^{n} u_k(x). \end{aligned}$$

Lane–Emden Equation with Neumann Boundary Conditions

According the approach given in [5], the domain of solution [0, 1] is dividing as \([0,1]=[0,\frac{1}{2}]\cup [\frac{1}{2},1]\). Then, we will solve two sub-problems below. Firstly, we consider the following Lane–Emden equations with Neumann and Dirichelt boundary conditions as

$$\begin{aligned}&(x^{\alpha }u'(x))'=x^{\alpha }f(x,u(x)),~~~~~~0\le x\le \frac{1}{2}, \end{aligned}$$
(14)
$$\begin{aligned}&u'(0)=0,~~~~~~~u\bigg (\frac{1}{2}\bigg )=d. \end{aligned}$$
(15)

Integrating Eq. (14) twice first from 0 to x and then from x to \(\frac{1}{2}\), and applying the Neumann and Dirichelt boundary conditions \(u'(0)=0,~~u\big (\frac{1}{2}\big )=d\), we obtain

$$\begin{aligned} u(x)=d-\int \limits _{x}^{\frac{1}{2}}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s} t^{\alpha }f(t,u(t)) dt\bigg ) ds. \end{aligned}$$
(16)

Constructing the homotopy for (16) and substituting the relation from (5) and (10), we obtain

$$\begin{aligned} \sum _{k=0}^{\infty }p^{k}u_k-d+p\int \limits _{x}^{\frac{1}{2}}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha }\sum _{k=0}^{\infty } p^{k}H_k dt\bigg ) ds=0. \end{aligned}$$
(17)

Collecting terms in powers of p and setting their coefficients to zero, we find

$$\begin{aligned} \left. \begin{array}{ll} &{}k=0~~~~~:u_{0}(x)=d\\ &{}k=1~~~~~:u_1(x)= - \displaystyle \int \limits _{x}^{\frac{1}{2}}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } H_0 dt\bigg ) ds\\ &{}\vdots \\ &{}k=n~~~~~:u_n(x)=-\displaystyle \int \limits _{x}^{\frac{1}{2}}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } H_{n-1}dt\bigg ) ds \end{array} \right\} \end{aligned}$$
(18)

Then, the n-terms approximate solution is defined by

$$\begin{aligned} \psi ^{(I)}_n(x)=\sum _{k=0}^{n} u_k(x,d). \end{aligned}$$
(19)

Finally, we consider the following Lane–Emden equations with Dirichelt and Neumann as

$$\begin{aligned}&(x^{\alpha }u'(x))'=x^{\alpha }f(x,u(x)),~~\frac{1}{2}\le x\le 1, \end{aligned}$$
(20)
$$\begin{aligned}&u\bigg (\frac{1}{2}\bigg )=d,~~~~~~~u'(1)=c \end{aligned}$$
(21)

Integrating (20) twice first from x to 1 and then \(\frac{1}{2}\) to x, applying BCs (21), we have

$$\begin{aligned} u(x)=d+ c \int \limits _{\frac{1}{2}}^{x} \frac{ ds}{s^{\alpha }} -\int \limits _{\frac{1}{2}}^{x}\frac{1}{s^{\alpha }} \bigg (\int \limits _{s}^{1} t^{\alpha }f(t,u(t)) dt\bigg ) ds. \end{aligned}$$
(22)

As we did before, we construct the homotopy for (22) and substitute the relation from (5) and (10) we have

$$\begin{aligned} \sum _{k=0}^{\infty }p^{k}u_k-d- c p\int \limits _{\frac{1}{2}}^{x} \frac{ ds}{s^{\alpha }} +p\int \limits _{\frac{1}{2}}^{x}\frac{1}{s^{\alpha }}\int \limits _{s}^{1} t^{\alpha }\bigg (\sum _{k=0}^{\infty } p^{k}H_k\bigg ) dt ds=0. \end{aligned}$$
(23)

Collecting terms in powers of p and setting their coefficients to zero, we find

$$\begin{aligned} \left. \begin{array}{ll} &{}k=0~~~~~:u_0(x)=d\\ &{}k=1~~~~~:u_1(x)=\displaystyle c\int \limits _{\frac{1}{2}}^{x} \frac{ds}{s^{\alpha }}+\int \limits _{\frac{1}{2}}^{x}\frac{1}{s^{\alpha }} \bigg (\int \limits _{s}^{1} t^{\alpha }H_{0} dt\bigg ) ds\\ &{}\vdots \\ &{}k=n~~~~~:u_n(x)= \displaystyle \int \limits _{\frac{1}{2}}^{x}\frac{1}{s^{\alpha }} \bigg (\int \limits _{s}^{1} t^{\alpha }H_{n-1} dt\bigg ) ds. \end{array} \right\} \end{aligned}$$
(24)

Then, we denote the n-terms approximate of the series solution

$$\begin{aligned} \psi ^{(II)}_n(x)=\sum _{k=0}^{n} u_k(x,d). \end{aligned}$$
(25)

Note that the approximations \(\psi ^{(I)}_n(x)\) and \(\psi ^{(II)}_n(x)\) depending on unknown parameter d. In order to determine unknown constant d, we will use the continuity condition for the flux [5] as

$$\begin{aligned} \psi '^{(I)}_n\bigg (\frac{1}{2},d\bigg )-\psi '^{(II)}_n\bigg (\frac{1}{2},d\bigg )=0,~~~~n=1,2,\ldots \end{aligned}$$
(26)

which leads to a sequence of algebraic equations in d. By solving these equations, we can find the values of d. After obtaining the value of d, the approximate solution of (1) is obtained as

$$\begin{aligned} \displaystyle \psi _n(x)=\displaystyle \left\{ \begin{array}{ll} \displaystyle \psi ^{(I)}_n(x,d_n), &{} {0\le x\le \frac{1}{2}}, \\ \displaystyle \psi ^{(II)}_n(x,d_n), &{} {\frac{1}{2}\le x\le 1}, \end{array} \right. \end{aligned}$$
(27)

where \(d_{n},~ n=1,2,\ldots \) are approximate values of d.

Numerical Results

In this section, we present the numerical results and discussion of the proposed method for solving two singular models. All the results are computed using the symbolic software Mathematica.

Problem-1

Consider the nonlinear Lane–Emden (1) and \(u'(0)=0,~au(1)+b u'(1)=c\) with \(f(u)=-\delta e^{\frac{u}{1+\epsilon u}}\) where \(\delta \) and \(\epsilon \) are physical parameters [23]. According to HPM (19) with \(a=1,b=0,c=0\), we obtain

$$\begin{aligned} \left. \begin{array}{ll} &{}k=0~~~~~~u_{0}=0,\\ &{}k=1~~~~~~u_1(x)=-\displaystyle \int \limits _{x}^{1}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } H_0dt\bigg ) ds,\\ &{}\vdots \\ &{}k=n~~~~~~~u_n(x)=-\displaystyle \int \limits _{x}^{1}\frac{1}{s^{\alpha }}\bigg (\int \limits _{0}^{s}t^{\alpha } H_{n-1}dt\bigg ) ds \end{array} \right\} \end{aligned}$$
(28)

Using (28), the 3rd-order approximations are obtained for two specific parameters \(\alpha =1\) and \(\alpha =2\) as follows:

$$\begin{aligned} \psi _3(x)&=\delta \left( \frac{1}{4}-\frac{x^2 }{4}\right) +\delta ^2\left( \frac{3 }{64}-\frac{x^2}{16}+\frac{x^4}{64}\right) + \delta ^3\bigg (\frac{(30-22 \epsilon )}{2304}+\frac{(-45+36 \epsilon )x^2 }{2304}\\&\quad +\,\frac{ (18-18 \epsilon )x^4}{2304}+\frac{(-3+4 \epsilon )x^6 }{2304}\bigg )+\ldots ~~~~~(\hbox {for}~ \alpha =1)\\ \psi _3(x)&=\delta \left( \frac{1}{6}-\frac{ x^2 }{6}\right) +\delta ^2\left( \frac{7}{360}-\frac{x^2}{36}+\frac{x^4 }{120}\right) + \delta ^3\bigg (\frac{(25-19 \epsilon )}{7560}+\frac{(-42+35 \epsilon )x^2 }{7560}\\&\quad +\,\frac{(21-21 \epsilon )x^4 }{7560}+\frac{(-4+5 \epsilon )x^6 }{7560}\bigg )+\ldots ,~~~~~(\hbox {for}~ \alpha =2) \end{aligned}$$

To verify whether the our approximation converges or not, we define the residual error function as

$$\begin{aligned} R_n(x)=\left| \psi ''_n(x)+\frac{\alpha }{x}\psi '_n(x)+\delta \exp \left( \frac{\psi _n(x)}{1+\epsilon \, \psi _n(x)}\right) \right| ,~~~~n=1,2,\ldots \end{aligned}$$
(29)
Fig. 1
figure 1

Plot of residual error \(R_n\) when \(\alpha =1, \delta =1, \epsilon =1\)

Fig. 2
figure 2

Plot of residual error \(R_n\) when \(\alpha =1, \delta =1, \epsilon =2\)

Fig. 3
figure 3

Plot of residual error \(R_n\) when \(\alpha =1, \delta =1, \epsilon =3\)

Fig. 4
figure 4

Plot of residual error \(R_n\) when \(\alpha =1, \delta =1, \epsilon =5\)

Fig. 5
figure 5

Plot of residual error \(R_n\) when \(\alpha =2, \delta =1, \epsilon =1\)

Fig. 6
figure 6

Plot of residual error \(R_n\) when \(\alpha =2, \delta =1, \epsilon =2\)

Fig. 7
figure 7

Plot of residual error \(R_n\) when \(\alpha =2, \delta =1, \epsilon =3\)

Fig. 8
figure 8

Plot of residual error \(R_n\) when \(\alpha =2, \delta =1, \epsilon =5\)

We next fix the parameters \(\delta =1, \alpha =1 \) and consider the influence of the parameter \(\epsilon \) on the residual error \(R_n(x),~n=1,2,3,4\) in Fig. 1 (where \(\epsilon =1\)), Fig. 2 (where \(\epsilon =2\)), Fig. 3 (where \(\epsilon =3\)) and Fig. 4 (where \(\epsilon =5\)). Similarly, we fix \(\delta =1, \alpha =2\) and check the influence of \(\epsilon \) on the residual error in the Figs. 567 and 8. In each case, we see that the residual error increases with an increases in \(\epsilon \). From these plots, it can be observed that the \(R_n(x)\) converges to zero as n tends to infinity.

In Table 1 (with \(\alpha =1\)), Table 2 (with \(\alpha =2\)) and Table 3 (with \(\alpha =5\)), we list the numerical results of the 6-terms approximate series solution \(\psi _6\) obtained by proposed method. We fix \(\delta =1\) and consider the influence of \(\epsilon \) on the solution of the problem in Tables 123. From the same Tables, we observe that the solution decreases when \(\alpha \) increases from \(\alpha =1\) to \(\alpha =5\).

Problem-2

Consider the Lane–Emden model (1) with \(u'(0)=0,~~u'(1)=c\), \(f(x,u)=4 x^{2} e^{2u}-2(\alpha +1) e^{u}\) and \(c=-\frac{2}{5}\). Its analytical solution is \(u=\ln \frac{1}{4+x^{2}}\). According to HPM (19), we obtain

$$\begin{aligned} \left. \begin{array}{ll} &{}k=0~~:u_{0}=d\\ &{}k=1~~:u_1= - \displaystyle \int \limits _{x}^{\frac{1}{2}}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } H_0 dt\bigg ) ds\\ &{}\vdots \\ &{}k=n~~:u_n=- \displaystyle \int \limits _{x}^{\frac{1}{2}}\frac{1}{s^{\alpha }} \bigg (\int \limits _{0}^{s}t^{\alpha } H_{n-1}dt\bigg ) ds \end{array} \right\} \end{aligned}$$
(30)

Using (30), the three terms approximation is obtained below.

$$\begin{aligned} \psi ^{(I)}_3(x,d)&= d+\frac{e^{d }}{4}+\frac{e^{2 d }}{32}-\frac{e^{3 d }}{128}+\frac{3 e^{4 d }}{8192}+\left( -e^{d }-\frac{e^{2 d }}{4}+\frac{e^{3 d }}{64}\right) x^2\\&\quad +\,\left( \frac{e^{2 d }}{2}+\frac{e^{3 d }}{8}-\frac{e^{4 d }}{128}\right) x^4 -\,\frac{1}{4} e^{3 d } x^6+\frac{1}{32} e^{4 d } x^8+\cdots ~~~(\hbox {for}~ \alpha =1).\\ \psi ^{(I)}_3(x,d)&= d +\frac{e^{d }}{4}+\frac{e^{2 d }}{32}-\frac{e^{3 d }}{168}+\frac{13 e^{4 d }}{57600}+\left( -e^{d }-\frac{e^{2 d }}{4}+\frac{e^{3 d }}{80}\right) x^2 \\&\quad +\,\left( \frac{e^{2 d }}{2}+\frac{e^{3 d }}{10}-\frac{e^{4 d }}{200}\right) x^4 -\,\frac{23}{105} e^{3 d } x^6+\frac{1}{45} e^{4 d } x^8+\ldots ~~~~(\hbox {for}~ \alpha =2). \end{aligned}$$
Table 1 Numerical solution \(\psi _6\) for \(\alpha =1, \delta =1\)
Table 2 Numerical solution \(\psi _6\) for \(\alpha =2, \delta =1\)
Table 3 Numerical solution \(\psi _6\) for \(\alpha =5, \delta =1\)

According to the HPM (24), we have

$$\begin{aligned} \left. \begin{array}{ll} &{}k=0~~~:u_0=d\\ &{}k=1~~~:u_1=-\displaystyle \frac{2}{5}\int \limits _{\frac{1}{2}}^{x} \frac{ds}{s^{\alpha }}- \int \limits _{\frac{1}{2}}^{x}\frac{1}{s^{\alpha }}\int \limits _{s}^{1} t^{\alpha }H_{0} d\,t ds\\ &{}\vdots \\ &{}k=n~~~:u_n=- \displaystyle \int \limits _{\frac{1}{2}}^{x}\frac{1}{s^{\alpha }}\int \limits _{s}^{1} t^{\alpha }H_{n-1} d\,t ds. \end{array} \right\} \end{aligned}$$
(31)

Using (31), the two terms approximation is obtained below.

$$\begin{aligned} \psi ^{(II)}_2(x,d)&=d+\frac{e^{d }}{4}-\frac{e^{2 d }}{64}-e^{d } x^2+\frac{1}{4} e^{2 d } x^4\\&\quad +\,\left( -\frac{2}{5}+2 e^{d }-e^{2 d }\right) \ln (2 x)+...~~~(\hbox {for}~ \alpha =1).\\ \psi ^{(II)}_2(x,d)=&d+\frac{1}{80} \left( -64+340 e^{d }-129 e^{2 d }\right) +\frac{32-160 e^{d} +64 e^{2 d }}{80 x}-e^{d } x^2\\&\quad +\,\frac{1}{5} e^{2 d } x^4+...~~~(\hbox {for}~ \alpha =2). \end{aligned}$$

To find the unknown constant d, we use the continuity condition for the flux as

$$\begin{aligned} \psi '^{(I)}_n\bigg (\frac{1}{2},d\bigg )-\psi '^{(II)}_n\bigg (\frac{1}{2},d\bigg )=0,~~~~n=1,2,\ldots \end{aligned}$$
(32)

which leads to a sequence of algebraic equations in d. Using the Newton’s method, we obtain the approximate values of d, see Table 4.

Table 4 The approximate value of d when \(\alpha =1,2\)
Table 5 Maximum absolute errors of problem 2
Fig. 9
figure 9

Approximate and the exact solutions of problem 2

After finding the numerical value of d, we obtain the approximate solution of the original problem as follows

$$\begin{aligned} \displaystyle \psi _n(x)=\displaystyle \left\{ \begin{array}{ll} \displaystyle \psi ^{(I)}_n(x,d_n), &{} 0\le x\le \frac{1}{2}, \\ \displaystyle \psi ^{(II)}_n(x,d_n), &{} \frac{1}{2}\le x\le 1. \end{array} \right. \end{aligned}$$
(33)

To show the accuracy of the proposed method, we define the maximum absolute error as

$$\begin{aligned} E_{\max }^{(n)}=\displaystyle \max _{x\in (0,1)}|\psi _n(x)-u(x)|,~~~n=1,2,\ldots \end{aligned}$$
(34)

where u is the exact solution and \(\psi _n\) is the approximate solution. The maximum absolute errors \(E_{\max }^{(n)},~ n=1,3,\ldots 5\), are computed and listed in Table 5. From these numerical results, it is observed that the maximum absolute errors \(E_{\max }^{(n)}\) converging to zero as n becomes very large. In Figure 9 we show that the curves of the exact solution u and the approximate solution \(\psi _n,~n=2,3\) for \(\alpha =1,2\), where \(\psi _3\) and the exact solution overlap.

Conclusion

We investigated the perturbed second kind Lane–Emden equation that models the steady state temperature distribution [12]. We have proposed a modified homotopy perturbation method, where the integral form of Lane–Emden equations was considered to derive the recursive relation that will handle the given boundary conditions. We also decomposed the domain into two subintervals to give a reliable treatment for the Lane–Emden equation with Neumann boundary conditions. The proposed methods provide the direct recursive schemes for computing approximation to solutions; and we also graphically showed that these approximations to solutions are almost identical to the analytical solutions. The advantage of the proposed schemes is that they do not require the computation of undetermined coefficients, whereas most of previous recursive schemes do require the computation of undetermined coefficients.