1 Introduction

Singular boundary value problems (SBVPs) in ordinary differential equations have recently attracted a lot of attention from the researchers. Such SBVPs [115] arise from applied mathematics, physics, physiological science and engineering applications such as electro hydrodynamics, nuclear physics, transport processes, atomic structure, atomic calculation, gas dynamics, chemical reaction and thermal explosion. Generally, it is often difficult or impossible to find an exact analytical solution for a given nonlinear singular boundary value problem. Therefore, an accurate, efficient, easy-to-use and fast numerical method for solving such problems is needed.

We consider the following class of singular two-point boundary value problems:

$$\begin{aligned}&(x^{\alpha }y^{\prime })^{\prime }=f(x,y), \end{aligned}$$
(1)
$$\begin{aligned}&y^{\prime }(0)=0, \quad \mu y(1)+\sigma y^{\prime }(1)=B, \end{aligned}$$
(2)

or

$$\begin{aligned} y(0)=A, \quad \mu y(1)+\sigma y^{\prime }(1)=B. \end{aligned}$$
(3)

where \(\mu >0\), \(\sigma \ge 0\), and AB are finite constants. The following conditions have been imposed on f(xy) : 

  1. C1:

    f(xy) is continuous for all \((x,y)\in \left\{ [0,1]\times \mathfrak {R}\right\} \),

  2. C2:

    f(xy) is continuously differentiable with respect to y, for all \(x\in [0,1]\), and all real y,

  3. C3:

    \(\partial f(x,y)/\partial y\ge 0\).

The problem (1)–(2) with \(\alpha =2\) and \(f(x,y)=\delta y/(y+\lambda ),\delta > 0, \lambda >0\) arises in the study of steady state oxygen-diffusion in a spherical cell with Michaelis–Menten uptate kinetics [7, 8]. A similar problem with \(\alpha =1\) arises in the study of thermal explosions for \(f(x,y)=-\nu e^{y}\), where \(\nu \) is a physical parameter [2]. This problem also arises in the study of distribution of heat sources in the human head [9, 10] for \(f(x,y)=-\rho e^{-\rho \lambda y}, \rho >0,\lambda >0.\) Moreover, the problem (1)–(2) with \(\alpha =0,1,2\) arise in the study of various tumour growth problems with linear function f(xy),  [1115].

We note that the existence and uniqueness of the solution to the problem (1) with boundary conditions \(y(0)=0\), \(y(1)=A\) and with boundary conditions \(y^{\prime }(0)=0\), \(y(1)=A\) have been established in [1618].

The singularity behavior that occurs at the point \(x=0\) is the main difficulty of the problem (1). Various efficient numerical techniques for the solution of such problems have been developed in the literature. Chawla et al. [19] presented a second order finite difference method based on a uniform mesh for the solution of the problem (1) with boundary condition \(y^{\prime }(0)=0\), \(y(1)=B\), for \(\alpha \ge 1\). Kanth and Reddy [20] employed cubic splines functions after modifying the Eq. (1) at the singular point by using L’Hospital rule. In [21], Kumar and Singh applied modified decomposition method for the problem (1) arising in various physical problems. Mittal and Nigam [22] implemented Adomian decomposition method in stepwise manner to obtain numerical solution of the problem (1)–(2). Kumar and Aziz [23] developed a three-point finite difference method using Chawla’s identity [24] for the problem (1) for \(\mathrm{the~case}~x^{\alpha }\, f(x,y)\ \mathrm{replaced~by}\ f(x,y). \) Wazwaz [25] considered the variational iteration method to study a nonlinear singular boundary value problem that arise in various physical equations. Asaithambi and Garner [26] have developed a numerical technique for obtaining pointwise bounds for the solution of a class of nonlinear boundary-value problems arising in physiology. Khuri and Sayfy [27] presented a numerical technique based on a combination of a modified decomposition approach and cubic B-splines collocation for the solution of the class of singular BVP (1)–(2). They have decomposed the domain of the problem into two subintervals. A modified decomposition method based on a special integral operator was applied in the vicinity of the singular point to remove the singularity and outside this domain the resulting problem was tackled by applying the B-spline scheme.

To the authors knowledge there is no study on a recursive scheme based on HPM applied to singular boundary value problem (1)–(2) or (1)–(3). Although recursive scheme using Adomian decomposition method [37], optimal homotopy analysis method [38] or modified Adomian decomposition method [27] has been developed for solving singular two-point boundary value problems, these methods, however, require the computation of undetermined coefficients, which increases the computational complexity. In this paper we present a new recursive numerical technique based on the homotopy perturbation method for the approximation of a class of nonlinear singular boundary value problem (1) with boundary conditions (2) or (3). This method does not demand the computation of undermined coefficients. First, the original singular differential equation is transformed into an equivalent integral equation to overcome the singular behaviour at the origin. Then the resulting equation is tackled by the application of HPM. The boundary condition at \(x=1\) is imposed to eliminate the undetermined coefficient that associated with the integral equation. Moreover, the present method does not require any discretization or linearization of variables as compared to other methods such as finite difference method, finite element method or spline method. The major advantage of our method over other methods is that it provides a direct recursive scheme to obtain approximate solution. The approximate solution is obtained in the form of power series with easily calculable components. Another advantage is that it requires less computational work as compared to other existing recursive schemes [27, 37, 38]. The convergence analysis of the proposed method is established in the paper. Several numerical examples are given to illustrate the applicability and accuracy of the algorithm. The numerical results are compared with that obtained using finite difference method, decomposition method and spline method. Comparison shows that our method with few solution components provides better result than the methods given in [2024, 28, 33].

This article is organized as follows. In Sect. 2, we discuss the basic principles of HPM to nonlinear differential equations. We derive a recursive scheme based on HPM for solving the singular boundary value problem (1) with boundary condition (2) or (3) in Sect. 3. Sect. 4 is devoted to convergence analysis. In Sect. 5, we apply the present method to singular boundary value problem arising in various physical models of engineering and science. In addition, we make a comparison of the numerical results of the proposed method with the existing methods. Finally, we summarize the main conclusions of the work in Sect. 6.

2 Review of homotopy-perturbation method

In this section, we will give a brief outline of the homotopy-perturbation method. HPM is a combination of the classical perturbation method and the homotopy concept as used in topology. The method was originally introduced by He [29]. HPM has been effectively applied to solve linear or nonlinear differential equations, fractional differential equation and integral equations [3032]. The main feature of the method is the condition of homotopy by introducing an embedment parameter p,  which takes the value from 0 to 1. If \(p=0,\) the homotopy equation generally reduces to a sufficiently simplified form, which yields a rather simple solution. While \(p=1\), it turns out to be the original problem, and gives the required solution. We consider the nonlinear differential equation:

$$\begin{aligned} G(y(x))+f(r(x))=0, \end{aligned}$$
(4)

subject to the boundary condition

$$\begin{aligned} B^{*}\left( y,\frac{\partial y}{\partial n}\right) =0, \quad r\epsilon \varGamma . \end{aligned}$$
(5)

where G represents the general differential operator, f(r) denotes an analytical function, y(x) is an unknown function, \(\varGamma \) is the boundary of the domain \(\varOmega \) and \(B^{*}\) is a boundary operator. The operator G can be divided into two parts, say L and N, where L and N denote the linear and nonlinear operator, respectively.

Now Eq. (4) reduces to as follows

$$\begin{aligned} L(y(x))+N(y(x))+f(r(x))=0. \end{aligned}$$
(6)

According to homotopy perturbation method, we can construct a homotopy \(y(r,p):\varOmega \times [0,1]\rightarrow R\), for the Eq. (4) which satisfies the following relation

$$\begin{aligned} H(y(x),p)=(1-p)[L(y(x))-L(y_0(x))]+p[G(y(x))+f(r(x))]=0. \end{aligned}$$
(7)

or

$$\begin{aligned} H(y(x),p)=L(y(x))-L(y_0(x))+pL(y_0(x))+p[N(y(x))+f(r(x))]=0. \end{aligned}$$
(8)

where \(p\epsilon [0,1]\) is an embedding parameter, \(y_0(x)\) is an initial approximation of Eq. (4).

If \(p=0\), then Eq. (8) becomes

$$\begin{aligned} H(y(x),0)=L(y(x))-L(y_0(x))=0. \end{aligned}$$
(9)

and when \(p=1\), Eq. (8) takes the original form of Eq. (4), that means

$$\begin{aligned} H(y(x),1)=G(y(x))+f(r(x))=0. \end{aligned}$$
(10)

We note that the changing process of the parameter p from 0 to 1 is just that of y(rp) from \(y_0(r,p)\) to y(rp). Applying the perturbation technique, we have the following power series presentation for y in terms of the homotopy parameter p:

$$\begin{aligned} y=y_0+py_1+ p^{2}y_2+p^{3}y_3+p^{4}y_4+\cdots = \sum \limits _{i=0}^\infty y_ip^{i}. \end{aligned}$$
(11)

where the solution component \(y_n\) are to be recursively computed.

Substituting \(p=1\) in (11), yields the approximate solution of (4) as follows

$$\begin{aligned} y(x)= & {} \lim _{p \rightarrow 1}[y_0(x)+py_1(x)+ p^{2}y_2(x)+p^{3}y_3(x)+p^{4}y_4(x)+\cdots ],\nonumber \\= & {} y_0(x)+y_1(x)+y_2(x)+y_3(x)+y_4(x)+\cdots = \sum \limits _{i=0}^\infty y_i(x). \end{aligned}$$
(12)

3 Derivation of recursive methods

In this section, we derive a recursive scheme based on HPM for solving singular boundary value problems (1) with boundary conditions (2) or with boundary conditions (3).

3.1 Method with Neumann and Robin boundary conditions

To derive the method, we set \(z(x)=x^{\alpha }y^{\prime }\) in Eq. (1), then integrating Eq. (1) from 0 to x, we get

$$\begin{aligned} z(x)=z(0)+\int _0^x t^{\alpha }f(t,y)\,\mathrm {d}t. \end{aligned}$$
(13)

Now applying the boundary condition at \(x=0\), it follows that

$$\begin{aligned} y^{\prime }(x)=\frac{1}{x^{\alpha }}\int _0^x t^{\alpha }f(t,y)\,\mathrm {d}t. \end{aligned}$$
(14)

Again integrating Eq. (14) from x to 1, we obtain

$$\begin{aligned} y(x)=y(1)-\int _x^1\frac{1}{\eta ^{\alpha }}\left( \int _0^\eta t^{\alpha }f(t,y)\,\mathrm {d}t\right) d\eta . \end{aligned}$$
(15)

We set \(y(1)=C^{*}\), where \(C^{*}\) is unknown. To determine the value of \(C^{*}\) in Eq. (15) we impose the boundary condition at \(x=1\), \(\mu y(1)+\sigma y^{\prime }(1)=B\). With the help of the boundary condition, we obtain

$$\begin{aligned} y(1)=C^{*}=\frac{B}{\mu }-\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,y)\,\mathrm {d}t. \end{aligned}$$
(16)

Insert Eq. (16) into Eq. (15) to get

$$\begin{aligned} y(x)=\frac{B}{\mu }-\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,y)\,\mathrm {d}t-\int _x^1\frac{1}{\eta ^{\alpha }}\left( \int _0^\eta t^{\alpha }f(t,y)\,\mathrm {d}t\right) d\eta . \end{aligned}$$
(17)

Now, interchanging the order of integration in (17), we get

$$\begin{aligned} y(x)= & {} \frac{B}{\mu }-\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,y)\,\mathrm {d}t-\int _0^x\bigg (\int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha }f(t,y)dt\nonumber \\&-\,\int _x^1\bigg (\int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha }f(t,y)dt. \end{aligned}$$
(18)

The HPM is extended to solving integral Eq. (18) derived from Eq. (1) with boundary condition (2)

Now we consider Eq. (18) as

$$\begin{aligned} L(y)= & {} y(x)-\frac{B}{\mu }+\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,y)\,\mathrm {d}t +\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }f(t,y)dt\nonumber \\&+\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }f(t,y)dt=0. \end{aligned}$$
(19)

Following the homotopy perturbation method, we can construct the homotopy H(yp) for Eq. (18) by

$$\begin{aligned} H(y,p)=(1-p)F(y)+pL(y)=0, \end{aligned}$$
(20)

where \(F(y)=y(x)-\frac{B}{\mu }.\)

If \(p=0\), then Eq. (20) becomes

$$\begin{aligned} H(y,0)=F(y)=0, \end{aligned}$$
(21)

and when \(p=1\), Eq. (20) turns out to be the original equation, i.e.

$$\begin{aligned} H(y,1)= & {} y(x)-\frac{B}{\mu }+\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,y)\,\mathrm {d}t +\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }f(t,y)dt\nonumber \\&+\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }f(t,y)dt=0. \end{aligned}$$
(22)

The nonlinear function f(xy) is decomposed in terms of the He’s polynomial \(H_n(x)\), as

$$\begin{aligned} f(x,y)=\sum \limits _{n=0}^\infty H_n(y_0,y_1,\ldots , y_n)P^{n}. \end{aligned}$$
(23)

where

$$\begin{aligned} H_n(y_0,y_1,\ldots , y_n)=\frac{1}{n !}\left( \frac{d^{n}f(x,y)}{dp^{n}}\right) _{p=0}. \end{aligned}$$
(24)

Inserting Eq. (11) into Eq. (22) and then equating the identical powers p, we obtain the following set of integral equations:

$$\begin{aligned} p^{0}:y_0(x)= & {} \frac{B}{\mu },\nonumber \\ p^{1}:y_1(x)= & {} -\frac{\sigma }{\mu }\int _0^1 t^{\alpha }H_0(t,y)\,\mathrm {d}t -\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_0(t,y)dt\nonumber \\&-\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_0(t,y)dt,\nonumber \\ p^{2}:y_2(x)= & {} -\frac{\sigma }{\mu }\int _0^1 t^{\alpha }H_1(t,y)\,\mathrm {d}t -\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_1(t,y)dt\nonumber \\&-\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_1(t,y)dt,\nonumber \\ p^{3}:y_3(x)= & {} -\frac{\sigma }{\mu }\int _0^1 t^{\alpha }H_2(t,y)\,\mathrm {d}t -\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_2(t,y)dt\nonumber \\&-\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_2(t,y)dt,\nonumber \\&\vdots \nonumber \\&\vdots \end{aligned}$$
(25)

Hence the present method can be defined by the recurrence relation

$$\begin{aligned} p^{0}:y_0(x)= & {} \frac{B}{\mu },\nonumber \\ p^{i}:y_i(x)= & {} -\frac{\sigma }{\mu }\int _0^1 t^{\alpha }H_{i-1}(t,y)\,\mathrm {d}t -\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_{i-1}(t,y)dt\nonumber \\&-\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }H_{i-1}(t,y)dt, \quad i\ge 1. \end{aligned}$$
(26)

Hence, the n-term truncated approximate series solution of the SBVP (1) with boundary condition (2) can be obtained as

$$\begin{aligned} Y_{n}=y_0+y_1+y_2+\cdots +y_n. \end{aligned}$$
(27)

3.2 Method with Dirichlet and Robin boundary conditions

In this subsection, we derive a recursive scheme based on the HPM for singular boundary value problem (1) with boundary condition (3). To derive the method, we set \(z(x)=x^{\alpha }y^{\prime }\) in Eq. (1), then integrating Eq. (1) over the interval [x, 1], we get

$$\begin{aligned} z(x)=z(1)-\int _x^1 t^{\alpha }f(t,y)\,\mathrm {d}t. \end{aligned}$$
(28)

or

$$\begin{aligned} y^{\prime }(x)=\frac{y^{\prime }(1)}{x^{\alpha }}-\frac{1}{x^{\alpha }}\int _x^1 t^{\alpha }f(t,y)\,\mathrm {d}t. \end{aligned}$$
(29)

Integrating Eq. (29) from 0 to x, and applying the boundary condition at \(x=0\), we obtain

$$\begin{aligned} y(x)=A+A^{*}\int _0^x \frac{dt}{t^{\alpha }}-\int _0^x \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta . \end{aligned}$$
(30)

We set \(y^{\prime }(1)=A^{*}\), where \(A^{*}\) is unknown. To determine the value of \(A^{*}\) in Eq. (30), we impose the boundary condition at \(x=1\), namely \(\mu y(1)+\sigma y^{\prime }(1)=B\). With the help of the boundary condition, we obtain

$$\begin{aligned} A^{*}=\frac{1}{\left[ \sigma +\mu \int _0^1 \frac{d \eta }{\eta ^{\alpha }}\right] }\left[ B-\mu A+\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta \right] . \end{aligned}$$
(31)

Inserting the value of \(A^{*}\) into Eq. (30), we get

$$\begin{aligned} y(x)= & {} A+\frac{1}{\bigg [\sigma +\mu \int _0^1 \frac{d\eta }{\eta ^{\alpha }}\bigg ]}\int _0^x \frac{dt}{t^{\alpha }}\bigg [B-\mu A\nonumber \\&+\,\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta \bigg ] -\int _0^x \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta .\nonumber \\ \end{aligned}$$
(32)

The HPM is extended to solving integral Eq. (32) derived from original Eq. (1) with boundary condition (3).

Now we consider Eq. (32) as

$$\begin{aligned} T(y)= & {} y(x)-A-\frac{1}{\bigg [\sigma +\mu \int _0^1 \frac{d \eta }{\eta ^{\alpha }}\bigg ]}\int _0^x \frac{dt}{t^{\alpha }}\bigg [B-\mu A\nonumber \\&+\,\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta \bigg ] +\int _0^x \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta =0.\nonumber \\ \end{aligned}$$
(33)

Following the homotopy perturbation method, we construct the homotopy H(yp) for Eq. (32) by

$$\begin{aligned} H(y,p)=(1-p)F(y)+pT(y)=0, \end{aligned}$$
(34)

where \(F(y)=y(x)-A\)

If \(p=0\), then Eq. (34) becomes

$$\begin{aligned} H(y,0)=F(y)=0, \end{aligned}$$
(35)

and when \(p=1\), Eq. (34) turns out to be the original equation, i.e.

$$\begin{aligned} H(y,1)= & {} y(x)-A-\frac{1}{\bigg [\sigma +\mu \int _0^1 \frac{d \eta }{\eta ^{\alpha }}\bigg ]}\int _0^x \frac{dt}{t^{\alpha }}\bigg [B-\mu A\nonumber \\&+\,\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta \bigg ] +\int _0^x \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta =0.\nonumber \\ \end{aligned}$$
(36)

The nonlinear function f(xy) is decomposed in terms of the He’s polynomial \(H_n(x)\), as

$$\begin{aligned} f(x,y)=\sum \limits _{n=0}^\infty H_n(y_0,y_1, \ldots , y_n)P^{n}. \end{aligned}$$
(37)

where

$$\begin{aligned} H_n(y_0,y_1, \ldots , y_n)=\frac{1}{n !}\left( \frac{d^{n}f(x,y)}{dp^{n}}\right) _{p=0}. \end{aligned}$$
(38)

Inserting Eq. (11) into Eq. (36) and then equating the identical powers p, we obtain the following set of integral equation \(p^{0}:y_0(x)=A,\)

$$\begin{aligned} p^{1}:y_1(x)= & {} \frac{1}{\bigg [\sigma +\mu \int _0^1 \frac{d \eta }{\eta ^{\alpha }}\bigg ]}\int _0^x \frac{dt}{t^{\alpha }}\bigg [B-\mu A+\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }H_0(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta \bigg ]\nonumber \\&-\,\int _0^x \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }H_0(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta ,\nonumber \\ p^{2}:y_2(x)= & {} \frac{1}{\left[ \sigma +\mu \int _0^1 \frac{d \eta }{\eta ^{\alpha }}\right] }\int _0^x \frac{dt}{t^{\alpha }}\left[ \mu \int _0^1 \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }H_1(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta \right] \nonumber \\&-\,\int _0^x \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }H_1(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta ,\nonumber \\ p^{3}:y_3(x)= & {} \frac{1}{\left[ \sigma +\mu \int _0^1 \frac{d \eta }{\eta ^{\alpha }}\right] }\int _0^x \frac{dt}{t^{\alpha }}\left[ \mu \int _0^1 \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }H_2(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta \right] \nonumber \\&-\,\int _0^x \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }H_2(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta ,\nonumber \\&\vdots \nonumber \\&\vdots \nonumber \\&\vdots \end{aligned}$$
(39)

Hence the present method can be defined by the recurrence relation

$$\begin{aligned} y_0(x)= & {} A\nonumber \\ y_1(x)= & {} \frac{1}{\bigg [\sigma +\mu \int _0^1 \frac{d\eta }{\eta ^{\alpha }}\bigg ]}\int _0^x \frac{dt}{t^{\alpha }}\bigg [B-\mu A+\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }H_0(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta \bigg ]\nonumber \\&-\,\int _0^x \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }H_0(t,y)\,\mathrm {d}t\bigg )\,\mathrm {d}\eta ,\nonumber \\ y_i(x)= & {} \frac{1}{\left[ \sigma +\mu \int _0^1 \frac{d\eta }{\eta ^{\alpha }}\right] }\int _0^x \frac{dt}{t^{\alpha }}\left[ \mu \int _0^1 \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }H_{i-1}(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta \right] \nonumber \\&-\,\int _0^x \frac{1}{\eta ^{\alpha }}\left( \int _\eta ^1 t^{\alpha }H_{i-1}(t,y)\,\mathrm {d}t\right) \,\mathrm {d}\eta , \quad i\ge 2. \end{aligned}$$
(40)

Hence, the n-term truncated approximate series solution of the SBVP (1) with boundary condition (3) can be obtained as

$$\begin{aligned} Y_n=y_0+y_1+y_2+\cdots +y_n. \end{aligned}$$
(41)

4 Convergence of the method

In this section, we discuss the convergence of the proposed method for singular boundary value problem (1) with Neumann and Robin boundary conditions (2) and with Dirichlet and Robin boundary conditions (3).

4.1 Convergence of the method with Neumann and Robin boundary condition

In this subsection, we prove the convergence of the method for solving the problem (1) with boundary conditions (2) for \(\alpha \ge 0\). For this, we write Eq. (22) in operator form as

$$\begin{aligned} y=C+N(y) \end{aligned}$$
(42)

where \(C=\frac{B}{\mu }\) and

$$\begin{aligned} N(y)= & {} -\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,y)\,\mathrm {d}t-\int _0^x\bigg (\int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha }f(t,y)dt\nonumber \\&-\,\int _x^1\bigg (\int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha }f(t,y)dt. \end{aligned}$$
(43)

Now we establish the existence of the unique solution of the singular boundary value problem (1) with boundary conditions (2) in the following theorem.

Theorem 1

Let X be the Banach space with the norm \(\parallel z \parallel =\max \limits _{x\epsilon [0,1]} \mid z(x)\mid \), and f(xy) is a known function of x and y which satisfies the Lipschitz condition i.e.

$$\begin{aligned} \mid f(x,y_1)-f(x,y_2)\mid \le k \mid y_1-y_2\mid \quad \quad \forall y_1, y_2 \in X. \end{aligned}$$

Further, let \(\delta \) be a constant defined as

$$\begin{aligned} \delta = k \left| -\frac{1}{2+2\alpha }-\frac{\sigma }{(1+\alpha )\mu }+\frac{\alpha -1}{2(-1+\alpha ^{2})}\right| \end{aligned}$$

if \(\delta <1\), then the Eq. (18) has unique solution in X.

Proof

For any \(y_1, y_2 \in X\), we have

$$\begin{aligned}&\parallel N(y_1)-N(y_2)\parallel =\max \limits _{0< x\le 1}\bigg |-\frac{\sigma }{\mu }\int _0^1 t^{\alpha } \mid f(x,y_1)-f(x,y_2)\mid \mathrm {d}t\\&\quad -\,\int _0^x\bigg (\int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha } \mid f(x,y_1)-f(x,y_2)\mid dt\\&\quad -\,\int _x^1\bigg (\int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha } \mid f(x,y_1)-f(x,y_2)\mid dt\bigg |.\\&\parallel N(y_1)-N(y_2)\parallel \le \max \limits _{0< x\le 1}\mid f(x,y_1)-f(x,y_2)\mid \max \limits _{0< x\le 1}\bigg |-\frac{\sigma }{\mu }\int _0^1 t^{\alpha } \mathrm {d}t\\&\quad -\,\int _0^x\bigg (\int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha } dt-\int _x^1\bigg (\int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \bigg )t^{\alpha } dt\bigg |. \end{aligned}$$

Using the Lipschitz condition of f, we get

$$\begin{aligned} \parallel N(y_1)-N(y_2)\parallel \le k \bigg |-\frac{1}{2+2\alpha }-\frac{\sigma }{(1+\alpha )\mu }+\frac{\alpha -1}{2(-1+\alpha ^{2})}\bigg |\max \limits _{0< x\le 1}\mid y_1-y_2\mid , \end{aligned}$$

hence we have

$$\begin{aligned} \parallel N(y_1)-N(y_2)\parallel \le \delta \parallel y_1-y_2\parallel . \end{aligned}$$
(44)

If \(\delta <1\), then \(N:X\rightarrow X\) is the contraction mapping and hence by the Banach contraction mapping theorem Eq. (18) has unique solution in X. \(\square \)

Lemma 1

Let \(\left\{ S_n\right\} \) be a sequence of partial sum of the series solution \(\sum \limits _{i=0}^\infty y_i\) obtained by HPM with given boundary condition. Then the \(\left\{ S_n\right\} \) can be written in operator form as \(S_n=C+N(S_{n-1})\), \(n\ge 1\), with \(C=\frac{B}{\mu }\) and N is a nonlinear operator defined in (43).

Proof

Let \(S_n=\sum \limits _{i=0}^n y_i\) be the nth partial sum of the series solution \(\sum \limits _{i=0}^\infty y_i\).

With the help of solution components defined in (26), we get

$$\begin{aligned} S_n= & {} \sum \limits _{i=0}^n y_i,\nonumber \\= & {} \frac{B}{\mu }-\frac{\sigma }{\mu }\int _0^1 t^{\alpha }\sum \limits _{i=0}^n H_{i-1}p^{i-1}\,\mathrm {d}t-\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }\sum \limits _{i=0}^n H_{i-1}p^{i-1}dt\nonumber \\&-\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }\sum \limits _{i=0}^n H_{i-1}p^{i-1}dt, \end{aligned}$$
(45)

By using He’s polynomial decomposition we get

$$\begin{aligned} S_n= & {} \frac{B}{\mu }-\frac{\sigma }{\mu }\int _0^1 t^{\alpha }f(t,S_{n-1})\,\mathrm {d}t-\int _0^x\left( \int _x^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }f(t,S_{n-1})dt\nonumber \\&-\,\int _x^1\left( \int _t^1 \frac{1}{\eta ^{\alpha }}d\eta \right) t^{\alpha }f(t,S_{n-1})dt. \end{aligned}$$
(46)

Hence the sequence generated by the method can be written as \(S_n=C+N(S_{n-1})\), \(n\ge 1\), with \(C=\frac{B}{\mu }=y_0\).

This completes the proof of Lemma 1. \(\square \)

Theorem 2

Suppose that \(X=C[0,1]\) and Y be Banach spaces with the norm \(\parallel z \parallel =\max \limits _{x\epsilon [0,1]} \mid z(x)\mid \), \(x\epsilon X\). Let \(N:X\rightarrow Y\) be the nonlinear mapping defined by (43) which satisfies the Lipschitz condition \(\parallel N(x_1)-N(x_2)\parallel \le \beta \parallel x_1-x_2\parallel \) , \(\forall x_1, x_2 \epsilon X\), with \(0\le \beta <1\). If we assume that \(\parallel y_0\parallel < \infty \), then the sequence \(S_n=C+N(S_{n-1})\), converges to the exact solution y. \(\square \)

Proof

If \(S_n\) denotes the sequence of partial sum of the series \(\sum \limits _{i=0}^\infty y_i\), as defined by \(S_n=C+N(S_{n-1})\), we need to prove that

$$\begin{aligned} \parallel S_{n+1}-S_n\parallel \le \beta ^{n}\parallel y_0\parallel . \end{aligned}$$
(47)

We consider the proof by induction. With the help of the hypothesis, for \(n=1\) we have

$$\begin{aligned} \parallel S_2-S_1\parallel =\parallel N(S_1)-N(S_0)\parallel \le \beta \parallel S_1-S_0\parallel =\beta \parallel y_0\parallel . \end{aligned}$$

So the result is true for \(n=1\)

Now let us assume that the result is true for \(n=k\), i.e.

$$\begin{aligned} \parallel S_{k+1}-S_k\parallel =\parallel N(S_k)-N(S_{k-1})\parallel \le \beta \parallel S_k-S_{k-1}\parallel =\beta ^{k}\parallel y_0\parallel . \end{aligned}$$

Now we have to prove that the result is true for \(n=k+1\).

$$\begin{aligned} \parallel S_{k+2}-S_{k+1}\parallel =\parallel N(S_{k+1})-N(S_k)\parallel \le \beta \parallel S_{k+1}-S_k\parallel =\beta ^{k+1}\parallel y_0\parallel . \end{aligned}$$

Hence the result is true for all values of n. We complete the proof by showing that \(S_n\) is a Cauchy Sequence on the Banach space X.

For every \(m,n\epsilon N\), \(m\le n\), using (47), we have

$$\begin{aligned} \parallel S_{n}-S_{m}\parallel= & {} \parallel (S_{n}-S_{n-1})+(S_{n-1}-S_{n-2})+\cdots +(S_{m+1}-S_{m})\parallel \nonumber \\\le & {} \parallel S_{n}-S_{n-1}\parallel +\parallel S_{n-1}-S_{n-2}\parallel +\cdots +\parallel S_{m+1}-S_{m}\parallel ,\nonumber \\\le & {} \beta ^{n-1} \parallel y_0\parallel +\beta ^{n-2} \parallel y_0\parallel +\cdots +\beta ^{m+1} \parallel y_0\parallel +\beta ^{m} \parallel y_0\parallel ,\nonumber \\\le & {} \parallel y_0\parallel \beta ^{m}(1+\beta +\beta ^{2}+\cdots +\beta ^{n-1-m}),\nonumber \\\le & {} \parallel y_0\parallel \beta ^{m}\left( \frac{1-\beta ^{n-m}}{1-\beta }\right) . \end{aligned}$$
(48)

Since \(0<\beta <1\), \(1-\beta ^{n-m}<1\) and \(\parallel y_0\parallel <\infty \), we get from (48)

$$\begin{aligned} \parallel S_{n}-S_{m}\parallel \le \parallel y_0\parallel \frac{\beta ^{m}}{1-\beta }. \end{aligned}$$

Taking limit as \(n,m\rightarrow \infty \), we obtain

$$\begin{aligned} \lim _{n,m \rightarrow \infty } \parallel S_{n}-S_{m}\parallel = 0. \end{aligned}$$

Therefore,\(S_n\) is a Cauchy sequence in the Banach space X. This implies that the series solution \(\sum \limits _{i=0}^\infty y_i\) by the present method is convergent to the exact solution y. \(\square \)

This completes the proof of the theorem.

4.2 Convergence of the method with Dirichlet and Robin boundary condition

In this subsection, we prove the convergence of the method for solving the problem (1) with boundary conditions (3) for \(\alpha \epsilon [0,1)\). For this, we write Eq. (36) in operator form as

$$\begin{aligned} y=C+N(y) \end{aligned}$$
(49)

where \(C=A\) and

$$\begin{aligned} N(y)= & {} \frac{1}{\bigg [\sigma +\mu \int _0^1\frac{d\eta }{\eta ^{\alpha }} \bigg ]}\int _0^x\frac{dt}{t^{\alpha }}\bigg [B-\mu A+\mu \int _0^1\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } f(t,y)dt\bigg )d\eta \bigg ]\nonumber \\&-\,\int _0^x\frac{1}{{\eta }^{\alpha }}\bigg (\int _{\eta }^1t^{\alpha } f(t,y)dt\bigg )d\eta . \end{aligned}$$
(50)

Now we establish the existence of the unique solution of the singular boundary value problem (1) with boundary conditions (3) in the following theorem.

Theorem 3

Let X be the Banach space with the norm \(\parallel z \parallel =\max \limits _{x\epsilon [0,1]} \mid z(x)\mid \), and f(xy) is a known function of x and y which satisfies the Lipschitz condition i.e.

$$\begin{aligned} \mid f(x,y_1)-f(x,y_2)\mid \le k \mid y_1-y_2\mid \quad \quad \forall y_1, y_2 \in X \end{aligned}$$

Further, let \(\delta \) be a constant defined as

$$\begin{aligned} \delta = k \left| \frac{\left( B-\mu A+\frac{\mu }{2-2\alpha }\right) }{(1-\alpha )\sigma +\mu }+\frac{1+\alpha }{2(-1+\alpha ^{2})} \right| \end{aligned}$$

if \(\delta <1\), then the Eq. (32) has unique solution in X.

Proof

For any \(y_1, y_2 \in X\), we have

$$\begin{aligned} \parallel N(y_1)-N(y_2)\parallel= & {} \max \limits _{0< x\le 1}\bigg |\frac{1}{\bigg [\sigma +\mu \int _0^1\frac{d \eta }{\eta ^{\alpha }} \bigg ]}\int _0^x\frac{dt}{t^{\alpha }}\bigg [B-\mu A\\&+\,\mu \int _0^1\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } \mid f(x,y_1)-f(x,y_2)\mid dt\bigg )d\eta \bigg ]\\&-\,\int _0^x\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } \mid f(x,y_1)-f(x,y_2)\mid dt\bigg )d\eta \bigg |,\\\le & {} \max \limits _{0< x\le 1}\mid f(x,y_1)-f(x,y_2)\mid \max \limits _{0< x\le 1}\bigg |\frac{1}{\bigg [\sigma +\mu \int _0^1\frac{d\eta }{\eta ^{\alpha }} \bigg ]}\int _0^x\frac{dt}{t^{\alpha }}\\&\times \bigg [B-\mu A+\mu \int _0^1\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } dt\bigg )d\eta \bigg ]\\&-\int _0^x\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } dt\bigg )d\eta \bigg |. \end{aligned}$$

Using Lipschitz continuity of f(xy) we get

$$\begin{aligned} \parallel N(y_1)-N(y_2)\parallel \le k \left| \frac{\left( B-\mu A+\frac{\mu }{2-2\alpha }\right) }{(1-\alpha )\sigma +\mu }+\frac{1+\alpha }{2(-1+\alpha ^{2})} \right| \max \limits _{0< x\le 1}\mid y_1-y_2\mid . \end{aligned}$$

Hence we have

$$\begin{aligned} \parallel N(y_1)-N(y_2)\parallel \le \delta \parallel y_1-y_2\parallel . \end{aligned}$$
(51)

If \(\delta <1\), then \(N:X\rightarrow X\) is the contraction mapping and hence by the Banach contraction mapping theorem Eq. (32) has unique solution in X. \(\square \)

Lemma 2

Let \(\left\{ S_n\right\} \) be a sequence of partial sum of the series solution \(\sum \limits _{i=0}^\infty y_i\) obtained by the method defined by (40). Then the sequence \(\left\{ S_n\right\} \) can be written in operator form as \(S_n=C+N(S_{n-1})\), \(n\ge 1\), with \(C=A\) and N is a nonlinear operator defined in (50).

Proof

Let \(S_n=\sum \limits _{i=0}^n y_i\) be the n-th partial sum of the series solution \(\sum \limits _{i=0}^\infty y_i\).

With the help of solution components defined in (40), we get

$$\begin{aligned} S_n= & {} \sum \limits _{i=0}^n y_i,\nonumber \\= & {} A+\frac{1}{\bigg [\sigma +\mu \int _0^1\frac{d\eta }{\eta ^{\alpha }} \bigg ]}\int _0^x\frac{dt}{t^{\alpha }}\bigg [B-\mu A+\mu \int _0^1\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } f(t,y)dt\bigg )d\eta \bigg ]\nonumber \\&-\,\int _0^x\frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1t^{\alpha } f(t,y)dt\bigg )d\eta . \end{aligned}$$
(52)

By using He’s polynomial decomposition we get

$$\begin{aligned} S_n= & {} A+\frac{1}{\bigg [\sigma +\mu \int _0^1\frac{d\eta }{\eta ^{\alpha }} \bigg ]}\int _0^x \frac{dt}{t^{\alpha }}\bigg [B-\mu A+\mu \int _0^1 \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,S_{n-1})\,\mathrm {d}t\bigg )\,\mathrm {d}\eta \bigg ]\nonumber \\&-\,\int _0^x \frac{1}{\eta ^{\alpha }}\bigg (\int _\eta ^1 t^{\alpha }f(t,S_{n-1})\,\mathrm {d}t\bigg )\,\mathrm {d}\eta . \end{aligned}$$
(53)

Hence the sequence generated by the method can be written as

\(S_n=C+N(S_{n-1})\), \(n\ge 1\), with \(C=A=y_0\). This completes the proof of Lemma-3. \(\square \)

Theorem 4

Suppose that \(X=C[0,1]\) and Y be Banach spaces with the norm \(\parallel z \parallel =\max \limits _{x\epsilon [0,1]} \mid z(x)\mid \), \(x\epsilon X\). Let \(N:X\rightarrow Y\) be the nonlinear mapping defined by (50) which satisfies the Lipschitz condition \(\parallel N(x_1)-N(x_2)\parallel \le \beta \parallel x_1-x_2\parallel \) , \(\forall x_1, x_2 \epsilon X\), with \(0\le \beta <1\). If we assume that \(\parallel y_0\parallel < \infty \), then the sequence \(S_n=C+N(S_{n-1})\), converges to the exact solution y.

Proof

If \(S_n\) denotes the sequence of partial sum of the series \(\sum \limits _{i=0}^\infty y_i\), as defined by \(S_n=C+N(S_{n-1})\), we need to prove that

$$\begin{aligned} \parallel S_{n+1}-S_n\parallel \le \beta ^{n}\parallel y_0\parallel . \end{aligned}$$
(54)

We consider the proof by induction. With the help of the hypothesis, for \(n=1\) we have

$$\begin{aligned} \parallel S_2-S_1\parallel =\parallel N(S_1)-N(S_0)\parallel \le \beta \parallel S_1-S_0\parallel =\beta \parallel y_0\parallel . \end{aligned}$$

So the result is true for \(n=1\)

Now let us assume that the result is true for \(n=k\), i.e.

$$\begin{aligned} \parallel S_{k+1}-S_k\parallel =\parallel N(S_k)-N(S_{k-1})\parallel \le \beta \parallel S_k-S_{k-1}\parallel =\beta ^{k}\parallel y_0\parallel . \end{aligned}$$

Now we have to prove that the result is true for \(n=k+1\).

$$\begin{aligned} \parallel S_{k+2}-S_{k+1}\parallel =\parallel N(S_{k+1})-N(S_k)\parallel \le \beta \parallel S_{k+1}-S_k\parallel =\beta ^{k+1}\parallel y_0\parallel . \end{aligned}$$

Hence the result is true for all values of n. We complete the proof by showing that \(S_n\) is a Cauchy Sequence on the Banach space X.

For every \(m,n\epsilon N\), \(m\le n\), using (54), we have

$$\begin{aligned} \parallel S_{n}-S_{m}\parallel= & {} \parallel (S_{n}-S_{n-1})+(S_{n-1}-S_{n-2})+\cdots \cdots +(S_{m+1}-S_{m})\parallel ,\nonumber \\\le & {} \parallel S_{n}-S_{n-1}\parallel +\parallel S_{n-1}-S_{n-2}\parallel +\cdots +\parallel S_{m+1}-S_{m}\parallel ,\nonumber \\\le & {} \beta ^{n-1} \parallel y_0\parallel +\beta ^{n-2} \parallel y_0\parallel +\cdots +\beta ^{m+1} \parallel y_0\parallel +\beta ^{m} \parallel y_0\parallel ,\nonumber \\\le & {} \parallel y_0\parallel \beta ^{m}(1+\beta +\beta ^{2}+\cdots +\beta ^{n-1-m}),\nonumber \\\le & {} \parallel y_0\parallel \beta ^{m}\left( \frac{1-\beta ^{n-m}}{1-\beta }\right) . \end{aligned}$$
(55)

Since \(0<\beta <1\), \(1-\beta ^{n-m}<1\) and \(\parallel y_0\parallel <\infty \), we get from (55)

$$\begin{aligned} \parallel S_{n}-S_{m}\parallel \le \parallel y_0\parallel \frac{\beta ^{m}}{1-\beta }. \end{aligned}$$

Taking limit as \(n,m\rightarrow \infty \), we obtain

$$\begin{aligned} \lim _{n,m \rightarrow \infty } \parallel S_{n}-S_{m}\parallel = 0. \end{aligned}$$

Therefore,\(S_n\) is a Cauchy sequence in the Banach space X. This implies that the series solution \(\sum \limits _{i=0}^\infty y_i\) by the present method is convergent to the exact solution y.

This completes the proof of the theorem. \(\square \)

5 Numerical illustrations

In this section, we illustrate the applicability of proposed recursive schemes for solving singular boundary value problems arising in various physical models. We consider two linear and six nonlinear problems. Numerical results are compared with few existing methods in the literature. All numerical computations were done with MATHEMATICA.

Example 1

Consider the non-linear singular boundary value problem

$$\begin{aligned} (x^{0.5}y^{\prime }(x))^{\prime }=-x^{0.5}e^{y(x)}(0.5+e^{y(x)}), \end{aligned}$$
(56)

\(y(0)=log 2,\) \(y(1)=0\). The exact solution is given by \(y(x)=log\left[ \frac{2}{1+x^2}\right] \).

This problem has a singular point at \(x=0\) and corresponds to (1)–(3) with \(f(x,y)=-e^{y(x)}(0.5+e^{y(x)})\) and \(\alpha =0.5\).

Using the method defined by Eq. (40), we obtain the truncated 5 terms approximate series solution of the problem (56), as given by

$$\begin{aligned}&Y_{4}(x)=0.693147-1.00436 (2 x^{0.5})+2.02644 x^{0.5} - x^2 - 0.0974505 x^{2.5} \\&\quad +\, 0.00155006 x^3 - 0.00445698 x^{3.5} + 0.498335 x^4 + 0.19691 x^{4.5}\\&\quad +\,0.09876 x^5 + 0.0532754 x^{5.5} - 0.333333 x^6 - 0.325569 x^{6.5}\\&\quad -\,0.270904 x^7 + 0.25 x^8 + 0.422075 x^{8.5} - 0.2 x^{10}. \end{aligned}$$

To measure the accuracy of the present method against the exact solution, we determine the maximum absolute error, as defined by

$$\begin{aligned} E_n(x)=\max \limits _{x\epsilon [0,1]}\mid Y_n(x)-E(x)\mid \end{aligned}$$

Here, E(x) is the exact solution of the problem and \(Y_n(x)\) is the truncated \(n-\)terms approximate series solution.

Table 1 Numerical results of maximum absolute error for Example 1

Table 1 shows a comparison between the maximum absolute error obtained by our method and modified Adomian decomposition method given in [21]. Comparison reveals that our method gives more accurate result than that of [21]. We plot exact solution and approximate solution of problem (56) for \(n=3,4,5\) in Fig. 1, which shows that approximate solution converges very rapidly to exact solution. Numerical results of absolute errors for \(n=3,4,5\) are displayed in Fig. 2.

Mathematica code for Example 1

\(Ex1/:Ex1[x\_]:=\)

Module

$$\begin{aligned}&[\left\{ Y,s\right\} ,Clear[Y,s,x,t,p];Y0=Log[2];\\&\quad H[p\_]=Exp(Y0+p Y1 +p^{2} Y2 +p^{3} Y3 )(0.5+Exp(Y0+p Y1 +p^{2} Y2 +p^{3} Y3));\\&Y1=[(1/(Integrate[(x^{-0.5})]),\left\{ x,0,1\right\} ))(Integrate[(x^{-0.5})],\\&\quad \left\{ x,0,x\right\} )(Log[1/5]-5-Log[1/4]\\&\quad +\,[Integrate[(x^{-0.5})Integrate[(x^{0.5}H[0])],\left\{ x,x,1\right\} ],\left\{ x,0,1\right\} ]]\\&\quad -\,[Integrate[(x^{-0.5})Integrate[(x^{0.5}H[0])],\left\{ x,x,1\right\} ],\left\{ x,0,x\right\} ]]\\&Y2=[(1/(Integrate[(x^{-0.5})]),\left\{ x,0,1\right\} ))(Integrate[(x^{-0.5})],\left\{ x,0,x\right\} )\\&\quad ([Integrate[(x^{-0.5})Integrate[(x^{0.5}H^{\prime }[0])],\left\{ x,x,1\right\} ],\left\{ x,0,1\right\} ]]\\&\quad -\,[Integrate[(x^{-0.5})Integrate[(x^{0.5}H^{\prime }[0])],\left\{ x,x,1\right\} ],\left\{ x,0,x\right\} ]]\\&Y3=[(1/(Integrate[(x^{-0.5})]),\left\{ x,0,1\right\} ))(Integrate[(x^{-0.5})],\left\{ x,0,x\right\} )\\&\quad ([Integrate[(x^{-0.5})Integrate[(x^{0.5}H^{\prime \prime }[0])],\left\{ x,x,1\right\} ],\left\{ x,0,1\right\} ]]\\&\quad -\,[Integrate[(x^{-0.5})Integrate[(x^{0.5}H^{\prime \prime }[0])],\left\{ x,x,1\right\} ],\left\{ x,0,x\right\} ]]\\&Y4=[(1/(Integrate[(x^{-0.5})]),\left\{ x,0,1\right\} ))(Integrate[(x^{-0.5})],\left\{ x,0,x\right\} )\\&\quad ([Integrate[(x^{-0.5})Integrate[(x^{0.5}H^{\prime \prime \prime }[0])],\left\{ x,x,1\right\} ],\left\{ x,0,1\right\} ]]\\&\quad -\,[Integrate[(x^{-0.5})Integrate[(x^{0.5}H^{\prime \prime \prime }[0])],\left\{ x,x,1\right\} ],\left\{ x,0,x\right\} ]]\\&\quad s=Y0+Y1+Y2+Y3+Y4] \end{aligned}$$
Fig. 1
figure 1

Comparison of approximate solution and exact solution of Example 1

Fig. 2
figure 2

Numerical result of absolute error of Example 1

Example 2

Consider the boundary value problem

$$\begin{aligned} (x^{2}y^{\prime }(x))^{\prime }=x^{2}(4y(x)-2), \end{aligned}$$
(57)

\(y^{\prime }(0)=0,\) \(y(1)=5.5\).

The exact solution is given by \(y(x)=0.5+\frac{5sinh 2x}{x sinh 2}\).

This problem has a singular point at \(x=0\) and corresponds to (1)–(2) with \(f(x,y)=4y(x)-2\) and \(\alpha =2\).

Table 2 Numerical results of maximum absolute error for Example 2
Fig. 3
figure 3

Comparison of approximate solution and exact solution of Example 2

Using the method defined by Eq. (26), we obtain the truncated 6 terms approximate series solution of the problem (57), as given by

$$\begin{aligned}&Y_5(x)=3.26999 + 1.67147 x^2 + 0.145654 x^3 + 0.52134 x^4 \\&\quad -\, 0.143351 x^5 - 0.0174015 x^6 + 0.0499874 x^7 + 0.0110523 x^8 \\&\quad -\, 0.00877915 x^9 - 0.000812356 x^{10} + 0.000855112 x^{11} \\&\quad +\, 0.0000427556 x^{12} - 0.0000394667 x^{13}-4\left( -1+\frac{1}{x}\right) ( - 0.0364135 x^3 \\&\quad +\, 0.0358377 x^5 - 0.0124969 x^7 + 0.00219479 x^9 - 0.000213778 x^{11} \\&\quad +\, 9.86668\times 10^{-6} x^{13}). \end{aligned}$$

The maximum absolute error for proposed method, together with the results of [20] are given in Table 2. It can be seen from the Table, our method with few solution components provides better result than the method of [20]. We plot exact solution and approximate solution of problem (57) for \(n=12,14,16\) in Fig. 3, which shows that the approximate solution is very good agreement with the exact solution. Numerical results of absolute errors for \(n=12,14,16\) are displayed in Fig. 4.

Fig. 4
figure 4

Numerical result of absolute error of Example 2

Mathematica code for Example 2

\(Ex2/:Ex2[x\_]:=\)

Module

$$\begin{aligned}&[\left\{ Y,s\right\} ,Clear[Y,s,x,t,p];Y0=5.5;\\&\quad H[p\_]=4[Y0+p Y1 +p^{2} Y2 +p^{3} Y3]-2;\\&Y1=-Integrate[[Integrate[(x^{-2})],\left\{ x,x,1\right\} ][(t^{2}H[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H[0])],\left\{ t,x,1\right\} ]\\&Y2=-Integrate[[Integrate[(x^{2})],\left\{ x,x,1\right\} ][(t^{2}H^{\prime }[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H^{\prime }[0])],\left\{ t,x,1\right\} ]\\&Y3=-Integrate[[Integrate[(x^{2})],\left\{ x,x,1\right\} ][(t^{2}H^{\prime \prime }[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H^{\prime \prime }[0])],\left\{ t,x,1\right\} ]\\&Y4=-Integrate[[Integrate[(x^{2})],\left\{ x,x,1\right\} ][(t^{2}H^{\prime \prime \prime }[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H^{\prime \prime \prime }[0])],\left\{ t,x,1\right\} ];\\&s=Y0+Y1+Y2+Y3+Y4] \end{aligned}$$

Example 3

Consider the boundary value problem

$$\begin{aligned}&(x^{2}y^{\prime }(x))^{\prime }=x^{2}((1-x^2)y(x)-x^4+2x^2-7),\nonumber \\&y^{\prime }(0)=0, \quad y(1)=0. \end{aligned}$$
(58)

The exact solution is given by \(y(x)=1-x^2\).

This problem has a singular point at \(x=0\) and corresponds to (1)–(2) with \(f(x,y)=(1-x^2)y(x)-x^4+2x^2-7\) and \(\alpha =2\).

Using the method defined by Eq. (26), we obtain the truncated 3 terms approximate series solution of the problem (58), as given by

$$\begin{aligned}&Y_{3}(x)=\frac{229}{210}-\frac{7 x^2}{6}-\frac{x^4}{10}-\frac{ x^6}{42}+\frac{(-1 + x) x^2 (37785 - 46926 x^2 + 18810 x^4 - 1430 x^6 + 225 x^8)}{103950}\\&\quad +\,\frac{ (-1 + x)^4 (17252543 + 69010172 x + 6179705 x^{2} -48072 x^{3} -992721 x^{4} -590744 x^{5}+ 331735 x^{6}}{2270268000}\\&\quad +\,\frac{ (-1 + x)^4 ( 10216 x^{7} -13638 x^{8}-30180 x^{9}+ 1599 x^{10} + 546 x^{11})}{2270268000}\\&\quad -\,\frac{(-1 + x)^4 (40559 + x (162236 + 5 x (35776 + x (11096 + x (-1669 + 2 x (-68 + 9 x (29 + 10 x)))))))}{415800}. \end{aligned}$$

The maximum absolute error for the present method, together with the results of [20] are given in Table 3. It can be seen from the Table, our method with few solution components provides better result than the method of [20]. We plot exact solution and approximate solution of problem (58) for \(n=7,9,11\) in Fig. 5, which shows that the approximate solution is very good agreement with the exact solution. Numerical results of absolute errors for \(n=9,11\) are displayed in Fig. 6.

Table 3 Numerical results of maximum absolute error for Example 3
Fig. 5
figure 5

Comparison of approximate solution and exact solution of Example 3

Fig. 6
figure 6

Numerical result of absolute error of Example 3

Mathematica code for Example 3

\(Ex3/:Ex3[x\_]:=\)

Module

$$\begin{aligned}&[\left\{ Y,s\right\} ,Clear[Y,s,x,t,p];Y0=0;\\&H[p\_]=(1-x^{2})[Y0+p Y1 +p^{2} Y2 +p^{3} Y3]-x^{4}+2x^{2}-7;\\&Y1=-Integrate[[Integrate[(x^{-2})],\left\{ x,x,1\right\} ][(t^{2}H[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H[0])],\left\{ t,x,1\right\} ]\\&Y2=-Integrate[[Integrate[(x^{2})],\left\{ x,x,1\right\} ][(t^{2}H^{\prime }[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H^{\prime }[0])],\left\{ t,x,1\right\} ]\\&Y3=-Integrate[[Integrate[(x^{2})],\left\{ x,x,1\right\} ][(t^{2}H^{\prime \prime }[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H^{\prime \prime }[0])],\left\{ t,x,1\right\} ]\\&Y4=-Integrate[[Integrate[(x^{2})],\left\{ x,x,1\right\} ][(t^{2}H^{\prime \prime \prime }[0])],\left\{ t,0,x\right\} ]\\&\quad -Integrate[[Integrate[(t^{2})],\left\{ t,t,1\right\} ][(t^{2}H^{\prime \prime \prime }[0])],\left\{ t,x,1\right\} ]\\&s=Y0+Y1+Y2+Y3+Y4] \end{aligned}$$

Example 4

Consider the non-linear singular boundary value problem

$$\begin{aligned}&(x^{\alpha }y^{\prime }(x))^{\prime } =\frac{5x^{\alpha +3}e^{y}-(\alpha +4)}{4+x^5},\nonumber \\&y(0)=ln\left( \frac{1}{4}\right) , \quad y(1)+5y^{\prime }(1)=ln\left( \frac{1}{5}\right) -5. \end{aligned}$$
(59)

The exact solution is given by \(y(x)=ln\left( \frac{1}{4+x^5}\right) \).

This problem has a singular point at \(x=0\) and corresponds to (1)–(3) with \(f(x,y)=\frac{5x^{3}e^{y}-(\alpha +4)}{4+x^5}\).

Using the method defined by Eq. (40), we obtain the truncated 6 terms approximate series solution of the problem (59), as given by

$$\begin{aligned}&Y_{5}(x)=-1.38629-( 2. x^{0.5})+2 x^{0.5} - 0.25 x^5 + 1.80108\times 10^{-7} x^{5.5} \\&\quad +\, 2.92602\times 10^{-7} x^6. - 8.6682\times 10^{-9} x^{6.5} \\&\quad +\, 1.5096\times 10^{-10} x^7 - 1.09122\times 10^{-13} x^{7.5} + 0.03125 x^{10} \\&\quad +\, 3.63437\times 10^{-8} x^{10.5} - 5.68814\times 10^{-7} x^{11} - 1.46604\times 10^{-8} x^{11.5}\\&\quad -\, 1.6555\times 10^{-10} x^{12} + 3.39491\times 10^{-13} x^{12.5} - 0.00520833 x^{15} \\&\quad -\, 3.12723\times 10^{-7} x^{15.5} + 6.25828\times 10^{-7} x^{16} \\&\quad +\, 1.92483\times 10^{-8} x^{16.5} - 9.69024\times 10^{-11} x^{17}\\&\quad +\, 0.000976563 x^{20} +7.15474\times 10^{-7} x^{20.5} - 3.15107\times 10^{-7} x^{21} \\&\quad +\, 3.86178\times 10^{-9} x^{21.5} + 1.12667\times 10^{-11} x^{22} - 0.000195312 x^{25} \\&\quad -\, 1.15047\times 10^{-6} x^{25.5} - 6.73497\times 10^{-8} x^{26} - 1.08065\times 10^{-9} x^{26.5} \\&\quad +\, 0.0000406901 x^{30} + 1.1103\times 10^{-6} x^{30.5} + 2.8367\times 10^{-8} x^{31} \\&\quad +\, 4.3099\times 10^{-11} x^{31.5} - 8.60943\times 10^{-6} x^{35} \\&\quad -\, 3.18671\times 10^{-7} x^{35.5} - 2.23453\times 10^{-9} x^{36} + 1.51611\times 10^{-6} x^{40} \\&\quad +\, 3.35259\times 10^{-8} x^{40.5} + 4.91628\times 10^{-11} x^{41} - 1.6515\times 10^{-7} x^{45} \\&\quad -\, 1.43016\times 10^{-9} x^{45.5} + 9.65087\times 10^{-9} x^{50} + 2.1084\times 10^{-11} x^{50.5} \\&\quad -\, 2.75702\times 10^{-10} x^{55} + 3.0179\times 10^{-12} x^{60}. \end{aligned}$$
Fig. 7
figure 7

Comparison of approximate solution and exact solution of Example 4

Fig. 8
figure 8

Numerical result of absolute error of Example 4

We plot exact solution and approximate solution of problem (59) for \(n=5,6\) in Fig. 7, which shows that the approximate solution is very good agreement with the exact solution. The results of the maximum absolute error \(E_n\) for \(n=5,6\) are depicted in Fig. 8. Table 4 shows a comparison between the maximum absolute error obtained by our method and Adomian decomposition method given in [22] for \(\alpha =0.25\) and \(\alpha =0.75\). Comparison reveals that our method gives more accurate result than the method in [22]. Furthermore we solve the problem (59) for \(\alpha =0.5\). The results of maximum absolute error for the present method, together with the results of [23] and [24] are displayed in Table 5. It can be clearly seen that approximate solution obtained by our method shows its superiority on the method of [23] and [24].

Table 4 Numerical results of maximum absolute error for Example 4 for \(\alpha =0.25\) and \(\alpha =0.75\)
Table 5 Numerical results of maximum absolute error for Example 4 for \(\alpha =0.5\)

Example 5

Consider the nonlinear SBVP arising in the study of steady-state oxygen diffusion in a spherical cell

(60)

where n and k are positive constants involving the reaction rate and the Michaelis constant, we take \(n=0.76129\) and \(k=0.03119\) [26, 34, 35].

This problem has a singular point at \(x=0\) and corresponds to (1)–(2) with \(f(x,y)=\frac{ny(x)}{y(x)+k}\), \(B=5\), \(\mu =5\), \(\sigma =1\) and \(\alpha =2\).

Using the method defined by Eq. (26), we obtain the truncated 6 terms approximate series solution of the problem (60), as given by

$$\begin{aligned}&Y_{5}(x)= 0.828483+0.1222783x^{2}-1.05879118\times 10^{-22}x^{3}+0.0001963x^{4}\\&\quad -\,0.000013x^{6}+8.470329\times 10^{-22}x^{7}+1.013103\times 10^{-6}x^{8}\\&\quad -\,2.11758\times 10^{-22}x^{9}-7.3678328\times 10^{-8}x^{10}-5.293955\times 10^{-23}x^{11}\\&\quad +\,3.366697\times 10^{-9}x^{12}-6.617444\times 10^{-24}x^{13}-1.147943701\times 10^{-41}x^{14}. \end{aligned}$$
Fig. 9
figure 9

The approximate solution of Example 5 for \(\mathrm{n} =6,8\)

Table 6 Approximate solutions of Example 5 for \(\alpha =2\)

The approximate solutions of Eq. (60) obtained using the present method for \(n=4,6\) are depicted in Fig. 9. Comparison of the numerical results obtained by present method and the methods in [26, 34, 35], are presented in Table 6. It is clearly evident that the results obtained by the proposed method with few solution components are in very good agreement with the results of [26, 34, 35].

Example 6

Consider the nonlinear SBVP arising in the study of the distribution of heat sources in the human head

(61)

This problem has a singular point at \(x=0\) and corresponds to (1)–(2) with \(f(x,y)=-e^{-y}\), \(B=0\), and \(\alpha =2\).

Using the method defined by Eq. (26), we obtain the truncated 6 terms approximate series solution of the problem (61), as given by

$$\begin{aligned}&Y_5(x)=\frac{24710088649}{91945854000}-\frac{27964817x^{2}}{256608000}-\frac{6605983x^{3}}{384912000}-\frac{186583x^{4}}{12247200}+\frac{152563x^{5}}{15309000}\\&\quad +\,\frac{1567x^{6}}{680400}-\frac{1927x^{7}}{793800}-\frac{61x^{8}}{201600} +\frac{61x^{9}}{226800}+\frac{629x^{10}}{30618000}-\frac{629x^{11}}{33679800}-\frac{2869x^{12}}{1010394000}+\frac{2869x^{13}}{1094593500}\\&\quad -\,\frac{(-1+x)x^{2}(-22980 + 13419x^{2}-3240x^{4}+305x^{6} )}{1020600}\\&\quad -\,\frac{(-1+x)x^{2}(6193715 - 4123152x^{2}+1297296x^{4}-214720 x^{6} +15096x^{8} )}{538876800}\\&\quad -\,\frac{(-1+x)x^{2}(-188179537 + 136962826x^{2}-50887980x^{4}+11296285 x^{6} -1430975x^{8} +80332x^{10} )}{30648618000}. \end{aligned}$$
Fig. 10
figure 10

The approximate solution of Example 6

The approximate solutions of Eq. (61) obtained using the present method for different set of \(\mu \) and \(\sigma \) are depicted in Fig. 10. Comparison of the numerical results obtained by present method and the finite difference Method of [36], is presented in Table 7. It is clearly evident that the results obtained by the proposed method with few solution components are in very good agreement with that obtained in [36].

Example 7

Consider the boundary value problem

(62)

The exact solution is given by \(y(x)=2ln\left( \frac{A+1}{A x^{2}+1}\right) \), where \(A=3-2\sqrt{2}\).

This problem has a singular point at \(x=0\). The problem (62) is known as the Emden-Fowler equation of the second kind and corresponds to (1)–(2) with \(f(x,y)=-e^{y(x)}\) and \(\alpha =1\).

Table 7 Approximate solutions of Example 6
Table 8 Numerical results of maximum absolute error for Example 7

Using the method defined by Eq. (26), we obtain the truncated 6 terms approximate series solution of the problem (62), as given by

$$\begin{aligned}&Y_{5}(x)=621859/1966080 - (85 x^2)/256 + (3 x^4)/128 - x^6/768 \\&\quad +\, ( x^2 (-56 + 28 x^2 - 8 x^4 + x^6))/8192 \\&\quad +\, ( x^2 (-210 + 120 x^2 - 45 x^4 + 10 x^6 - x^8))/81920 \\&\quad +\, ( x^2 (-792 + 495 x^2 - 220 x^4 + 66 x^6 - 12 x^8 + x^{10}))/786432. \end{aligned}$$

The maximum absolute error for the present method, together with the results of [33] are given in Table 8. It can be seen from the Table, our method with few solution components provides better result than the method of [33]. Numerical results of absolute errors for \(n=6,8,10\) are displayed in Fig. 11.

Fig. 11
figure 11

Numerical result of absolute error of Example 7

Example 8

Consider the nonlinear singular boundary value problem describing the equilibrium of the isothermal gas sphere

(63)

The exact solution is given by \(y(x)=\sqrt{\frac{3}{3+x^{2}}}\).

This problem has a singular point at \(x=0\) and corresponds to (1)–(2) with \(f(x,y)=-y^{5}(x)\) and \(\alpha =2\).

Table 9 Numerical results of maximum absolute error for Example 8

Using the method defined by Eq. (26), we obtain the truncated 6 terms approximate series solution of the problem (63), as given by

$$\begin{aligned}&Y_{5}(x)=(35 \sqrt{3})/64 - (3 \sqrt{3} x^2)/64 + ( 9 \sqrt{3} (-1 + x) x^2 (-5 + 3 x^2))/1024 \\&\quad -\,( 9 \sqrt{3} (-1 + x)^3 (7 + 21 x + 12 x^2))/4096\\&\quad - ( 27 \sqrt{3} (-1 + x) x^2 (55 - 54 x^2 + 15 x^4))/65536 \\&\quad +\,( 27 \sqrt{3} (-1 + x)^3 (-33 - 99 x - 33 x^2 + 55 x^3 + 30 x^4))/131072 \\&\quad +\,( 405 \sqrt{3} (-1 + x) x^2 (-65 + 81 x^2 - 39 x^4 + 7 x^6))/2097152 \\&\quad -\,( 243 \sqrt{3} (-1 + x) x^2 (8075 - 11628 x^2 + 7410 x^4 - 2380 x^6 + 315 x^8))/268435456 \\&\quad +\,( 5103 \sqrt{3} (-1 + x) x^2 (-7429 + 11799 x^2 - 8970 x^4 + 3910 x^6\\&\quad -\,945 x^8 + 99 x^10))/8589934592 - ( 405 \sqrt{3} (-1 + x)^3 (143 + x (429 \\&\quad +\,x (78 + x (-390 + x (-165 + 7 x (15 + 8 x)))))))/16777216 \\&\quad +\,( 243 \sqrt{3} (-1 + x)^3 (-4199 + x (-12597 + x (-969 + x (14535 \\&\quad +\,x (4845 + 7 x (-969 + x (-437 + 9 x (19 + 10 x)))))))))/536870912 \\&\quad -\,( 5103 \sqrt{3} (-1 + x)^3 (7429 + x (22287 + x^2 (-29716 + x (-7866 \\&\quad +\,x (18354 + x (7084 + 3 x (-1932 + x (-897 + 11 x (23 + 12 x))))))))))/34359738368. \end{aligned}$$

The maximum absolute error for the present method, together with the results of [33] are given in Table 9. It can be seen from the Table, our method with few solution components provides better result than the method of [33]. Numerical results of absolute errors for \(n=6,8,10\) are displayed in Fig. 12.

Fig. 12
figure 12

Numerical result of absolute error of Example 8

6 Conclusions

A new recursive scheme based on HPM has been introduced for the numerical solution of singular two-point boundary value problems that arise in various physical models. The removal of singularity was achieved by transforming the original differential equation into an equivalent integral equation. Then, a recursive scheme without unknown constants was established by using HPM to approximate the solution of the singular boundary value problems (1)–(2) or (1)–(3). The convergence analysis of the method was discussed in the paper.

Some numerical examples are considered to demonstrate the efficiency, reliability and accuracy of the methods. Numerical results reveal that our method requires few components in the power series solution to obtain accurate result. The advantage of the present method over the existing recursive schemes using ADM, HAM or VIM is that it does not require the computations of undetermined coefficients. Moreover, the present algorithm does not require linearization, perturbation or discretization of the variables and provides accurate solution without requiring too much computational effort.

Comparison was made with existing methods and shows that that the present method is superior to the methods given in [2024, 28, 33] . It may be concluded that the proposed method is an effective, easy to implement, highly accurate and very powerful method for solving singular boundary value problems.