1 Introduction

Many practical problems arising in numerous branches of science and ocean engineering require solving boundary value problems. Different Lane–Emden type conditions are known to happen in nonlinear beginning quality issues which have a peculiarity at the beginning. The logical arrangements of these sorts of conditions are constantly conceivable in the area of the point x = 0. These conditions moreover portray numerous marvels of material science and astronomy, for example, those including certain parts of an outstanding structure, warm history of an around billow of gas; geothermal gas circles and thermionic flows. HOBW has been used for obtaining numerical spectral solutions for handling some of these kinds of Ocean Engineering problems. The LEE has fundamental importance in the field of radioactive cooling, modeling of clusters of galaxies, Physics, astrophysics, and nonlinear mechanics are used to depict several equations [1,2,3,4,5,6,7]. It has also been proven to be more versatile in the examination of a variety of situations which include the analysis of isothermal cores, convective stellar interiors and fully degenerate stellar configurations and formulated as:

$$y^{{{\prime \prime }}} (x) + \frac{k}{x}y^{{\prime }} (x) + \,f(x,y) = h(x),\quad x,k \ge 1$$
(1)

with initial conditions (IC) as:

$$y(0) = y_{0} ,\,\,\,\,\,\,\,\,\,y^{{\prime }} (0) = y_{1} ,$$

where y0, y1 are constants, h(x), f(xy)are continuous functions.if we take \(f(x,y) = f(y) = y^{n}\) then Eq. (1) is given by:

$$y^{{\prime }} (x) + \frac{k}{x}y^{{\prime }} (x) + \,f(y) = h(x)\,\,\,\,$$
(2)

with Dirichlet, Neumann, and Neumann-Robin boundary conditions

$$\begin{aligned} & y(0) = y_{0} ,\quad y(1) = y_{1} ,\,\, \\ & y^{{\prime }} (0) = c_{0} ,\quad y^{{\prime }} (1) = c_{1} , \\ & y^{{\prime }} (0) = 0,\quad v_{0} \,y(1) + \,v_{2} \,y^{{\prime }} (0) = \,v_{3} ,\,\, \\ \end{aligned}$$
(3)

which models most phenomena in mathematics for the values of f(y).

For y0 = 1, this equation is the LEE.

The name of this equation is due to the two astrophysicists Jonathan Lane and Robert Emden [1]. Equation (1) has a singularity at x = 0. An effective strategy was established in [5] to modify the Lane–Emden to equivalent Volterra integral equations (VIE) off any order. The VIE in [8], combined with (ADM), to address the singularity issue. This strategy was proven to be reliable and efficient as confirmed in [9]. The physical structure introduced in [10] Many researchers focused to give a truncate solution to these equations and many methods were proposed. A general study has been given in [10] to construct both correct and series solutions to Lane–Emden equations through ADM. In [11,12,13,14,15,16,17,18] introduced Bernstein, several methods for numerical solutions of VIDE form the unique Emden–Fowler initial value problems. In [19] approach developed to obtain analytical–numerical solutions to two separate Lane–Emden problems. In [20,21,22,23,24] introduced the exponential transformation to resolve the difficulty of a singular point to solve the LEE.

The paper introduces as. In Sect. 2, we present the properties of the HOBW and the approximation of the function using it. In Sect. 3, We establish that the VIDE is the singular Lane–Emden equation. In Sect. 4, we use HOBW method and its convergence analysis for getting the solution VIDE form of the singular Lane–Emden equation. The efficiency of our method is characterized by solving numerical examples in Sect. 5. Conclusion part is given in Sect. 6.

2 The HOBW method and the operational matrix of the integration

2.1 Wavelets and the HOBW method

Wavelets constitute a group of functions constructed from dilation and translation of a single function ψ(x) called the mother wavelet. In which parameter of dilation a and parameter of a translation b vary continuously.

$$\psi_{a,b} (t) = \left| a \right|^{{\frac{ - 1}{2}}} \psi \left( {\frac{t - b}{a}} \right),\quad a,b\, \in {\text{R,}}\,\,a \ne 0$$
(4)

By letting a and b be discrete values such as a = a - k0 , b = nb0a - k0 a0 > 1, b0 > 0, where n and k are positive integers, we attain the family of discrete wavelets:

$$\psi_{k,n} (t) = \left| {a_{0} } \right|^{{\frac{k}{2}}} \psi (a_{0}^{k} t - nb_{0} ),\quad n,k\, \in Z^{ + }$$
(5)

Then we see that ψk,n(t) forms a wavelet basis for L2(R). In particular, when, a0 = 2, b0 = 1, then \(\psi_{k,n} (t)\) forms a basis. Here, \(HOBW_{i,j} (t) = HOBW(k,i,j,t)\) involves four arguments, i = 1, …, 2k−1,k is to be any positive integer, j is the degree of the Bernstein polynomials, and t is the normalized time. They \(HOBW_{i,j} (t)\) are defined on [0, 1) as [11, 12]:

$$HOBW_{i,j} (t) = \left\{ {\begin{array}{*{20}l} {2^{{\frac{k - 1}{2}}} \left( \begin{aligned} n \hfill \\ j \hfill \\ \end{aligned} \right)(2^{k - 1} \,t - i + 1)^{j} (1 - (2^{k - 1} \,t - i + 1))^{n - j} } \hfill & {\frac{i - 1}{{2^{k - 1} }} \le t < \frac{i}{{2^{k - 1} }}} \hfill \\ 0 \hfill & {\text{otherwise}} \hfill \\ \end{array} } \right.$$
(6)

where i = 1, 2, …., 2k−1,j = 0, 1, …, M − 1 and k is a positive integer. Thus, we attain our new basis as \(\{ {\text{HOBW}}_{1,0} ,{\text{HOBW}}_{1,1} , \ldots ,{\text{HOBW}}_{{2^{k - 1} ,M - 1}} \}\) and any function is truncated with them.

The HOBW detect orthonormal basis is:

$$(HOBW_{i\,j} (t),HOBW_{{i^{\prime} j^{\prime} }} (t)) = \left\{ \begin{aligned} 1\,\,\,\,\,\,\,\,\,\,\,\,(i,j) = (i^{\prime} ,j^{\prime} ) \hfill \\ 0\,\,\,\,\,\,\,\,\,\,\,(i,j) \ne (i^{\prime} ,j^{\prime} ) \hfill \\ \end{aligned} \right.$$
(7)

where \((.\,,\,.)\) called the inner product in \(L^{2} [0,1)\). The HOBW has compact support \([\frac{i - 1}{{2^{k - 1} }},\frac{i}{{2^{k - 1} }}],\,\) i = 1, …., 2k−1.

2.2 Function approximation by the HOBW functions

Any function y(t) [10,11,12], which is integrable in [0, 1), is truncated by the HOBW method as follows:

$$y(t) = \sum\limits_{i = 1}^{\infty } {\sum\limits_{j = 0}^{\infty } {c_{ij} } HOBW_{ij} (t),\,\,i = 1,2, \ldots ,\infty ,\,} \,j = 0,1,2, \ldots ,\infty ,\,\,t \in [0,1),$$
(8)

where the HOBW coefficients cij calculated as given below:

$$c_{ij} = \frac{{(y(t),{\text{HOBW}}_{ij} (t))}}{{({\text{HOBW}}_{ij} (t),{\text{HOBW}}_{ij} (t))}}$$

We prune y(t) by a series as follows:

$$y(t) = \sum\limits_{i = 1}^{{2^{k - 1} }} {\sum\limits_{j = 0}^{M - 1} {c_{ij} } HOBW_{ij} (t) = \,C^{T} {\text{HOBW}}(t)\,}$$
(9)

where \({\text{HOBW}}(t)\) and C are \((2^{k - 1} )\,(M - 1) \times 1\) vectors given by

$$\begin{aligned} {\text{HOBW}}(t) & = [{\text{HOBW}}_{1\,0} ,{\text{HOBW}}_{1\,1} , \ldots ,{\text{HOBW}}_{1\,(M - 1)} ,{\text{HOBW}}_{2\,0} ,{\text{HOBW}}_{2\,1} , \ldots ,{\text{HOBW}}_{2\,(M - 1)} , \ldots \ldots , \\ & \quad \quad {\text{HOBW}}_{{2^{k - 1} \,0}} , \ldots ,{\text{HOBW}}_{{2^{k - 1} \,(M - 1)}} ].^{T} \\ \end{aligned}$$

and

$$C = [c_{1\,0} ,c_{1\,1} , \ldots ,c_{1\,(M - 1} ),c_{2\,0} ,c_{2\,1} , \ldots ,c_{2\,(M - 1)} , \ldots ,c_{{2^{k - 1} \,0}} , \ldots ,c_{{2^{k - 1} (M - 1)}} ].^{T}$$
(10)

we have

$$C^{T} < {\text{HOBW}}(t),{\text{HOBW}}(t) > = < y(t),{\text{HOBW}}(t) >$$

so that

$$C = D^{ - 1} < y(t),{\text{HOBW}}(t) > ,$$
(11)

where

$$\begin{aligned} D & = < {\text{HOBW}}(t),{\text{HOBW}}(t) > , \\ & = \int\limits_{0}^{1} {{\text{HOBW}}(t).} {\text{HOBW}}^{T} (t)dt \\ & = \left( \begin{aligned} \begin{array}{*{20}c} {\begin{array}{*{20}c} {D_{1} } & 0 \\ \end{array} } & \cdots & 0 \\ \end{array} \hfill \\ \begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & {D_{2} } \\ \end{array} } & \cdots & 0 \\ \end{array} \hfill \\ \,\begin{array}{*{20}c} {\begin{array}{*{20}c} \vdots & \, \\ \end{array} \,\,\,\,\,} & {\,\, \ddots } & {\,0} \\ \end{array} \hfill \\ \begin{array}{*{20}c} {\begin{array}{*{20}c} 0 & 0 \\ \end{array} } & \cdots & D \\ \end{array}_{M} \hfill \\ \end{aligned} \right) \\ \end{aligned}$$
(12)

Then, \(D_{i} (i = 1,2, \ldots ,2^{k - 1} )\) is defined as follows:

$$\begin{aligned} (D_{n} )_{i + 1,j + 1} & = \int\limits_{{\frac{i - 1}{{2^{k - 1} }}}}^{{\frac{i}{{2^{k - 1} }}}} {{\text{HOBW}}_{i,n} (2^{k - 1} \,t - i + 1)} \,{\text{HOBW}}_{j,n} (2^{k - 1} \,t - i + 1)dt \\ \,(D_{n} )_{i + 1,j + 1} & = \frac{1}{{2^{k - 1} }}\int\limits_{0}^{1} {{\text{HOBW}}_{i,n} (t)} \,{\text{HOBW}}_{j,n} (t)dt \\ (D_{n} )_{i + 1,j + 1} & = \frac{{\left( \begin{aligned} n \hfill \\ i \hfill \\ \end{aligned} \right)\left( \begin{aligned} n \hfill \\ j \hfill \\ \end{aligned} \right)}}{{2^{k - 1} (2n + 1)\left( \begin{aligned} 2n \hfill \\ i + j \hfill \\ \end{aligned} \right)}} \\ \end{aligned}$$
(13)

We can also truncate the function k(xt) ∊ L[0, 1] as follows:

$$k(x,t) \approx {\text{HOBW}}^{T} (x)\, \, K \, \,{\text{HOBW}}(t),$$

where K is a \((2^{k - 1} )\,(M - 1) \times (2^{k - 1} )\,(M - 1)\) matrix that we attain as:

$$K = D^{ - 1} < {\text{HOBW}}(x) < k(x,t),{\text{HOBW}}(t) > > D^{ - 1}$$
(14)

2.3 Multiplication of the hybrid functions

We can evaluate \({\text{HOBW}}_{{((2^{k - 1} )\,(M - 1) \times 1)}} (t)\)\({\text{HOBW}}^{T}_{{((2^{k - 1} )\,(M - 1) \times 1)}} (t)\) for VIE of the second kind via the HOBW functions as detailed below.

Let the product of \({\text{HOBW}}_{{((2^{k - 1} )\,(M - 1) \times 1)}} (t)\) and \({\text{HOBW}}^{T}_{{((2^{k - 1} )\,(M - 1) \times 1)}} (t)\) be given by

$${\text{HOBW}}_{{((2^{k - 1} )\,(M - 1) \times 1)}} (t)\,{\text{HOBW}}^{T}_{{((2^{k - 1} )\,(M - 1) \times 1)}} (t) \cong M_{{((2^{k - 1} )\,(M - 1) \times (2^{k - 1} )\,(M - 1))}} (t)$$
(15)

where

$$M_{{(2^{k - 1} M - 1 \times 2^{k - 1} M - 1)}} (t) = \left[ {\begin{array}{*{20}l} {{\text{HOBW}}_{10} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{10} (t){\text{HOBW}}_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{10} (t)\,{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)} \hfill \\ {{\text{HOBW}}_{20} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{20} (t){\text{HOBW}}_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{20} (t)\,{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)} \hfill \\ {{\text{HOBW}}_{30} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{30} (t){\text{HOBW}}_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{30} (t)\,{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)} \hfill \\ \vdots \hfill & \vdots \hfill & \cdots \hfill & \vdots \hfill \\ {{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)\,{\text{HOBW}}_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)\,{\text{HOBW}}_{{2^{k - 1} ,M - 1}} (t)} \hfill \\ \end{array} } \right]$$

With the recursive formulas, we calculate \(M_{{((2^{k - 1} )\,(M - 1) \times (2^{k - 1} )\,(M - 1))}} (t)\) for any k and M.

The matrix \(M_{{((2^{k - 1} )\,(M - 1) \times (2^{k - 1} )\,(M - 1))}} (t)\) satisfies the relation:

$$M_{{(2^{k - 1} (M - 1) \times 2^{k - 1} (M - 1))}} (t)\,c_{{(2^{k - 1} (M - 1) \times 1)}} = \tilde{C}_{{(2^{k - 1} (M - 1) \times 2^{k - 1} (M - 1))}} \,{\text{HOBW}}_{{(2^{k - 1} (M - 1) \times 1)}} (t)$$

where \(\tilde{C}_{{(2^{k - 1} (M - 1) \times 2^{k - 1} (M - 1))}}\) is the matrix coefficient. We consider the case when k = 3 and M = 4. Thus, we have

$$M_{(16) \times 16)} (t) = M_{(16) \times 16)} (t) = \left[ {\begin{array}{*{20}l} {{\text{HOBW}}_{10} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{10} (t){\text{H}}OBH_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{10} (t)\,{\text{HOBW}}_{43} (t)} \hfill \\ {{\text{HOBW}}_{20} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{20} (t){\text{H}}OBH_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{20} (t)\,{\text{HOBW}}_{43} (t)} \hfill \\ {{\text{HOBW}}_{30} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{30} (t){\text{H}}OBH_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{30} (t)\,{\text{HOBW}}_{43} (t)} \hfill \\ \vdots \hfill & \vdots \hfill & \cdots \hfill & \vdots \hfill \\ {{\text{HOBW}}_{43} (t)\,{\text{HOBW}}_{10} (t)} \hfill & {{\text{HOBW}}_{43} (t)\,OBH_{20} (t)} \hfill & \cdots \hfill & {{\text{HOBW}}_{43} (t)\,{\text{HOBW}}_{43} (t)} \hfill \\ \end{array} } \right]$$
(16)

The coefficient matrix \(\tilde{C}_{{(2^{k - 1} M - 1 \times 2^{k - 1} M - 1)}}\) is determined by

$$\tilde{C}_{{(2^{k - 1} M \times 2^{k - 1} M)}} = \left[ \begin{aligned} \begin{array}{*{20}c} {C_{0} } & 0 & 0 & 0 \\ \end{array} \hfill \\ \begin{array}{*{20}c} 0 & {C_{1} } & 0 & 0 \\ \end{array} \hfill \\ \begin{array}{*{20}c} 0 & 0 & {C_{2} } & 0 \\ \end{array} \hfill \\ \begin{array}{*{20}c} 0 & 0 & 0 & {C_{3} } \\ \end{array} \hfill \\ \end{aligned} \right]$$

where Ci, i = 0, 1, 2, 3 are 4 × 4 matrices.

Several of the integral \(\int\limits_{a(x)}^{b(x)} {F(x,t)} \,dt\) using Leibniz rule as:

$$\frac{d}{dx}\int\limits_{a(x)}^{b(x)} {F(x,t)} \,dt = F(x,b(x))\frac{db}{dx} - F(x,a(x))\frac{da}{dx} + \int\limits_{a(x)}^{b(x)} {\frac{dF}{dx}dt} ,$$
(17)

Where F(xt) and \(\frac{dF}{dx}\) are continuous in the domain D in the xt- plane that contains the region R, α ≤ x ≤ β, t0 ≤ t ≤ tn and a(x),b(x) are defined functions having continuous derivatives for α ≤ x ≤ β. A global Leibniz rule presented modifies VIE to several equations.

3 VIDE form the Lane–Emden type

In this section, we discuss the LEE of the shape factor of the form

$$y^{{{\prime \prime }}} (x) + \frac{k}{x}y^{{\prime }} (x) + f(y) = h(x),\,\,\,y(0) = \alpha , \quad y^{{\prime }} (0) = 0, \quad k > 1$$
(18)

where f(y)can take any linear or nonlinear forms.

First, we set

$$y(x) = \alpha - \frac{1}{k - 1}\int\limits_{0}^{x} {(t\,(1 - \frac{{t^{k - 1} }}{{x^{k - 1} }}} )\,f(y(t)) - h(t))\,dt,$$
(19)

to modify (18) to an integral form then differentiating Eq. (19) twice and using the Leibniz rule, we have

$$y^{{\prime }} (x) = \int\limits_{0}^{x} {\left( {\frac{{t^{k} }}{{x^{k} }}} \right)} \,h(t)\,dt - \int\limits_{0}^{x} {(\frac{{t^{k} }}{{x^{k} }}} )\,f(y(t))\,dt,$$
(20)
$$y^{{{\prime \prime }}} (x) = h(x) - \int\limits_{0}^{x} {k\,(\frac{{t^{k} }}{{x^{k + 1} }}} )\,h((t))\,dt - f(y(x)) \quad+ \int\limits_{0}^{x} {k\,(\frac{{t^{k} }}{{x^{k + 1} }}} )\,f(y(t))\,dt,$$
(21)

If we multiply y(x) in (20) by \(\frac{k}{x}\) and add to y(x) in (21) we get Eq. (18). That is the VIDE is the LEE (18) that given by:

$$y^{\prime} (x) = \int\limits_{0}^{x} \left(\frac{{t^{k} }}{{x^{k} }} \right)\,h(t)\,dt - \int\limits_{0}^{x} \left(\frac{{t^{k} }}{{x^{k} }} \right)\quad f(y(t))\,dt, \quad k > 1,\quad y(0) = \alpha .$$

The VIE (10)–(11) were proved to be equivalent to the homogenous LEE (18).

For k → 1, the integral form of Eq. (19) is

$$y(x) = \alpha + \int\limits_{0}^{x} {t\,(\ln (} \frac{t}{x})\,f(y(t)) - h(t))\,dt.$$
(22)

Based on this, we set t the Lane–Emden equations in Volterra integral forms are as:

$$\left\{ {\begin{array}{*{20}l} {y(x) = \alpha + \int\limits_{0}^{x} {t\,(\ln (} \frac{t}{x})\,f(y(t)) - h(t))\,dt,} \hfill & {for\,\,k = 1,} \hfill \\ {y(x) = \alpha - \frac{1}{k - 1}\int\limits_{0}^{x} {(t\,(1 - \frac{{t^{k - 1} }}{{x^{k - 1} }}} )\,f(y(t)) - h(t))\,dt,} \hfill & {for\,\,k > 1.} \hfill \\ \end{array} } \right.$$

4 Application of HOBW method for Lane–Emden in its integrodifferential form

Consider Eq. (22) acquired from Eq. (18). The unknown function y(x) is approximated by HOBW as

$$y(x) \cong \sum\limits_{i = 1}^{M} {\sum\limits_{j = 0}^{n} {c_{ij} } {\text{HOBW}}_{ij} (x)} \, = \,C^{T} {\text{HOBW}}(x).$$
(23)

First, integrating Eq. (22) and from the condition y(0) = α, one gets

$$y(x) = \alpha + \int\limits_{0}^{x} {\bigg[\int\limits_{0}^{z} {\bigg(\frac{{x^{k} }}{{z^{k} }}} }\bigg)\,h(x)\,dx\bigg]\,dz - \int\limits_{0}^{x} {\bigg[\int\limits_{0}^{z} {\bigg(\frac{{t^{k} }}{{z^{k} }}} }\bigg)\,f(y(t))\,dt\bigg]\,dz,\,\,\,\,\,\,\,k \ge 1.\,$$
(24)

Then from Eqs. (23) and (24), we have

$$\,C^{T} {\text{HOBW}}(x) = \alpha + \int\limits_{0}^{x} \left[\int\limits_{0}^{z} \left(\frac{{x^{k} }}{{z^{k} }} \right)\,h(x)\,dx \right]\,dz - \int\limits_{0}^{x} \left[\int\limits_{0}^{z} \left(\frac{{t^{k} }}{{z^{k} }} \right)\,f(y(t))\,dt \right]\,dz, \quad k \ge 1.$$
(25)
$$\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\, = \alpha + \int\limits_{0}^{x} {H_{1} (z} )\,dz - \int\limits_{0}^{x} {H_{2} (z} )\,dz,\,\,\,\,\,\,$$
(26)

where,

$$H_{1} (z)\,\,\, = \int\limits_{0}^{z} {\left(\frac{{x^{k} }}{{z^{k} }} \right)\,h(x} )\,dx,\,\,\,\,\,\,$$

where D is a \((2^{k - 1} )\,(M - 1) \times (2^{k - 1} )\,(M - 1)\) matrix, and is said the dual matrix of HOBW(x)

$$D = \left\langle {HOBW(x),HOBW(x)} \right\rangle = \int\limits_{0}^{1} {HOBW(x)HOBW^{T} (x)} \,dx$$
(27)
$$\,\,\,H_{2} (z)\,\,\, = z\int\limits_{0}^{z} {\bigg(\frac{{t^{k} }}{{z^{k} }}\bigg)f\big(C^{T} {\text{HOBW}}(t)} \big)\,dt,\,\,\,\,\,\,$$
(28)

Now we collocate the Eq. (26) at the points \(x_{i} = \frac{(2\,i - 1)}{{2((2^{k - 1} )\,(M))}}\) yielding

$$C^{T} {\text{HOBW}}(x_{i} ) = \alpha + \int\limits_{0}^{{x_{i} }} {H_{1} (z} )\,dz - \int\limits_{0}^{{x_{i} }} {H_{2} (z} )\,dz,\,\,\,$$
(29)

To apply the Gaussian integration to Eq. (26), we first use the transformation

$$\tau = \frac{2}{{x_{i} }}z - 1,$$
(30)

to transfer the interval of integration into the interval [− 1, 1]. Now, Eq. (26) given as:

$$C^{T} {\text{HOBW}}(x_{i} ) = \alpha + \frac{{x_{i} }}{2}\int\limits_{ - 1}^{1} {H_{1} (\frac{{x_{i} }}{2}(\tau + 1} )\,d\tau - \frac{{x_{i} }}{2}\int\limits_{ - 1}^{1} {H_{2} (\frac{{x_{i} }}{2}(\tau + 1} )\,d\tau ,\,\,\,$$
(31)

Using the Gaussian integration formula, we get

$$C^{T} {\text{HOBW}}(x_{i} ) \cong \alpha + \frac{{x_{i} }}{2}\sum\limits_{{j_{1} = 1}}^{{s_{1} }} {w_{{j_{1} }} } H_{1} (\frac{{x_{i} }}{2}(\tau_{j1} + 1))\, - \frac{{x_{i} }}{2}\sum\limits_{{j_{2} = 1}}^{{s_{2} }} {w_{{j_{2} }} } H_{2} (\frac{{x_{i} }}{2}(\tau_{j2} + 1))\,.$$
(32)

where τj1 and τj2 are s1 and s2 zeros of Legendre polynomials \(p_{{s_{1} + 1}} (.)\) and \(p_{{s_{2} + 1}} (.)\) and \(w_{{j_{1} }}\) and \(w_{{j_{2} }}\) are weights. The idea for the above approximation is the exactness of the Gaussian integration formula for polynomials of degree at most 2s1 + 1 and 2s2 + 1 Eq. (32) yields \((2^{k - 1} )\,(M - 1)\) nonlinear algebraic equations with the unknowns coefficient matrix C. By using Newton’s method to solve this system, the values of C are obtained and hence we get the solution.

4.1 Convergence analysis

In this section, an analysis of the speed of convergence for our numerical method will be obtained.

Theorem 1

The series solution \(y_{m} (x) = \sum\limits_{i = 1}^{k} {\sum\limits_{j = 0}^{M} {c_{ij} } {\text{HOBW}}_{ij} (x)} \, = \,C^{T} {\text{HOBW}}(x)\), where C and \({\text{HOBB}}(x)\) are defined in (6) converges to y(x) then lim m→∞y(x) − ym(x)‖2 = 0.

Proof

Let \(L^{2} (\Re )\) is the Hilbert space, \(y(x) \in L^{2} [0,1]\) is approximated by HOBW as Eq. (6):

Let \(y(x) \cong \sum\nolimits_{j = 0}^{n} {c_{ij} \,} {\text{HOBW}}_{ij} (x)\) for a fixed i be the solution of the Eq. (2) where \(c_{ij} \, = D^{ - 1} \left\langle {y(x),{\text{HOBW}}_{ij} (x)} \right\rangle\)) in which \(\left\langle {.,.} \right\rangle\) denotes the inner product.□

Assume \(HOBW(x) = HOBW(x_{m} )\) and assume \(\delta_{m} = \left\langle {y(x),{\text{HOBW(x}}_{\text{m}} )} \right\rangle\), the sequence of partial sum is \(\left\{ {\sigma_{i} } \right\}\) of \((\delta_{m} {\text{HOBW}}_{{}} (x_{m} ))\) Let \(\left\{ {\sigma_{i} } \right\}\) and \(\left\{ {\sigma_{j} } \right\}\) be the partial sums with \(i \ge j\).

We show that {σi} is a Cauchy sequence in Hilbert space.

Let, \(\sigma_{i} = \sum\limits_{m = 1}^{i} {\delta_{m} {\text{HOBW}}_{{}} (x_{m} )} .\)

Now,

$$\begin{aligned} \left\langle {y(x),\sigma_{i} } \right\rangle & = \left\langle {y(x),\sum\limits_{m = 1}^{i} {\delta_{m} \,{\text{HOBW}}(x_{m} )} } \right\rangle \\ & = \sum\limits_{m = 1}^{i} {\bar{\delta }_{m} \left\langle {y(x),{\text{HOBW}}(x_{m} )} \right\rangle } , \\ & = \sum\limits_{m = 1}^{i} {\bar{\delta }_{m} } \delta_{m} , \\ & = \sum\limits_{m = 1}^{i} {\left| {\delta_{m} } \right|^{2} } , \\ \end{aligned}$$
(33)

so

$$\begin{aligned} \left\| {\sigma_{i} - \sigma_{j} } \right\|^{2} & = \left\| {\sum\limits_{m = 1}^{i} {\delta_{m} {\text{HOBW}}_{{}} (x_{m} )} } \right\|^{2} \\ & = \left\langle {\sum\limits_{m = j + 1}^{i} {\delta_{m} \,{\text{HOBW}}(x_{m} )} ,\sum\limits_{m = j + 1}^{i} {\delta_{m} {\text{HOBW}}_{{}} (x_{m} )} } \right\rangle \\ & = \sum\limits_{m = j + 1}^{i} {\sum\limits_{\,\,m = j + 1}^{i} {\delta_{m} } \bar{\delta }_{m} } \left\langle {{\text{HOBW}}(x_{m} ),{\text{HOBW}}_{{}} (x_{m} )} \right\rangle \\ & = \sum\limits_{m = j + 1}^{i} {\left| {\delta_{m} } \right|^{2} } \\ \end{aligned}$$
(34)

Hence,

$$\left\| {\sum\limits_{m = j + 1}^{i} {\delta_{m} \,{\text{HOBW}}(x_{m} )} } \right\|^{2} = \sum\limits_{m = j + 1}^{i} {\left| {\delta_{m} } \right|^{2} } ,\quad i > j$$

From Bessel’s inequality as i → 0 we have \(\sum\limits_{m = 1}^{\infty } {\left| {\delta_{m} } \right|^{2} } ,\) convergent and hence

$$\left\| {\sum\limits_{m = j + 1}^{i} {\delta_{m} \,{\text{HOBW}}(x_{m} )} } \right\|^{2} \to 0\quad {\text{as}}\quad i \to 0.$$

Therefore,

$$\left\| {\sum\limits_{m = j + 1}^{i} {\delta_{m} \,{\text{HOBW}}(x_{m} )} } \right\| \to 0,$$
(35)

and {σi} is a Cauchy sequence and it converges to for example w (say). We assert that

$$y(x) = w.$$

Thus,

$$\left\langle {w - y(x),{\text{HOBW}}(x_{m} )} \right\rangle = \left\langle {w,{\text{HOBW}}(x_{m} )} \right\rangle - \left\langle {y(x),{\text{HOBW}}(x_{m} )} \right\rangle .$$

Hence,

$$\begin{aligned} & = \left\langle {\mathop {\lim }\limits_{i \to \infty } \sigma_{i} ,{\text{HOBW}}(x_{m} )} \right\rangle - \delta_{m} \\ & = \mathop {\lim }\limits_{i \to \infty } \left\langle {\sigma_{i} ,{\text{HOBW}}(x_{m} )} \right\rangle - \delta_{m} \\ & = \mathop {\lim }\limits_{i \to \infty } \left\langle {\delta_{m} \,{\text{HOBW}}_{{}} (x_{m} ),{\text{HOBW}}(x_{m} )} \right\rangle - \delta_{m} \\ & = \delta_{m} - \delta_{m} = 0. \\ \end{aligned}$$
(36)

The above relation possible only if y(x) = σ. so that y(x) and σi converges to the same value. It provides the convergence guarantee of the HOBW method.

5 Illustrative numerical examples

In this section, we will study the Lane–Emden with the initial value having a singularity at x = 0, the high exactness of the solution acquired by HOBW method are demonstrated and then we compare all results with the required solution.

Example 1

Consider the singular differential equation of LEE [13].

$$\left\{ \begin{aligned} & y^{\prime\prime} (x) + \frac{2}{x}y^{\prime} (x) + y(x) = 6 + 12x + x^{2} + x^{3} ,\,\,\,\,\,\,\,0 \le \,x \le 1\, \hfill \\ & y(0) = y^{\prime} (0) = 0,\,\,\,\,\, \hfill \\ \end{aligned} \right.\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,\,$$
(37)

with the correct solution y(x) = x2 + x3.

Using the HOBW, the truncate solution y(x) of (37) at \(2^{k - 1} = 4\) and M = 3 method, we get 16 number algebraic equations with the same number of unknowns and these equations are numerically solved by Newton’s method with help of maple program, with the initial guess zero, we get the HOBW coefficients as:

$$\begin{aligned} C = \, [0,0, \, 0.02083333333, \, 0.07812500000, \, 0.07812500000, \, 0.1354166667, \, 0.2291666667, \, 0.3750000000, \hfill \\ 0.3750000000, \, 0.5208333333, \, 0.7187500000, \, 0.9843750000, \, 0.9843750000, \, 1.250000000, \, 1.583333333, \, 2] \hfill \\ \end{aligned}$$

So, the truncate of y(x) is \(y(x) = \,C^{T} {\text{HOBW}}(x)\) the acquired results have been compared with that of my seven order (ADM) [13] along with the required solutions and introduced in Table 1. The outcomes reveal that the results by HOBW, with using only a small number of bases, are very promising and superior to ADM and evaluated absolute errors (AE) by HOBW for y(x) will be decreased rapidly in comparison with ADM.

Table 1 Comparison of truncate solutions acquired by HOBW at \(2^{k - 1} = 4\) and M = 3 ADM for Example 1

Example 2

Consider the non-homogenous LEE [13].

$$\left\{ {\begin{array}{*{20}l} {y^{{{\prime \prime }}} (x) + \frac{8}{x}y^{{\prime }} (x) + xy(x) = x^{5} - x^{4} + 44x^{2} - 30x,} \hfill & {0 \le \,x \le 1} \hfill \\ {y(0) = y^{{\prime }} (0) = 0,} \hfill & {} \hfill \\ \end{array} } \right.$$
(38)

with the correct solution y(x)=x4 − x3.

Table 2 compares the maximum AE of HOBW at several values of \(2^{k - 1}\) and M. These results have been included to demonstrate the validity and capability of HOBW (Fig. 1).

Table 2 Maximum AE at several values of 2k−1 and M for Example 2 via HOBW
Fig. 1
figure 1

Plot of the absolute error (e(x)) at M = 7, 11, 15 and 19 for Example 2

From Table 2, it is observed that our numerical method is more accurate. In order to show the accuracy of the proposed method, we have calculated the absolute error and the root means square error (RMS). These errors are given by

$$Absolute\,(y(x_{i} )) = \left| {y_{exact} (x_{i} ) - y_{approximation} (x_{i} )} \right|,$$

Example 3

Consider the homogeneous form of the LEE [14].

$$\left\{ {\begin{array}{*{20}l} {y^{{{\prime \prime }}} (x) + \frac{g}{x}y^{{\prime }} (x) + x^{r} y^{m} (x) = 0,\,\,\,\,\,\,0 \le x \le 1,\,\,} \hfill & {g \ge 1} \hfill \\ {y(0) = 1,} \hfill & {y^{{\prime }} (0) = 0} \hfill \\ \end{array} } \right.$$
(39)

This equation transformed into VIDE form as follow

$$y^{\prime} (x) = - \int\limits_{0}^{x} {(\frac{{t^{g} }}{{x^{g} }}} )\,t^{r} y^{m} (t)\,dt,\quad y(0) = 1,\quad g \ge 1$$
(40)

We selected our example from [14], in which they solved the homogeneous form of LEE by ADM. Tables 3 and 4, exhibit the Numerical solutions of y(t) by HOBW at r = m = 0 g = 2,  and r = 0, m = 1, g = 2.

Table 3 Numerical solutions for Example 3 when g = 2, m = 0
Table 4 A truncate solutions for Example 3 when g = 2, m = 1

a. For r = m = 0,  and g = 2,  the above equation has a correct solution

$$y(x) = 1 - \frac{{x^{2} }}{6},$$
(41)

Table 3 shows that, for g = 2, m = 0, the acquired results coincides with the required solution and efficiency of the method described through the AE.

By applying HOBW method, and taking 2k = 4, M = 3, HOBW coefficients C is:

$$\begin{aligned} & [1,1,0.9965277797,0.9795833334,0.9895833334,0.9826388889,0.97228222222, \\ & \quad 0.9583333334,0.9587333373,0.9444475445,0.9270874333,0.92625,0.90625, \\ & \quad 0.8854166688,0.8617111111,0.8333333333]. \\ \end{aligned}$$

b. For r = 0, m = 1,  and k = 2,  Eq. (39) is:

$$y^{\prime} (x) = - \int\limits_{0}^{x} {\left( {\frac{{t^{2} }}{{x^{2} }}} \right)} \,y(t)\,dt,\quad y(0) = 1$$
(42)

The correct solutions for this problem are given by \(y(x) = \frac{\sin (x)}{x}\) applying HOBW method, and taking 2k = 4, M = 3, we note that HOBW coefficients C as

$$\begin{aligned} & [0.9999991692, \, 1.000102884, \, 0.9961198453, \, 0.9896150092, \, 0.9896150391, \, 0.9827174717, \\ & 0.9723985577, \, 0.9588502916, \, 0.9518504492, \, 0.9453088641, \, 0.928552389035, \\ & 0.9088509723, \, 0.9085510555, \, 0.8891691113, \, 0.8165704733, \, 0.8414703828] \\ \end{aligned}$$

applying this method and taking 2k = 8, M = 7, if 2k, M increases, the truncate solution gets the required solution. The truncate solutions acquired by HOBW for shape factor g = 2 and 2k = 4, M = 3, at 2k = 8, M = 7 with require solutions and AE demonstrated in Table 2. By increasing, 2kM the computed results have appropriated the exactness was increased as well. and the truncate solution gets an approximate to the correct solution as demonstrated in Table 4. The CPU time for running a case may depend on the choice of 2kMfor solving the system of linear algebraic equations resulting from the discretized equations. If a different value 2kM would have been used, the CPU time would be different.

Example 4

Consider the LEE type which is of second order homogeneous singular several equations given in [14].

$$\left\{ {\begin{array}{*{20}l} {y^{{{\prime \prime }}} (x) + \frac{2}{x}y^{{\prime }} (x) - 2(2x^{2} + 3)\,y(x) = 0,} \hfill & {0 \le \,x \le 1} \hfill \\ {(0) = 1,\,\,\,y^{{\prime }} (0) = 0,} \hfill & {} \hfill \\ \end{array} } \right.$$
(43)

with the correct solution \(y(x) = e^{{x^{2} }} .\)

In Table 5 a comparison between these results with the second derivative multistep method (SDMM) in [14] is also given. The results acquired by HOBW, by using 2k = 16, M = 15 are very promising and superior to those of SDMM. It is demonstrated that, for a certain value of M, as 2k increases, the exactness increases and for a certain value of 2k, as M increases, the exactness increases as well. Therefore, HOBW for solving this problem is very effective and more accurate as compared with the second derivative multistep method.

Table 5 A truncate and correct solutions for Example 4

The results acquired by the present method are compared with the correct solution as demonstrated in Table 5. For examples 4, we have very less AE by increasing the order of HOBW.

6 Conclusion

In this paper, we introduced VIDE as equivalent to the LEE. The acquired VIDE form of LEE to overcome the difficulty of the singular behavior at x = 0. The HOBW has been connected for settling the most prominent differential conditions. Despite this reality, such a model gives an imperative hypothetical point of view concerning the hypothesis, as one may see this as the fringe between polytropic one that is physically attainable. It is additionally important to take note of that such an outstanding model has, despite the unending range, a limited mass. Moreover, other outstanding models, which are made in a “layered” form where each layer comprises of a polytope of an alternate record, may likewise use this capacity for a bit of the star, in which case a limited sweep would be conceivable. Notwithstanding these relations, there are likewise a few different determinations that one can make from the polytropic model of stars. For relations of this sort, there exists a connection between the polytropic file, the mass of a star, and the span. It is maybe apparent in the talk of the investigative arrangements of the polytropic record that one could gather a connection between the polytropic file of the star and the range that one would ascertain from that star. The class of the equations was released, by changing the coefficient yand the method was introduced. Using this method, the VIDE forms is reduced to algebraic equations. We got these equations involving 2k × (M − 1)variables which solved using Newton’s iterative method through MAPLE program. It was evident that the method for a certain value of M as 2k increased, the exactness was increased, and also for a certain value of M, as M increased, the exactness was increased high as well.