# Solution of the Lane-Emden Equation Using the Bernstein Operational Matrix of Integration

Authors: Narayan Kumar; Rajesh K. Pandey; Carlo Cattani
Journal: ISRN Astronomy and Astrophysics
 (2011)

---

## Abstract

Lane-Emden's equation has fundamental importance in the recent analysis of many problems in relativity and astrophysics including some models of density profiles for dark matter halos. An efficient numerical method is presented for linear and nonlinear Lane-Emden-type equations using the Bernstein polynomial operational matrix of integration. The proposed approach is different from other numerical techniques as it is based on the Bernstein polynomial integration matrix. Some illustrative examples are given to demonstrate the efficiency and validity of the proposed algorithm.


---

## Body

## 1. Introduction

In recent years, the studies of singular initial value problems in some special second-order ordinary differential equations (ODEs) have attracted the attention of many mathematicians and physicists. One of the most intriguing equations is the Lane-Emden-type equations which models many phenomena in mathematical physics and astrophysics. It is a nonlinear ordinary differential equation which describes the equilibrium density distribution in self-gravitating sphere of polytrophic isothermal gas and has a singularity at the origin. This equation has fundamental importance in the field of radiative cooling and modeling of clusters of galaxies. It has also proven to be most versatile in the examination of a variety of situations, including the analysis of isothermal cores, convective stellar interiors, and fully degenerate stellar configurations. Moreover, it has been recently observed [1–3] that the density profiles of dark matter halos are often modeled by the isothermal Lane-Emden equation with suitable boundary conditions at the origin. Since the solution is often given by some numerical approximation, the chosen method would implies some consequences on the physical interpretation of the dark matter evolution. In the following we will give an efficient method for computing its numerical solution.Lane-Emden’s equations [4, 5] are categorized as nonlinear ordinary differential equations with singular initial values. The more general Cauchy problem in this category is the following equation:(1)y′′(t)+αty′(t)+f(t,y)=g(t),α,t≥0,
with initial conditions (ICs)(2)y(0)=a,y′(0)=0,
where primes denote differentiation with respect to t, α is constant, and f(t,y) is a nonlinear function of t and y.It has been shown [6] that there exists an analytic solution of (1), (2) in the neighbourhood of the singular point t=0.In the special case, whereα=2, f(t,y)=f(y), g(t)=0 and IC (2) holds, we have one of the most studied cases(1′)y′′(t)+2ty′(t)+f(y)=0,t≥0.
For instance, with f(y)=yn and a=1, we get(3)y′′(t)+2ty′(t)+yn=0,t≥0,
which in the form(4)1t2ddt(t2dydt)+yn=0
subject to IC (5)y(0)=1,y′(0)=0
was originally given by Lane [4] and (later) Emden [5].The parametern has physical significance only in the range 0≤n≤5. The solution for a given index n is known as polytropic index n. Equation (3) with IC (5) has well-known analytical solutions [7] for n=0,1,5 while, for other values of n, numerical solutions are still sought. The series solution can be found by perturbation techniques and Adomian decomposition methods (ADM). However, these solutions are often convergent in restricted regions. Thus, some techniques such as the Padé method are required to enlarge the convergent regions [8, 9].Similarly, by choosingf(t,y)=ey and a=0 in (1′) and (2), isothermal gas spheres equation are modeled by(6)y′′(t)+2ty′(t)+ey(t)=0,t≥0,
with IC  (7)y(0)=0,y′(0)=0.
A number of methods have recently been proposed to solve (1′), (6). They are quasilinearization methods [10–12], a piecewise linearization technique [13], and the Lagrangian-based analytic solution [14]. The approximate solutions were also given by homotopy analysis method (HAM) [15, 16], variational iteration method [17], and variational approach method [18].A numerical method based on conversion into integral equations solved by Legendre wavelets is given in [19]. Hybrid functions have also been used in [20] to find the numerical solutions of (1) for some particular nonlinear cases.In [21] the transform t=ex to (1′) is given to get(8)ÿ(x)+ẏ(x)+e2xf(y(x))=0,
subject to the conditions(9)Limx→-∞y(x)=a,lim⁡x→-∞e-xẏ(x)=0,
where dots denote differentiations with respect to x. Then, an approximate solution of (8) is obtained in [0,1] by variational iteration method, for special cases whenf(y)=yn and n=0,1,5.Legendre’s spectral method for solving only singular IVPs is given in [22]. In [23], modified homotopy analysis methods (MHAMs) enable to obtain approximate solution and to show that MHAM solution contains the previous solutions obtained by ADM and HPM.A collocation method based on Chebyshev’s polynomials is proposed in [24]. In [25–27], three different methods are presented, to solve (1), based on the Hermite function collocation method, the Lagrangian method, and radial basis function approximation, respectively. The Jacobi-Gauss collocation method is given in [28]. In [29] the optimal homotopy asymptotic method is applied to obtain the analytic solution of singular Lane-Emden-type equation. The perturbation technique and delta-expansion method are presented in [30, 31], respectively.The aim of the present paper is to apply the Bernstein polynomial operational matrix of integration for the first time, to propose a reliable numerical technique for solving linear and nonlinear Lane-Emden’s equations. Some special cases of the problem are solved to show its validity and efficiency in comparison with other existing numerical methods. The approximate solution, obtained by the proposed method, shows its superiority on the other existing numerical solution.


## 2. Bernstein’s Polynomials

A Bernstein polynomial [32] is a polynomial in the Bernstein form that is a linear combination of the Bernstein basis polynomials. The Bernstein basis polynomials of degree n are defined by(10)Bi,n(t)=(ni)ti(1-t)n-i,fori=0,1,2,…,n.
There are (n+1)nth degree Bernstein basis polynomials forming a basis for the linear space Vn consisting of all polynomials of degree less than or equal to n in R[t]-the ring of polynomials over the fieldR. For mathematical convenience, we usually set Bi,n=0if i<0 or i>n. Any polynomial B(t) in Vn may be written as(11)B(t)=∑i=0nβiBi,n(t).
Then B(t) is called a polynomial in the Bernstein form or the Bernstein polynomial of degree n. The coefficients βi are called Bernstein’s or Bezier’s coefficients. Often, the Bernstein basis polynomials Bi,n(t) are called the Bernstein polynomials. We will follow this convention as well. A function f∈L2[0,1] may be written as(12)f(t)=lim⁡n→∞∑i=0ncinBin(t),
where cin=〈c,Bin〉 and 〈,〉 is the standard inner product on L2[0,1].If (3) is truncated at n=m′, then we have(13)f≅∑i=0mcimBim=CTΨ(t),
where C and Ψ(t) are (m′+1)×1 matrices given by(14)C=[c0,m′c1,m′⋯cm′,m′]T,Ψ(t)=[B0,m′(t)B1,m′(t)⋯Bm′,m′(t)]T.
For taking the collocation points, let t0 be any point near to zero and other point as follows:(15)ti=t0+im′+1,i>0.
Let us use the notationm=m′+1, for defining the Bernstein operational matrix Φm×m as follows:  (16)Φm×m=[B0,m′(t0)B1,m′(t1)⋯Bm′,m′(tm′)]T.
For example, when m=6, the Bernstein operational matrix is expressed as(17)Φm×m=[0.00600.40190.26220.09300.01620.00060.00000.20240.32920.23340.08160.00790.00000.05440.22050.31250.21850.05280.00000.00820.08300.23530.32920.19950.00000.00070.01670.09450.26460.40190.00000.00000.00140.01580.08860.3373].


## 3. Block Pulse Function and Operational Matrix of Integration

a set of block pulse functions (BPFs) is defined on[0,1) as(18)bi(t)={1,im≤t<i+1m,0,otherwise,wherei=0,1,…,m-1.
The functions bi(t) are disjoint and orthogonal, that is,(19)bi(t)bj(t)={0,i≠j,1,i=j,∫01bi(t)bj(t)dt={0,i≠j,1m,i=j.
The block pulse operational matrix of the integration Fα is defined [33] as following:
(20)(IαBm)(t)≈FαBm(t),
where Iα=∭⋯︷αtimes(21)Bm(t)=[b0(t)b1(t)⋯bm-1(t)],Fα=1mα1Γ(α+2)[1ε1ε2⋯εm-101ε1⋯εm-2001⋯εm-3000⋱⋮00001],
with
(22)εk=(k+1)α+12kα+1+(k-1)α+1.
In general the operational matrix of integration of the vector ψm(t) can be obtained as(23)∫0tψm(τ)dτ≈Pm×mψm(t),
where P is the m×m operational matrix for integration.The Bernstein polynomial can also be expanded and approximated into anm-term block pulse function (BPF) as
(24)ψm(t)=Φm×mBm(t).
Let us consider that the matrix Pm×mα is the Bernstein polynomial operational matrix of the integration, then we have
(25)(Iαψm)(t)≈Pm×mαψm(t).
Now, we have(26)(Iαψm)(t)≈(IαΦm×mBm)(t)=Φm×m(IαBm)(t)≈Φm×mFαBm(t).
From (25) and (18) we get(27)Pm×mαψm(t)≈Φm×mFαΦm×m-1ψm(t).
Then, the Bernstein polynomial operational matrix of the integration Pm×mα is given by(28)Pm×mα=Φm×mFαΦm×m-1.


## 4. Outline of the Method

In this section, the method presented in Section3 is applied to solve the linear and nonlinear Lane-Emden equations. Letting  (29)F(t,y)=f(y)=yn(t)witha=1,(1′) can be written as(30)y′′(t)+2ty′(t)+yn(t)=0,withICy(0)=1,y′(0)=0,
where t,n≥0.Since exact solutions for the casen=0,1,5 are known, we solve them first by the proposed algorithm developed in Section 3.Let(31)D2y(t)=kmTψm(t),
where kmT is unknown,(32)⟹Dy(t)=kmTPm×m1ψm(t),⟹y(t)=kmTPm×m2ψm(t).
We have (33)y(t)=kmTPm×m2Φm×mBm(t)+1.
Assume (34)kmTPm×m2Φm×m+1=[a1a2⋯am],[y(t)]n=[a1na2n⋯amn]Bm(t).
Substituting (31)–(34) in (30), we get(35)kmTΦm×mBm(t)+2tkmTPm×m1Φm×mBm(t)+[a1na2n⋯amn]Bm(t)=0.
Solution of (35) yields the value of kmT.


## 5. Numerical Results and Discussions

In this section some special cases of (1′) have been considered to illustrate the efficiency of the method.


### 5.1. Standard Lane-Emden Equation

Consider the standard Lane-Emden equation:(36)y′′(t)+2ty′(t)+yn(t)=0,
with initial condition y(0)=1 and y′(0)=0, which has the exact solution for the case n=0, 1, and 5 are known. Equation (36) with the initial conditions has been solved with the proposed method, and obtained results are presented in Figure 1 along with Table 1.Table 1
Comparison of the numerical solution and error obtained by present method forn=3 in (36) with series solution [25].
xOur methodSeries method [25]m=32m=128m=2560.00.00E+000.00E+000.00E+000.00E+000.14.02E-052.51E-066.28E-071.40E-060.52.89E-051.85E-064.96E-072.99E-061.04.39E-053.79E-053.76E-051.99E-06Figure 1
Graph of standard Lane-Emden’s equation and its approximate solution at different values ofn=1,1.5,2.5,3,3.5,5 (at m=32) for Section 5.1.Here we can see that the function basically follows the same form as that for an indexn=0, with a few minor differences; however, the polytrope of index n=0 also terminates at a finite radius just as is observed in the relation for a polytrope of index n=1. Though these two solutions for n=1 and n=0 share many characteristics, the solution for the polytrope of index n=5 contains some radically different and unexpected characteristics. In this case the behavior of the function is markedly different than that of its predecessors. Here the density of the star initially decreases rapidly as radius increases but slows rapidly once a t-value of around three is reached. At this point the decrease slows continually. Though it may not be apparent on the graphic provided, the function never reaches 0. It is, therefore, evident that a polytropic star of index n=5 has an infinite radius, and in reality cannot exist.


### 5.2. Isothermal Gas Spheres Equation

Lettingf(t,y)=ey with a=0, (1) can be written as(37)y′′(t)+2ty′(t)+ey=0,
with IC y(0)=0, y′(0)=0. The isothermal gas spheres are modeled in [6]. Equation (38) is solved with the presented method, and the obtained solution is compared with the existing solutions. The plot of proposed and exact solution is given in Figure 2 and comparison has been done in Table 2.Table 2
Comparison of the numerical solution and error obtained by present method with series solution [25].
xOur methodSeries method [25]m=32m=128m=2560.00.00E+000.00E+000.00E+000.00E+000.14.05E-052.53E-066.32E-075.85E-070.24.00E-052.50E-066.26E-076.04E-070.53.65E-052.28E-065.72E-075.58E-071.02.51E-057.88E-075.07E-078.20E-07Figure 2
Graph of approximate solution in comparison with [9] solution for Section 5.2.


### 5.3. Nonlinear Homogeneous Lane-Emden Equation

Letf(t,y)=4(2ey+ey/2) with a=0, (1) be written as(38)y′′(t)+2ty′(t)+4(2ey+ey/2)=0,t≥0
with IC y(0)=0 and y′(0)=0, where the exact solution is y(t)=-In(1+t2). We solve the above problem, by applying the technique described in Section 4 with m= 32, 128 and 256 and plotted in Figures 3 and 4, and comparison has been done in Table 3.Table 3
Comparison of the numerical solution and error obtained by present method with series solution [25].
xPresent methodSeries method [25]m=32m=128m=2560.00.00E+000.00E+000.00E+000.00E+000.14.66E-042.91E-057.28E-063.94E-060.51.46E-049.16E-062.29E-073.02E-061.08.60E-053.68E-061.28E-089.31E-07Figure 3
Graph of exact solution and approximate solution (atm=32) for Section 5.3.Figure 4
Absolute error form=32.


## 5.1. Standard Lane-Emden Equation

Consider the standard Lane-Emden equation:(36)y′′(t)+2ty′(t)+yn(t)=0,
with initial condition y(0)=1 and y′(0)=0, which has the exact solution for the case n=0, 1, and 5 are known. Equation (36) with the initial conditions has been solved with the proposed method, and obtained results are presented in Figure 1 along with Table 1.Table 1
Comparison of the numerical solution and error obtained by present method forn=3 in (36) with series solution [25].
xOur methodSeries method [25]m=32m=128m=2560.00.00E+000.00E+000.00E+000.00E+000.14.02E-052.51E-066.28E-071.40E-060.52.89E-051.85E-064.96E-072.99E-061.04.39E-053.79E-053.76E-051.99E-06Figure 1
Graph of standard Lane-Emden’s equation and its approximate solution at different values ofn=1,1.5,2.5,3,3.5,5 (at m=32) for Section 5.1.Here we can see that the function basically follows the same form as that for an indexn=0, with a few minor differences; however, the polytrope of index n=0 also terminates at a finite radius just as is observed in the relation for a polytrope of index n=1. Though these two solutions for n=1 and n=0 share many characteristics, the solution for the polytrope of index n=5 contains some radically different and unexpected characteristics. In this case the behavior of the function is markedly different than that of its predecessors. Here the density of the star initially decreases rapidly as radius increases but slows rapidly once a t-value of around three is reached. At this point the decrease slows continually. Though it may not be apparent on the graphic provided, the function never reaches 0. It is, therefore, evident that a polytropic star of index n=5 has an infinite radius, and in reality cannot exist.


## 5.2. Isothermal Gas Spheres Equation

Lettingf(t,y)=ey with a=0, (1) can be written as(37)y′′(t)+2ty′(t)+ey=0,
with IC y(0)=0, y′(0)=0. The isothermal gas spheres are modeled in [6]. Equation (38) is solved with the presented method, and the obtained solution is compared with the existing solutions. The plot of proposed and exact solution is given in Figure 2 and comparison has been done in Table 2.Table 2
Comparison of the numerical solution and error obtained by present method with series solution [25].
xOur methodSeries method [25]m=32m=128m=2560.00.00E+000.00E+000.00E+000.00E+000.14.05E-052.53E-066.32E-075.85E-070.24.00E-052.50E-066.26E-076.04E-070.53.65E-052.28E-065.72E-075.58E-071.02.51E-057.88E-075.07E-078.20E-07Figure 2
Graph of approximate solution in comparison with [9] solution for Section 5.2.


## 5.3. Nonlinear Homogeneous Lane-Emden Equation

Letf(t,y)=4(2ey+ey/2) with a=0, (1) be written as(38)y′′(t)+2ty′(t)+4(2ey+ey/2)=0,t≥0
with IC y(0)=0 and y′(0)=0, where the exact solution is y(t)=-In(1+t2). We solve the above problem, by applying the technique described in Section 4 with m= 32, 128 and 256 and plotted in Figures 3 and 4, and comparison has been done in Table 3.Table 3
Comparison of the numerical solution and error obtained by present method with series solution [25].
xPresent methodSeries method [25]m=32m=128m=2560.00.00E+000.00E+000.00E+000.00E+000.14.66E-042.91E-057.28E-063.94E-060.51.46E-049.16E-062.29E-073.02E-061.08.60E-053.68E-061.28E-089.31E-07Figure 3
Graph of exact solution and approximate solution (atm=32) for Section 5.3.Figure 4
Absolute error form=32.


## 6. Conclusions

The Bernstein polynomial operational matrix of integrations has been applied for solving one of the most popular and intriguing differential equations, that is, the Lane-Emden equations. These results are useful in a few respects and deal with some actual state equation for stars. Though these two solutions forn=1 and n=0 share many characteristics, the solution for the polytrope of index n=5 contains some radically different and unexpected characteristics. In this case the behavior of the function is markedly different than that of its predecessors. Here the density of the star ρ=λyn, where λ represents the central density of the star and y that of a related dimensionless quantity, initially decreases rapidly as radius increases but slows rapidly once a t-value of around three is reached. At this point the decrease slows continually. Though it may not be apparent on the graphic provided, the function never reaches 0. It is, therefore, evident that a polytropic star of index n=5 has an infinite radius and in reality cannot exist. Despite this fact, such a model provides important theoretical perspective concerning the theory, as one may view this as the border between polytropic one that are physically feasible. It is also of interest to note that such a stellar model has, in spite of the infinite radius, a finite mass. Additionally, other stellar models, which are created in a “layered” fashion where each layer consists of a polytrope of a different index, may also utilize this function for a portion of the star, in which case a finite radius would be possible. In addition to these relations, there are also a number of other conclusions that one can draw from the polytropic model of stars. For relations of this type, there exists a relation between the polytropic index, mass of a star, and the radius. It is perhaps evident in the discussion of the analytic solutions of the polytropic index that one could possibly infer a relation between the polytropic index of the star and the radius that one would calculate from that star. In the attempt to find a relation, the most immediate result is obtained from the simple equations of stellar state.



---

*Source: 351747-2012-01-11.xml*