1 Introduction

The distribution of mass within a star is an important astrophysical problem and has been the subject of intense ongoing research. Within the context of classical physics Euler-Poisson equations form the basis for this research (Humi 2018, 2006). A special set of solutions to these equations for non-rotating spherically symmetric stars with mass-density \(\rho =\rho (r)\) and flow field \(u=0\) is provided by the Lane-Emden functions. The generalization of these equations to include axi-symmetric rotations was by considered by Milne (1923), Chandrasekhar (1938, 1967) and many others.

Another aspect of this problem relates to the emergence of density pattern within a primordial interstellar gas. This problem was considered first by Laplace in 1796 who conjectured that a primitive interstellar gas cloud may evolve under the combined influence of gravity and rotation to form a system of isolated rings which may in turn lead to the formation of planetary systems (Woolfson 2000; Prentice 1978; Matsumoto and Hanawa 1999; Prentice and Dyt 2003). Such a system of rings around a protostar has been observed recently in the constellation Taurus (ALMA Partnership 2015).

It is obvious however that on physical grounds this problem should be treated within the context of General Relativity. The Einstein equations of General Relativity are highly nonlinear (Milne 1923; Adler et al. 1975) and their solution presents a challenge that has been addressed by many researchers (Adler et al. 1975; Stephani et al. 2003; Heinzle et al. 2003). An early solution of these equations is due to Schwarzschild for the field exterior to a spherical star (Schwarzschild 1916). However, interior solutions (inside space occupied by matter) are especially difficult due to the fact that the energy-momentum tensor is not zero. Static solutions for this case were derived under idealized assumptions (such as constant density) by Tolman (1939), Adler (1974), Adler et al. (1975), Buchdahl (1959) and were addressed more recently in the lecture series by Gourgoulhon (2006) and the review by Paschalidis and Stergioulas (2017), Stephani et al. (2003), Schwarzschild (1916), Weyl (1918, 1919), Levi-Civita (1919), Matsumoto and Hanawa (1999) (these references contain a lengthy list of publications on this topic). In addition various constraints were derived for the structure of a spherically symmetric body in static gravitational equilibrium (Tolman 1939; Oppenheimer and Volkoff 1939; Buchdahl 1959; Adler 1974; Woolfson 2000). Interior solutions in the presence of anisotropy and other geometries were considered also (Arik and Delice 2005; Kovetz 1969; Bayin 1982; Maurya et al. 2015). An exhaustive list of references for exact solutions of the Einstein equations appears in Adler et al. (1975), Stephani et al. (2003).

Due to the complexity of the problem of stellar interiors, which involves several concurrent physical processes, we consider in this paper an idealized model based on General Relativity in which the star (or the interstellar gas cloud) is polytropic and inquire about the mass density pattern within the star under this assumption. This assumption implies implicitly that some thermodynamic processes are ongoing within the star. These type of processes have been ignored in some stellar models in General Relativity, e.g. the interior Schwarzschild Solution.

For polytropic gas we have the following relationship between pressure \(p\) and density \(\rho \)

$$ p=A\rho ^{\alpha } $$
(1.1)

where \(\alpha \) is the isentropy index and \(A\) is the isentropy coefficient. In the literature, when \(\alpha =1\) the gas is considered to be isothermal. However, when (and only when) \(\alpha \) equals the ratio of specific heats at constant pressure or specific heat at constant volume, the gas is isentropic. For all other values of \(\alpha \) the gas is called polytropic. This marks finite heat exchanges within the fluid. However, one can consider a more general functional relationship between \(p\) and \(\rho \) where both \(\alpha \) and \(A\) are dependent on \(r\). The physical motivation for these generalized polytropic relationships with \(A = A(r)\) and/or \(\alpha = \alpha (r)\) is due the large spatial dimension of the star (or the primordial cloud). Therefore it stands to reason that variations in these constants make sense from a physical point of view and these functional relationships are more realistic than the ones with constant \(A\) and \(\alpha \). The spatial dependence of these parameters might imply a change in the intensity of the (thermodynamics) processes taking place. In this paper, however, we restrict ourselves and consider only functional relationships between \(p\) and \(\rho \) in which only one of these parameters is dependent on \(r\), viz. either \(p=A(r)\rho (r)^{ \alpha }\) where \(\alpha \) is constant or \(p=A\rho (r)^{\alpha (r)}\) where \(A\) is constant. These two position-dependent expressions for the isentropy relationship represent different physical properties of the gas.

The plan of the paper is as follows: In Sect. 2 we review the basic theory and equations that govern mass distribution and the components of the metric tensor. In Sect. 3 we derive an equation for the cumulative mass of the sphere as a function of \(r\) and use the Tolman-Oppenheimer-Volkoff (TOV) equation to derive equations for the isentropy index and coefficient. We then prove that when these two parameters are predetermined the mass density within the star cannot be chosen arbitrarily. In Sect. 4 we address the stability of a given mass distribution to small perturbations. In Sect. 5 we present exact and numerical solutions for polytropic spheres with predetermined mass density distribution and determine their isentropy coefficients and stability. We summarize with some conclusions in Sect. 6.

2 Review

In this section we present a review of the basic theory, following Chap. 14 in Adler et al. (1975).

The general form of the Einstein equations is

$$ R_{mn}-\frac{1}{2}g_{mn}R=- \frac{8\pi \kappa }{c^{2}}T_{mn}, \quad m,n=0,1,2,3, $$
(2.1)

where \(R_{mn}\) and \(R\) are respectively the contracted form of the Riemann tensor \(R_{abcd}\) and the Ricci scalar,

$$ R_{mn}=R^{a}_{man}, \qquad R=R^{m}_{m}. $$

\(T_{mn}\) is the matter stress-energy tensor, \(\kappa \) is Newton’s gravitational constant, \(c\) is the speed of light in a vacuum and \(g_{mn}\) is the metric tensor.

The general expression for the stress-energy tensor is

$$ T_{mn}=\rho u_{m}u_{n}+ \frac{p}{c^{2}}(u_{m}u_{n}-g_{mn}), $$
(2.2)

where \(\rho (\mathbf{x})\) is the proper density of matter and \(u_{m}(\mathbf{x})\) is the four vector velocity of the flow.

In the following we shall assume that \(\rho =\rho (r)\), \(p=p(r)\) and a metric tensor of the form

$$ g_{mn}=c^{2}e^{\nu }dt^{2}- \bigl[e^{\lambda }dr^{2}+r^{2}\bigl(d\phi ^{2}+\sin ^{2}\phi d\theta ^{2}\bigr)\bigr], $$
(2.3)

where \(\lambda =\lambda (r)\), \(\nu =\nu (r)\) and \(r,\phi ,\theta \) are the spherical coordinates in 3-space.

When matter is static \(u_{m}=(u_{0},0,0,0)\) and \(T_{mn}\) takes the following form,

$$\begin{aligned} T_{mn} = \left ( \textstyle\begin{array}{c@{\quad }c@{\quad }c@{\quad }c} \rho e^{\nu } &0&0 &0 \\ 0&\frac{p}{c^{2}}e^{\lambda } &0 &0 \\ 0 &0 &\frac{p}{c^{2}}r^{2}&0 \\ 0&0&0&\frac{p}{c^{2}}r^{2}\sin ^{2}\phi \end{array}\displaystyle \right ). \end{aligned}$$
(2.4)

After some algebra (Adler et al. 1975; Tolman 1939; Oppenheimer and Volkoff 1939) one obtains equations for \(\rho \), \(p\), \(\lambda \), \(\nu \) and \(M(r)\), where \(M(r)\) is the total mass interior to radius \(r\) of the sphere. These are

$$\begin{aligned}& \frac{dM}{dr}=Br^{2}\rho \end{aligned}$$
(2.5)
$$\begin{aligned}& e^{-\lambda }=1-\frac{2M}{r} \end{aligned}$$
(2.6)
$$\begin{aligned}& \frac{e^{\lambda }}{r^{2}}=\frac{1}{r^{2}}- \frac{1}{4} \biggl[ \biggl(\frac{d \nu }{dr} \biggr)^{2}- \frac{d\nu }{dr}\frac{d\lambda }{dr} \biggr] \\& \phantom{\frac{e^{\lambda }}{r^{2}}=}+ \frac{1}{2r} \biggl(\frac{d\nu }{dr}+\frac{d\lambda }{dr} \biggr)- \frac{1}{2} \frac{d^{2}\nu }{dr^{2}} \end{aligned}$$
(2.7)
$$\begin{aligned}& \frac{C}{c^{2}}p=\frac{1}{r^{2}}-e^{-\lambda } \biggl(\frac{1}{r^{2}}+ \frac{1}{r}\frac{d\nu }{dr} \biggr) \end{aligned}$$
(2.8)

where

$$ C=-\frac{8\pi \kappa }{c^{2}},\qquad B=\frac{4\pi \kappa }{c^{2}}. $$

In addition we have the Tolman-Oppenheimer-Volkoff (TOV) equation which is a consequence of (2.5)–(2.8):

$$ \frac{1}{c^{2}}\frac{dp}{dr}=- \frac{M-Cr^{3}p/2c^{2}}{r(r-2M)} \biggl(\rho +\frac{p}{c ^{2}} \biggr). $$
(2.9)

In the following we normalize \(c\) to 1; \(B\) remains \(-\frac{C}{2}\).

Assuming that \(M(r)\) is known we can solve (2.7) algebraically for \(\lambda \) and substitute the result in (2.8) to derive the following equation for \(\nu \):

$$\begin{aligned}& \frac{1}{2}\frac{d^{2}\nu }{dr^{2}}+ \frac{1}{4} \biggl(\frac{d\nu }{dr} \biggr) ^{2} - \frac{1}{2}\frac{ (3M-r\frac{dM}{dr}-r )\frac{d \nu }{dr}}{r(2M-r)} \\& \quad-\frac{3M-r\frac{dM}{dr}}{r^{2}(2M-r)}=0 . \end{aligned}$$
(2.10)

Although this is a nonlinear equation it can be linearized by the substitution

$$ \frac{d\nu }{dr}=2\frac{\frac{du}{dr}}{u}= \frac{d\ln (u^{2})}{dr} $$
(2.11)

which leads to

$$ \frac{d^{2} u}{dr^{2}} - \frac{ (3M-r\frac{dM}{dr}-r )}{r(2M-r)} \frac{du}{dr} -\frac{3M-r \frac{dM}{dr}}{r^{2}(2M-r)}u=0. $$
(2.12)

3 On the structure of isentropic stars

In this section we consider isentropic stars and derive general analytic expressions for \(M(r)\), \(\alpha (r)\) and \(A(r)\).

3.1 General equation for \({M(r)}\)

Using the equations presented in the previous section one can derive a single equation for \(M(r)\) for a polytropic star where both \(A\) and \(\alpha \) are functions of \(r\):

$$ p=A(r)\rho ^{\alpha (r)}. $$
(3.1)

To this end we substitute the barotropic relation (3.1) in (2.8) to obtain

$$ \rho ^{\alpha (r)}=\frac{c^{2}}{CA(r)} \biggl\{ \frac{1}{r^{2}}-e^{- \lambda } \biggl(\frac{1}{r^{2}}+ \frac{1}{r}\frac{d\nu }{dr} \biggr) \biggr\} . $$
(3.2)

Substituting (2.5) for \(\rho \) in (3.2), normalizing \(c\) to 1 and using the fact that \(C=-2B\) it follows that

$$ \biggl(\frac{\frac{dM(r)}{dr}}{Br^{2}} \biggr)^{\alpha (r)} =- \frac{1}{2BA(r)} \biggl\{ \frac{1}{r^{2}}-e^{-\lambda } \biggl( \frac{1}{r ^{2}}+ \frac{1}{r}\frac{d\nu }{dr} \biggr) \biggr\} . $$
(3.3)

Substituting (2.6) for \(\lambda \) in (3.3) and solving the result for \(\frac{d\nu }{dr}\) yields

$$ \frac{d\nu }{dr}=-2\frac{ (\frac{\frac{dM(r)}{dr}}{Br^{2}} ) ^{\alpha (r)} BA(r)r^{3}+M(r)}{r(2M(r)-r)} . $$
(3.4)

Differentiating this equation to obtain an expression for \(\frac{d ^{2}\nu }{dr^{2}}\) and substituting in (2.10) leads finally to the following general equation for \(M(r)\):

$$\begin{aligned} &-2r^{3-2\alpha (r)}B^{1-\alpha (r)}\bigl(2M(r)-r\bigr) \biggl(\frac{dM(r)}{dr} \biggr) ^{\alpha (r)} \\ &\quad\times \biggl\{ A(r)\alpha (r)\frac{d^{2}M(r)}{dr^{2}}+ \frac{dM(r)}{dr} \\ &\quad\times \biggl[A(r)\ln \biggl(\frac{\frac{dM(r)}{dr}}{Br^{2}} \biggr) \frac{d \alpha (r)}{dr}+ \frac{dA(r)}{dr} \biggr] \biggr\} \\ &\quad+2r^{2-2\alpha (r)}B^{1-\alpha (r)}A(r) \biggl(\frac{dM(r)}{dr} \biggr) ^{\alpha (r)+1} \\ &\quad\times \biggl[r\frac{dM(r)}{dr}+M(r) \bigl(1+4\alpha (r) \bigr)-2r\alpha (r) \biggr] \\ &\quad+2r^{5-4\alpha (r)}B^{2-2\alpha (r)}A(r)^{2} \biggl( \frac{dM(r)}{dr} \biggr) ^{2\alpha (r)+1} \\ &\quad+2M(r) \biggl(\frac{dM(r)}{dr} \biggr)^{2}=0 . \end{aligned}$$
(3.5)

This is a highly nonlinear equation but it simplifies considerably when \(A(r)\) is a constant or \(\alpha (r)\) is an integer. A solution of this equation can then be used to compute the metric coefficients using (2.6) and (3.4). With this equation it is feasible to investigate the dependence of the mass distribution on the parameters \(\alpha (r)\) and \(A(r)\).

In view of the difficulty of obtaining analytic solutions for (3.5) an alternative strategy should be used to investigate the structure of polytropic stars. Thus if we start with some analytic form of \(\rho \) then we can use (2.5) to compute \(M(r)\). With this data it is straightforward to derive differential equations for \(\alpha (r)\) and \(A(r)\) using the TOV equation (2.9).

3.2 Equation for \({\alpha (r)}\) when \({A(r)}\) is constant

If we let \(A(r)\) in (3.1) be constant and substitute \(p=A \rho ^{\alpha (r)}\) in (2.9) we obtain after some algebra the following equation for \(\alpha (r)\).

$$\begin{aligned} &A r\bigl(2M(r)-r\bigr)\rho (r)^{\alpha (r)}\ln \bigl(\rho (r)\bigr)\frac{d\alpha }{dr} \\ &\quad+ Ar\alpha (r)\rho (r)^{\alpha (r)-1} \bigl(2M(r)-r\bigr)\frac{d\rho }{dr} \\ &\quad-\bigl[M(r)+ABr^{3}\rho (r)^{\alpha (r)}\bigr] \bigl[A \rho (r)^{\alpha (r)}+\rho (r)\bigr]=0. \end{aligned}$$
(3.6)

3.3 Equation for \({A(r)}\) when \({\alpha (r)}\) is constant

Following the same strategy as in the previous subsection we obtain a differential equation for \(A(r)\)

$$\begin{aligned} &r\bigl(2M(r)-r\bigr)\rho (r)^{\alpha } \frac{dA(r)}{dr} \\ &\quad+ \alpha A(r)r\bigl(2M(r)-r\bigr) \rho (r)^{\alpha -1} \frac{d\rho }{dr} \\ &\quad-\bigl[M(r)+Br^{3} A(r)\rho (r)^{\alpha }\bigr] \bigl[A(r)\rho (r)^{\alpha }+\rho (r)\bigr]=0. \end{aligned}$$
(3.7)

Thus in this setting (where \(\rho \) is predetermined) one can use (3.6) or (3.7) to compute \(\alpha (r)\) or \(A(r)\) by solving a first order differential equation. Alternatively, (3.6) and (3.7) can be converted to an equation for \(\rho \) by using (2.5). We can then choose a functional form for either \(\alpha (r)\) (and a constant value for \(A\) in (3.6)) or \(A(r)\) (and a constant value for \(\alpha \) in (3.7)) to determine \(\rho \) subject to proper boundary conditions. It follows then, under the tenets of General Relativity, that the density of a polytropic star cannot be assigned arbitrarily. The same follows from (3.5) when the functional form \(\alpha (r)\) and \(A(r)\) is predetermined.

Below we give several examples.

3.4 Equation for \({\rho }\) when \({A(r)}\) and \({\alpha (r)}\) are constant

Solving (3.7) algebraically for \(M(r)\) and substituting in (2.5), we obtain after some algebra a rather complicated equation for \(\rho (r)\) with \(A=A(r)\) and \(\alpha \) constant. Therefore we present only a special case of this equation in which both are constant.

With both \(\alpha (r)\) and \(A(r)\) constant, Eqs. (3.6) and (3.7) collapse to the following. For brevity, we suppress the dependence of \(M(r)\) and \(\rho (r)\) on \(r\):

$$\begin{aligned} &A\alpha r(2M-r)\frac{d\rho }{dr}-ABr^{3}\rho ^{2}\bigl(A\rho ^{\alpha -1}+1\bigr) \\ &\quad- M\rho \bigl(A+\rho ^{-\alpha +1}\bigr)=0. \end{aligned}$$
(3.8)

Algebraically isolating \(M\) and substituting in (2.5) we obtain the following equation for \(\rho \):

$$ A_{2}\frac{d^{2}\rho }{dr^{2}}+A_{12} \biggl(\frac{d\rho }{dr} \biggr) ^{2}+ A_{11} \frac{d\rho }{dr}+A_{0}=0 $$
(3.9)

where

$$\begin{aligned}& A_{2}=-A\alpha r^{2}\rho ^{\alpha } \bigl(2A^{2}Br^{2}\rho ^{2\alpha }+ 2ABr ^{2}\rho ^{\alpha +1}+A\rho ^{\alpha }+\rho \bigr), \\& A_{12}=Ar^{2}\alpha \rho ^{\alpha -1} \bigl(2A^{2}B\alpha r^{2}\rho ^{2\alpha }+ 2A^{2}Br^{2}\rho ^{2\alpha }\\& \phantom{A_{12}=}-4ABr^{2} \alpha \rho ^{\alpha +1}+ 4ABr^{2}\rho ^{\alpha +1}+2A\alpha \rho ^{\alpha } \\& \phantom{A_{12}=}+A\rho ^{\alpha }+(2- \alpha )\rho \bigr), \\& A_{11}=A\alpha r\rho ^{\alpha }\bigl(3A^{2}Br^{2} \rho ^{2\alpha }+ 6ABr^{2} \rho ^{\alpha +1}\\& \phantom{A_{12}=}+3Br^{2} \rho ^{2}-2A\rho ^{\alpha }-2\rho \bigr), \\& A_{0}=-Br^{2}\rho \bigl(\rho ^{3}+3A^{3} \rho ^{3\alpha }+7A^{2}\rho ^{2\alpha +1}+5A\rho ^{\alpha +2}\bigr). \end{aligned}$$

In particular, when \(\alpha =1\) and \(A\) is normalized to 1 (3.9) reduces to

$$\begin{aligned} &r\rho \bigl(2Br^{2}\rho +1\bigr) \frac{d^{2}\rho }{dr^{2}}- 2r\bigl(Br^{2}\rho +1\bigr) \biggl( \frac{d\rho }{dr} \biggr)^{2} \\ &\quad+ 2\rho \bigl(1-3Br^{2} \rho \bigr)\frac{d \rho }{dr}+8Br\rho ^{3}=0. \end{aligned}$$
(3.10)

This equation has an asymptotic solution for large \(r\) as \(\rho (r) \approx \frac{1}{r^{2}}\).

Similarly for \(A=1\) and \(\alpha =2\) we obtain the following equation for \(\rho (r)\)

$$\begin{aligned} &2r(\rho +1) \bigl(2Br^{2} \rho ^{2}+1\bigr)\frac{d^{2}\rho }{dr^{2}} \\ &\quad- 2r\bigl[2Br^{2} \rho (3\rho -2)+5\bigr] \biggl(\frac{d\rho }{dr} \biggr)^{2} \\ &\quad-2\bigl(\rho (r)+1\bigr)\bigl[3Br^{2}\rho (\rho +1)-2\bigr] \frac{d\rho }{dr} \\ &\quad+ Br\rho ( \rho +1)^{2}(3\rho +1)=0, \end{aligned}$$
(3.11)

for which an exact solution has not been found.

In Fig. 1 we present the numerical solutions of these two cases (\(\alpha =1\) and \(\alpha =2\), each with \(A=1\)) by the red and blue dashed lines, respectively. The boundary conditions on \(\rho \) are \(\rho (0.001)=1\) and \(\rho (0.995)=5\times 10^{-3}\). These boundary conditions are needed to avoid numerical singularities at 0 and 1.

Fig. 1
figure 1

\(\rho (r)\) for \(A=1\) with \(\alpha =1\) and \(\alpha =2\) (red and blue dashed lines) and for \(A=r\) with \(\alpha =1\) and \(\alpha =2\) (magenta and green solid lines)

Similarly, if we let \(A(r) = Dr\) where \(D\) is a constant, we can derive the numerical solution for \(\rho =\rho (r)\). This solution is shown by the magenta and green lines in Fig. 1 for the two cases \(\alpha = 1\) and 2, respectively.

Similarly if we let \(A(r)=Dr\) (where \(D\) is a constant) then for \(\alpha =1,2\) we obtain for \(\rho \) in Fig. 1 the solid magenta and green lines, respectively.

Thus we demonstrate that in the context of General Relativity the mass density distribution of a polytropic star with \(A=A(r)\) and constant \(\alpha \) cannot be assigned arbitrarily.

Using (3.6) and following the same steps described above we can obtain similar equations to the case where \(\alpha =\alpha (r)\) and \(A\) is constant.

4 Impact of perturbations

In this section we derive equations that assess the impact of small perturbations in the cumulative mass profile on the static cumulative mass distribution function \(M(r)\) of the star. To this end we consider the two models that were discussed in (3.6) and (3.7). We then apply these results to the models discussed in the previous section.

To implement this objective we introduce a perturbation to a star with initial cumulative mass distribution \(M_{0}\):

$$ M(r)=M_{0}(r)+\epsilon M_{1}(r). $$
(4.1)

Here the constant \(0 < \epsilon \ll 1\) is called the perturbation parameter. The mass configuration is considered to be stable if the perturbation mass function \(M_{1}(r)\) has initial value \(|M_{1}(0)| \ll 1\) and if \(|M_{1}(r)|\) remains bounded and \(M(r) \ge 0\). It will be considered unstable otherwise. To derive the equation that \(M_{1}\) satisfies we consider the two polytropic models separately.

4.1 The case \({p=A\rho ^{\alpha (r)}}\) with \({A}\) constant

To simplify the presentation we shall assume that \(A=1\) and \(B=1\). Substituting (4.1) in (3.5) and using (2.5) we obtain to first order in \(\epsilon \) the following differential equation for \(M_{1}(r)\):

$$\begin{aligned} &\bigl[-2Z S(2M_{0}-r)\alpha \bigr] \frac{d^{2}M_{1}}{dr^{2}} \\ &\quad+ \biggl\{ -2S Z(2M_{0}-r) \bigl(1+\ln (\rho ) \bigr) (\alpha +1) \\ &\quad- \biggl[2(2M_{0}-r) \biggl(\bigl(r^{2}\rho \bigr)^{-1+\alpha }S\frac{d(r^{2} \rho )}{dr^{2}}-2Z R \biggr) \biggr]\alpha ^{2} \\ &\quad+2R \bigl(r^{3} Z\rho +r\bigl(2\bigl(r^{2}\rho \bigr)^{2\alpha } R-2Z\bigr)+5Z M_{0} \bigr) \alpha \\ &\quad+2R\bigl(r^{3} Z\rho +R r\bigl(r^{2}\rho \bigr)^{2\alpha }+Z M_{0}+r\bigl(r^{2}\rho \bigr)^{ \alpha +1}\bigr) \\ &\quad+ 4r^{2}M_{0}\rho \biggr\} \frac{dM_{1}}{dr} \biggl[\biggl(-4Z S\frac{d(r^{2}\rho )}{dr}+8W r^{2-2\alpha }\biggr)\alpha \\ &\quad- 4S W \ln (\rho )\frac{d\alpha }{dr}+2W r^{2-2\alpha }+2r^{4}\rho ^{2} \biggr]M _{1}=0 \end{aligned}$$
(4.2)

where

$$\begin{aligned}& R=r^{2-2\alpha }, \qquad S=r^{3-2\alpha },\qquad W= \biggl( \frac{dM_{0}}{dr} \biggr)^{\alpha +1}, \\& Z= \biggl( \frac{dM_{0}}{dr} \biggr)^{\alpha }. \end{aligned}$$

4.2 The case \({p=A(r)\rho ^{\alpha }}\) with \({\alpha }\) constant

For simplicity we treat here only the case \(\alpha =1\). Following the same steps as in the previous subsection we obtain

$$\begin{aligned} &-Ar\rho (2M_{0}-r)\frac{d^{2}M_{1}}{dr^{2}} \\ &\quad+ \biggl[r(r-2M_{0}) \biggl(2\rho \frac{dA}{dr}+A \frac{d\rho }{dr}\biggr)+3\rho ^{2} Ar^{3} \bigl(A(r)+1\bigr) \\ &\quad+ 2\rho A(3M_{0}-r)+2\rho M_{0} \biggr]\frac{dM _{1}}{dr} \\ &\quad+r^{2}\rho \biggl[\biggl(-2r\frac{d\rho }{dr}+\rho \biggr)A-2r\rho \frac{dA}{dr}+ \rho \biggr]M_{1}=0 \end{aligned}$$
(4.3)

where \(\rho \) is the density which corresponds to \(M_{0}\).

5 Polytropic gas spheres and their stability

In the present section we solve (2.5) through (2.8) for polytropic gas spheres. We present four solutions. The first is an analytic solution of these equations while the others utilize numerical computations. We consider the stability of these solutions. The stability of the solution is calculated using (4.3).

5.1 Polytropic sphere with analytic solution

For the present case we start by choosing a functional form for the density \(\rho (r)\) and then solve (2.5) for \(M(r)\). Equation (2.6) becomes an algebraic equation for \(\lambda (r)\) while (2.7) is a differential equation for \(\nu (r)\). Substituting this result in (3.2), one can compute the isentropy coefficient \(A(r)\) (or isentropy index \(\alpha (r)\)).

The following illustrates this procedure and leads to an analytic solution for the metric coefficients.

Consider a sphere of radius \(R\) (where \(0 < R \le \sqrt{2}\)) with the density function

$$ \rho (r)= \frac{1}{4}\frac{R^{2}-r^{2}}{Br^{2}} $$
(5.1)

where \(B\) is the constant in (2.5). Using (2.5) with the initial condition \(m(0)=0\) we then have for \(0 \le r \le R\)

$$ M(r)=\frac{R^{2}r}{4}-\frac{1}{12}r^{3}. $$
(5.2)

Observe that although \(\rho (r)\) is singular at \(r=0\) the total mass of the sphere is finite. Furthermore, although the density \(\rho (r)\) is infinite at \(r = 0\), this singularity is easily removed by introducing a lower bound \(0 < r_{0} \ll 1\) for the domain of the function.

Using (2.6) yields

$$ \lambda (r)=-\ln \biggl(1-\frac{R^{2}}{2}+ \frac{r^{2}}{6} \biggr). $$
(5.3)

Substituting (5.2) into (2.12) we obtain a general solution for \(\nu (r)\) which is valid for \(R\ne 1\) and \(R\ne \sqrt{2}\).

$$ \nu =2\ln \bigl(C_{1}rF(r)^{\omega }+C_{2}rF(r)^{-\omega } \bigr) $$
(5.4)

where

$$\begin{aligned}& F(r)=\frac{6-3R^{2}+\sqrt{6-3R^{2}}\sqrt{6-3R^{2}+r^{2}}}{r}, \\& \omega =\sqrt{\frac{2(R^{2}-1)}{R^{2}-2}}. \end{aligned}$$

For \(R=1\) the solution is

$$ \nu =2\ln \biggl[r \biggl(D_{1} +D_{2} \operatorname{arctanh}\sqrt{ \frac{3}{3+r^{2}}} \biggr) \biggr]. $$
(5.5)

At \(r=0\) we have \(\nu (0)=-\infty \) and the metric is singular at this point. This reflects the fact that the density function (5.1) has a singularity at \(r=0\) (but the total mass of the sphere is finite). We observe that this singularity in \(\rho \) at \(r=0\) does not correspond to any of those classified by Arnold et al. (1982). This is due to the fact that none of the solutions presented in Arnold et al. (1982) has a periodic structure.

To determine the constants \(D_{1}\) and \(D_{2}\) we use the fact that at \(R=1\) the value of \(\nu \) should match the classic Schwarzschild exterior solution

$$ e^{\nu (R)}=1-\frac{2M}{R} $$

and the pressure (see (2.8)) is zero. These conditions lead to the following equations:

$$\begin{aligned}& \biggl(D_{1}+D_{2}\operatorname{arctanh} \frac{\sqrt{3}}{2} \biggr)^{2}-\frac{2}{3}=0 \end{aligned}$$
(5.6)
$$\begin{aligned}& 3D_{1}+3D_{2}\operatorname{arctanh} \frac{\sqrt{3}}{2}-2\sqrt{3}D_{2}=0. \end{aligned}$$
(5.7)

The solution of these equations is

$$ D_{1}=-\frac{\sqrt{2}}{6} \biggl( 3\operatorname{arctanh}\frac{\sqrt{3}}{2}-2 \sqrt{3} \biggr), \qquad D_{2}=\frac{\sqrt{2}}{2}. $$

Using (2.8) we obtain the following expression for the pressure

$$ p=\frac{1}{C} \biggl\{ \frac{D_{2}\sqrt{3(3+r^{2})}}{3r^{2} (D _{1} +D_{2} \operatorname{arctanh}\sqrt{\frac{3}{3+r^{2}}} )}- \frac{1}{2} \biggl(\frac{1}{r^{2}}+1 \biggr) \biggr\} . $$

Assuming that \(p(r)=A(r)\rho (r)\) we depict \(A(r)\) for this solution in Fig. 2.

Fig. 2
figure 2

A(r) for the mass distribution (5.2)

Note that trying to model this result by a relationship of the form \(p(r)=A\rho ^{\alpha (r)}\) leads to discontinuities in the values of \(\alpha (r)\). For \(R=\sqrt{2}\) the differential equation for \(\nu \) is

$$ 2\frac{d^{2}\nu }{dr^{2}}+ \biggl(\frac{d\nu }{dr} \biggr)^{2}+\frac{24}{r ^{4}}=0. $$
(5.8)

The solution of this equation is

$$ \nu =-\ln (24)+2\ln \biggl[r \biggl(E_{1}\sin \frac{\sqrt{6}}{r}+E _{2}\cos \frac{\sqrt{6}}{r} \biggr) \biggr] $$
(5.9)

and applying the boundary conditions on \(\nu \) and the pressure at \(r=\sqrt{2}\) we find that

$$ E_{1}=2\sin (\sqrt{3}), \qquad E_{2}=2\cos (\sqrt{3}). $$

If we assume that the relationship between the pressure and the density is of the form \(p=A\rho ^{\alpha (r)}\) then \(\alpha (r)\) exhibits several local sharp peaks in the range \(0 < r <\sqrt{2}\) but is almost zero otherwise.

The plot for a perturbation \(M_{1}(r)\) from the initial mass distribution \(M_{0}(r)\) in (5.2) is presented in Fig. 3. This figure demonstrates that (using Eq. (4.3)) the mass distribution is stable to perturbations whose initial size \(M_{1}(0)\) is of order \(10^{-3}\).

Fig. 3
figure 3

\(M_{1}(r)\) for \(M(r)\) in Eq. (5.2)

5.2 Spheres with oscillatory density functions

Here we discuss several examples of spheres with oscillatory density functions and determine the appropriate polytropic index (or coefficient) that describes these spheres. We probe also for the stability of these mass configurations to small perturbations.

5.2.1 Infinite sphere with exponentially decreasing density

Let

$$ \rho (r)=e^{-r} (D+\cos r) , \quad 0\le r \le \infty $$
(5.10)

where \(D=1.1\). The deviation of \(D\) from 1 is needed to avoid \(\rho =0\) in (3.6)–(3.7). Otherwise these equations become singular when \(\rho =0\).

It follows from (2.6) (with \(m(0)=0\)) that

$$\begin{aligned} M(r) =&B \biggl\{ \biggl(2D-\frac{1}{2} \biggr)- \frac{e^{-r}}{2} \bigl[\bigl(r ^{2}-1\bigr)\cos (r) \\ &{}-(r+1)^{2}\sin (r)+2D\bigl((r+1)^{2}+1\bigr) \bigr] \biggr\} \end{aligned}$$
(5.11)

Observe that although the sphere is assumed to be of infinite radius the mass density approaches zero exponentially as \(r\rightarrow \infty \) and the total mass of the sphere is finite. Furthermore, although the analytical expression for \(\rho \) is singular at \(r = 0\), one can avoid this physical singularity by introducing a lower bound radius \(0 < r_{0} \ll 1\) for the domain of the function \(\rho (r)\) with no physical impact on the solution.

Substituting these expressions in (3.6) with \(A=B=1\) and \(D=1.1 \) and solving for \(\alpha (r)\) we obtain Fig. 4. The strong decline in \(\alpha (r)\) for \(r > 0.5\) is due to the exponential decrease of \(\rho (r)\) with increasing \(r\). If we substitute \(B=1\), \(\alpha =1\) and \(D=1.1\) in (3.7) we obtain Fig. 5 where \(A(r)\) has a steep negative gradient as \(\rho (r)\rightarrow 0\).

Fig. 4
figure 4

Solution of (3.6) for \(\alpha (r)\) with \(\rho \) in (5.10)

Fig. 5
figure 5

Solution of (3.7) for \(A(r)\) with \(\rho \) in (5.10)

The plot for a perturbation \(M_{1}(r)\) from \(M_{0}(r)\) that is given by (5.11) is presented in Fig. 6 (using Eq. (4.3)). It shows that the mass distribution remains stable to perturbations whose initial size \(M_{1}(0)\) is of order \(10^{-5}\).

Fig. 6
figure 6

\(M_{1}(r)\) for \(M(r)\) in Eq. (5.11)

5.2.2 Finite sphere with radial mass density having ring-like structure

We consider a sphere of radius \(\pi \) with density function

$$ \rho =\frac{\sin ^{2}(kr)}{k^{2}r^{2}}. $$
(5.12)

From (2.5) with \(M(0)=0\) we then have

$$ M(r)=\frac{B[2kr-\sin (2kr)]}{4k^{3}} $$
(5.13)

where the total mass \(M\) of the sphere is \(\frac{B\pi }{2k^{2}}\).

Figure 7 depicts the solution of (3.6) for \(\alpha (r)\) with \(A=1\), \(B=1\) and \(k=4\). This figure exhibits a steep downward slope in the value of \(\alpha (r)\) beyond \(r=0.8\). This is due to the density falling to 0 at \(r=\frac{\pi }{4}\). Figure 8 displays the solution of (3.7) for \(A(r)\) with \(\alpha =1\) and the same values for \(B\) and \(k\). The sharp peaks in the values of \(A(r)\) in this figure are a result of the oscillations in the mass density function \(\rho (r)\).

Fig. 7
figure 7

Solution of (3.6) for \(\alpha (r)\) with \(\rho \) in (5.12)

Fig. 8
figure 8

Solution of (3.7) for \(A(r)\) with \(\rho \) in (5.12)

The plot for a perturbation \(M_{1}(r)\) from \(M_{0}(r)\) given by (5.13) is presented in Fig. 9 (using the model defined by Eq. (4.3)). It shows that the mass distribution remains stable to perturbations whose initial size \(M_{1}(0)\) is of order \(10^{-5}\).

Fig. 9
figure 9

\(M_{1}(r)\) for \(M(r)\) in Eq. (5.13)

6 Conclusions

In this paper we considered the steady states of a spherically symmetric protostar or interstellar gas cloud where general relativistic considerations are taken into account. In addition we considered the pressure and density, but not the temperature, of the gas to be related polytropically, thereby removing the (implicit or explicit) assumption that it is isothermal. Two polytropic models for the gas were considered, the first in the form \(p=A\rho (r)^{\alpha (r)}\) and the second in the form \(p=A(r)\rho (r)^{\alpha }\). Under these assumptions we were able to derive a single equation for the distribution of mass in the interior of the sphere as a function of the radius \(r\), and from whose solution the corresponding metric coefficients can be computed in straightforward fashion. Using the TOV equation we derived equations for \(\alpha (r)\) and \(A(r)\). We proved that when either \(\alpha \) or \(A\) are constants the mass density of the sphere cannot be chosen arbitrarily. We derived also an equation for stability of these configurations to perturbations in mass density.

Using several idealized models for the density within primordial gas clouds we were able to compute the appropriate polytropic coefficient and index and thus gain new insights about their thermodynamic structure. In particular we showed that the mass distribution of a gas cloud with a ring-like radial density distribution can be stable to perturbations. The evolution of such ring-like structures in time (within the framework of General Relativity) will be investigated in a subsequent paper.

We conclude then that General Relativity can provide new and deeper insights about the actual structure of stars and primordial gas clouds and the emergence of ring-like density patterns within these objects.

To our best knowledge these solutions represent a new and different class of interior solutions to the Einstein equations which have not previously been explored in the literature.