Open access peer-reviewed chapter - ONLINE FIRST

A Modified Spectral Relaxation Method for Some Emden-Fowler Equations

By Gerald Tendayi Marewo

Submitted: December 14th 2020Reviewed: February 13th 2021Published: April 27th 2021

DOI: 10.5772/intechopen.96611

Downloaded: 14


In this chapter, we present a modified version of the spectral relaxation method for solving singular initial value problems for some Emden-Fowler equations. This study was motivated by the several applications that these equations have in Science. The first step of the method of solution makes use of linearisation to solve the model problem on a small subinterval of the problem domain. This subinterval contains a singularity at the initial instant. The first step is combined with using the spectral relaxation method to recursively solve the model problem on the rest of the problem domain. We make use of examples to demonstrate that the method is reliable, accurate and computationally efficient. The numerical solutions that are obtained in this chapter are in good agreement with other solutions in the literature.


  • Emden-Fowler equations
  • Lane-Emden equations
  • singular initial value problem
  • spectral relaxation method
  • numerical method

1. Introduction

The singular initial value problem


for the Lane-Emden Eq. (1) models several phenomena such as the thermal behaviour of a spherical cloud of gas acting under the mutual attraction of its molecules [1], the temperature variation of a self gravitating star, the kinetics of combustion [2], thermal explosion in a rectangular slab [3] and the density distribution in isothermal gas spheres [4]. Moreover, Eq. (1) has been used many a time as a benchmark for new methods.

A particular case of Eq. (1) is the Emden-Fowler equation of the first kind:


As mentioned in [5], Eq. (2) represents the dimensionless form of the governing equation for the gravitational potential of a Newtonian self-gravitating, spherically symmetric, polytropic fluid. The equation provides a useful approximation for stars.

A more general form for Eq. (2) is the Emden-Fowler equation


which can be written as

py+qy=hxyy where=ddx,E4

an equation which was discussed in [6]. An existence result for the solution is given therein under certain conditions on px,qxand hxyy.

Exact solutions are available for particular cases of Eq. (3) [7], but not for the general case according to the best of our knowledge. This is motivation enough for seeking approximate solutions. To this end several approximate analytical methods were used by other researchers to solve Eq. (3). Van Gorder [8] made use of the Homotopy analysis method (HAM) and its variant, the Optimal homotopy analysis method, to solve a boundary value problem for the Lane-Emden equation of the second kind. The two respective analytical solutions that they obtained were in strong agreement. The Homotopy perturbation method (HPM) is another variant of the HAM that was used by Chowdhury and Hashim [9] to solve an initial value problem for Eq. (3). Their analytical solutions were the same as those that were obtained by Wazwaz [10] using the Adomian decomposition method (ADM). Chowdhury and Hashim observed that the HPM was less computationally expensive than the ADM. Wazwaz [11] made use of the variational iteration method (VIM) to solve both initial value problems and boundary value problems for Eq. (3) and for some inhomogeneous Emden-Fowler equations. The results that they obtained demonstrated the reliability and effectiveness of the VIM.

Some numerical methods have been used by other researchers to approximate solutions to Eq. (3). Many of these numerical methods fall in the class of collocation methods. Examples of these collocation methods include but are not limited to the Chebyshev wavelet finite difference method (CWFDM) [12], the Haar wavelet collocation method (HWCM) [13], the Taylor wavelet method (TWM) [14] and the Radial basis function - differential quadrature method (RDF-DQM) [15]. One distinct feature of these collocation methods is the choice of collocation points for discretizing the problem domain. Another distinct feature is the choice of basis functions that are used either for constructing numerical solutions or for numerical differentiation. The CWFDM makes use of Chebyshev-Gauss-Lobatto collocation points and Chebyshev wavelet finite difference basis functions. The HWCM makes use of the collocation points


on the problem domain 0L, and the method uses integrals of Haar wavelets as basis functions. The TWM uses roots of shifted Legendre polynomials as collocation points, and as basis functions the method uses Taylor wavelets which are special functions that defined in terms of Taylor polynomials. Convergence results for the Taylor wavelet solution were presented in [14]. The RDF-DQM uses collocation points


on the problem domain 0Land the method makes use of Radial basis functions. Unlike making use of collocation methods for solving Eq. (3) Van Gorder and Vajravelu [1] used the Runge–Kutta-Felhberg 4-5 (RKF45) method to validate the analytical solutions that they obtained from using the HAM and from using the traditional power series method. The RKF45 method is an embedded Runge–Kutta-pair which makes use of an adaptive stepsize to control the method and to ensure stability properties such as A-stability. See [16] for more details on the RKF45 method.

In this chapter we make use of a modified version of the spectral relation method (SRM) to solve an initial value problem for Eq. (3). We denote our method by MSRM. The SRM was successfully used to solve fluid flow problems by for example Motsa [17], Motsa et al.[18], Shateyi et al.[19] and Gangadhar et al.[20] to mention a few. In [17, 18, 19, 20] the SRM was shown to be accurate, computationally efficient and easy to implement. Moreover, the SRM was applied only after transforming the governing partial differential differential equations to ordinary differential equations. However, not so long ago the SRM was modified in such a way that it was directly applicable to partial differential equations. See for example [21]. The SRM was used to solve other types of problems such as hyperchaotic systems [22]. It is to the best of our knowledge that the MSRM has not been used in existing literature. We chose the MSRM because it is not computationally intensive and it is easy to implement.

In Section 2 we describe the MSRM for the model problem. In Section 3 we make use of examples to demonstrate the accuracy and computational efficiency of the MSRM. Section 4 concludes this chapter.


2. The MSRM for the model problem

We seek an approximate solution to


where γ>0,L,αare given constants and fand gare given functions.

We follow the idea behind the solution method by Ramos [23], where the singularity at x=0is isolated in a sufficiently small subinterval Iε=0εof I=0Lwhere ε>0. The point x=εsplits interval Iinto two subintervals: Iεand IIε=εL. A linearisation method is used to solve Eq. (5) restricted to Iε, i.e., near the singularityat x=0. In order to improve the accuracy of the method on the subinterval IIεwe form a partition


The method by Ramos proceeds by using the same linearisation method on the subintervals Im,m=1Mof IIε, i.e. away from the singularity. To this end, at the interface xm1of Im1and Imwe make use the solution of Eq. (3) restricted to Im1to generate the initial conditions for Eq. (3) restricted to Im. This ensures continuity of the solution. In this chapter we avoid linearisation on IIεby making use of the SRM on the subintervals of IIε. However, as was done in [23] we make use of linearisation on Iε. This approach results in the MSRM. A detailed description of the MSRM is given in Sections 2.1 and 2.2.

2.1 Near the singularity

Let ε0Lbe a sufficiently small number. Restrict problem (5) to 0εand re-arrange to get


If we Taylor expand uabout ε0=εy0y0y0y0and neglect higher order terms we get


where usdenotes us. Consequently, Eq. (7) can be replaced by


where the differential equation now holds at x=0because the singularity there is no longer present. If H00and R0G0/22+H0>0, then problem (8) has analytical solution [23]


for 0xε,whereλ0±=G0/2±R0,C0=L0/H0,




We take α0and α0as initial values for problem (7) restricted to εLin the next section.

2.2 Away from the singularity

We seek yxsatisfying


In this section we begin by describing the SRM for problem (11). In practical applications it is usually important to obtain a solution to (11) which possesses a prescibed degree of accuracy. To this end we make use of the SRM on a partition of the problem domain εL. This is our last task in this section.

The first step of the SRM for (11) is to let v=yand w=vso that we obtain the equivalent problem


for εxLwhich upon making use of the change of variable




for 1η1where β=2/Lε.As described in [19] the next step of the SRM mimicks the Gauss–Seidel method for linear systems and it yields the iteration


for 1=ηNηη0=1where r=0,1,and on 11we formed a grid consisting of the Chebyshev-Gauss-Lobatto collocation points


If the initial approximations v0and w0to vand w, respectively, are prescribed then Eqs. (16) and (17) generate sequences vrr=1and wrr=1of consecutive approximations. To this end we assume that vrand wrare known at the end of the rth iteration. Once Eq. (16) is solved for vr+1the right hand side R2of Eq. (17) becomes known and we solve this equation for wr+1. Since vr+1and wr+1are now known, we proceed in a similar manner to compute vr+2and wr+2, and so on. As done in [19] we solve Eqs. (16) and (17) by making use of Chebyshev differentiation [24] to obtain


where D̂=βD,Dis the N×NChebyshev differentiation matrix,


is a diagonal matrix, and Ri=Riη0RiηNTwith i=1,2. Moreover,


and Tdenotes matrix transpose.

We prescribe v0and w0by requiring that


Moreover, we assume that


The initial conditions


are included in the iterative scheme consisting of Eqs. (19) and (20) as shown below.


The larger Lis the less reliable is the SRM. As a workaround to this problem is we subdivide interval εLinto a disjoint union of non-overlapping subintervals as detailed in Eq. (6). Given the the model problem on I1, we use the SRM to compute estimate y˜to yon I1. We make use of y˜to compute initial values for the problem on I2. We repeat this procedure for the problem on I2and continue in a similar manner until we exhaust εL. Shown in Algorithm 2.2 is an outline of the MSRM for problem (5).

Algorithm 1: Putting the MSRM together.

  1. Let 0L=IεεLwhere Iε0εfor some sufficiently small number ε>0.

  2. Replace nonlinear Eq. (5) with linear Eq. (8) on Iεand compute solution yεxto Eq. (7) on Iε.

  3. Set α0=yεε, set α0=yεεand let ε=x0<x1<<xM=L.

  4. form=1,2,,Mdo

  5.  Define Imxm1xmand make use of the SRM to solve


        for the estimate y˜to yon Im.

  6.  Set α0=y˜xmand set α0=y˜'xm.

  7. end

2.3 Examples

In this section we make use of some examples to investigate the accuracy and computational effeciency of the MSRM.

Example 1 We look for a numerical solution to the problem


which Wazwaz [11] solved using the VIM and obtained the approximate.

analytical solution


When we apply the MSRM on (25) we get the following components for constructing the numerical solution.

1. Coefficients


for problem (8).

2. Initial values


for problem (11).

3. Entries


in the vectors on the right hand sides of Eqs. (19) and (20).

The MSRM generates a numerical solution to problem (25) which is plotted together with the analytical solution (26) in Figure 1(a). Figure 1(a) shows a good agreement between the numerical and analytical solutions. For a more detailed comparion of the two solutions see Table 1. Table 1 and Figure 1(b) show that the absolute error of the numerical solution is no more than 0.5×106. Thus the numerical solution agrees with the analytical solution in the first 6decimal places. This degree of accuracy was achieved by the MSRM upon choosing N=60,M=10, setting the maximum number of iterations as rmax=20and imposing the stopping criterion

Figure 1.

(a) Solutions to problem(25). (b) Absolute error of the MSRM solution to(25).

xMSRMSolution (26)Absolute error

Table 1.

Comparison of numerical values of ywith solution (26).


for the iterative method, where ε=106is the tolerance and w=max0iNwiis the infinity norm. It took only r=5iterations for the MSRM to achive the given degree of accuracy.

Example 2 We consider the initial value problem


that was solved by Wazwaz [10] using the ADM to obtain the approximate analytical solution


Applying the MSRM on (29) produces the following building blocks for constructing the numerical solution.

1. Coefficients


for problem (8).

2. Initial values


for problem (11).

3. Elements


of the vectors on the right hand sides of Eqs. (19) and (20).

A comparison of the MSRM solution to problem (29) with the analytical solution (30) is shown in Figure 2(a). The graph suggests that the two solutions are exactly the same. However, a closer look at the two solutions is provided in Table 2 and we observe that the analytical and numerical solutions are slightly different. A plot of the absolute error of the MSRM solution over a grid on the problem domain 010is shown in Figure 2(b). We observe that the absolute error does not exceed 0.5×107. Hence the MSRM solution and the analytical solution agree to within 7decimal places. For the MSRM to achieve this degree of accuracy we chose N=60,M=10,rmax=20and ε=106. We observed that the MSRM stopped at iteration r=5for problem (29).

Figure 2.

(a) Solutions to problem(29). (b) Absolute error of the MSRM solution to(29).

xMSRMSolution (34)Absolute error

Table 2.

Comparison of numerical values of ywith solution (30).

Example 3 We seek a numerical solution to




is the exact solution [25]. We restrict the problem to a relatively small interval 01because the solution (34) grows rapidly.

The MSRM for (34) gives the following components for constructing the numerical solution.

1. Coefficients


for problem (8).

2. Initial values


for problem (11).

3. Right hand sides


for linear systems (19) and (20).

Figure 3(a) shows that the numerical solution agrees well with the analytical solution (34). For a closer look at how the numerical and analytical solutions compare see Table 3. We observe that the MSRM solution agrees with the analytical solution (34) on the problem domain 01to within at least 7decimal places. A plot of the absolute error at these grid points on 01is shown in Figure 3(b). We observe that the absolute error in the MSRM increases as me move away from the singular point x=0, but the absolute error never exceeds 0.5×107. This degree of accuracy is achieved with N=60,M=10,rmax=20and ε=106. Moreover, only 6iterations were required to achieve this degree of accuracy.

Figure 3.

(a) Solutions to problem(33). (b) Absolute error of MSRM solution to(33).

xMSRMSolution (34)Absolute error

Table 3.

Comparison of numerical values of ywith solution (34).

3. Conclusions

In this chapter we presented a modified spectral relaxation method (denoted by MSRM) for solving singular initial value problems for some Emden-Fowler equations. We made use of some examples of the model problem to demonstrate that the MSRM is reliable, accurate and computationally efficient. The method provided a reliable treatment of the singular point. The MSRM solutions were compared with analytical solutions that were obtained using other methods, i.e., the Variational iteration method and the Adomian decomposition method. There was agreement between the solutions that were compared in the first 6decimal places. A possible way of increasing the degree of accuracy of the MSRM would be to increase the tolerance for the method. This and other ways for optimizing the method could consistute future work. In all the examples that were considered, it took at most 6iterations for the MSRM to converge. Hence the method exhibited rapid convergence.

Download for free

chapter PDF

© 2021 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution 3.0 License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

How to cite and reference

Link to this chapter Copy to clipboard

Cite this chapter Copy to clipboard

Gerald Tendayi Marewo (April 27th 2021). A Modified Spectral Relaxation Method for Some Emden-Fowler Equations [Online First], IntechOpen, DOI: 10.5772/intechopen.96611. Available from:

chapter statistics

14total chapter downloads

More statistics for editors and authors

Login to your personal dashboard for more detailed statistics on your publications.

Access personal reporting

We are IntechOpen, the world's leading publisher of Open Access books. Built by scientists, for scientists. Our readership spans scientists, professors, researchers, librarians, and students, as well as business professionals. We share our knowledge and peer-reveiwed research papers with libraries, scientific and engineering societies, and also work with corporate R&D departments and government entities.

More About Us