1 Introduction

Classical general relativity (GR) is a very elegant theory which is, roughly speaking, described by the Einstein field equations. They show the relation between the geometry of spacetime and the matter (fields) contribution. Many astronomical observations have tested and confirmed GR predictions both at solar system level and using binary pulsars; we have the recent positive detection of gravitational waves as well. Therefore, one deals with convincing indications that the GR is the theory responsible for describing the gravitational interaction. However, it seems that building a successful model for the dynamics of the universe using GR and known matter fields as the source of Einstein equations is not enough to describe many issues that recently appeared in fundamental physics, astrophysics, and cosmology. There is compelling evidence from recent observations leading to the so-called dark energy phenomena [1, 2], i.e., a late-time cosmic acceleration (which one explains by adding an exotic fluid called dark energy) as well as the dark matter puzzle [3, 4]. Also, an important ingredient of the concordance model is an inflationary phase in the early universe [5, 6] supposedly driven by an inflaton field. The common point here is that unknown components should be added to the energy-momentum tensor when GR is adopted. While the direct confirmation as regards the existence of such extra fields is missing, one alternative relies in assuming that GR is not the actual gravitational theory acting on large scales but is only recovered locally via screening mechanisms [7] (although there is evidence that screening solutions can eventually fail inside screened regions [8] and astrophysical objects [9]). Then the observations leading to the dark energy/matter phenomena would result from some non-trivial prediction of new gravitational theories. Hence, the search for new approaches to the gravitational interaction has become a fruitful investigation route.

There are also problematic issues concerning astrophysical objects like for instance neutron stars. Their structure and the relation between the mass and the radius are determined by the equations of state (EoS) of dense matter. The maximal mass value of such objects is still an open question but recent observations estimate this limit to be 2M\(_\odot \). For example, the pulsar in the system PSR \(\mathrm{J}0348+0432\) has the limit \(2.01\mathrm{M}\odot \) [10], other massive neutron stars are Vela X-1 with the mass \({\sim }1.8\mathrm{M} _\odot \) [11] and (\(\mathrm{B}1957+20\)) with a mass \({\sim }2.4 {M}_\odot \) [12]. A compilation with recent neutron stars mass determinations can be found in [13]. It should also be mentioned that some EoS include hyperons, which makes the maximal mass limit for non-magnetic neutron stars significantly lower than 2M\(_\odot \) [14,15,16]. Therefore, very massive neutron stars challenge the viability of a hyperon-based EOS. There are a few ways to approach the “hyperon puzzle”, such as a hyperon–vector coupling, a chiral quark–meson coupling, and the existence of strong magnetic fields inside the star. Concerning the latter approach, for example, some work found a clear influence of the magnetic field increasing the mass of the star [17,18,19]. On the other hand, it seems that the existence of neutron stars—without strong magnetic fields—with masses larger than 2M\(_{\odot }\) is challenged within the framework of GR [20,21,22]. Also, it is worth noting that the usual formalism for the effects of density-dependent magnetic fields on the properties of neutron stars has been shown to be controversial [23].

As neutron stars are very peculiar objects for testing theories of matter at high density regimes, data as regards their macroscopic properties like mass and radius can also be used for studying potential deviations from GR. There exist suggestions [22, 24] that the use of GR, if adopted to describe strong gravitational fields, is only a phenomenological extrapolation, since the strength of gravity sourced by a neutron star is many orders of magnitude larger that the one probed by the solar system (weak field limit) tests. Also following this line of reasoning, for theoretical and experimental reasons one believes that GR should be modified when gravitational fields are strong and spacetime curvature is large [25]. Therefore, a promising route of investigation is firstly to set a specific model of dense matter, i.e., an equation of state, and then proceed computing macroscopic properties of neutron stars in a given ETG. Indeed, the predictions of alternative theories to GR concerning the structure of compact objects is currently an active research field [26,27,28,29,30,31,32].

In order to implement the strategy described at the end of the last paragraph the first step is to obtain the equilibrium configuration for the stellar objects. In GR, the simplest case of a static, spherically symmetric geometry gives rise to the well-known Tolmann–Oppenheimer–Volkoff (TOV) equation [33, 34]. Our goal in this work is twofold: (i) firstly, we introduce a TOV-like equation for a general class of ETG (as studied in [35,36,37]) which will be presented in Sect. 2. The generalized equilibrium equation for any ETG (the TOV-like equation) is then calculated. (ii) We also generalize the stability criterion for ETG in Sect. 3. A parametrized version of the TOV equation has been presented in Ref. [38]. We extend the analysis of the stability based on the thermodynamical properties of the system as presented in some textbooks. See for example [39]. As a case study we investigate the stability conditions for scalar–tensor gravity. We work in \(c=1\) units with the signature \((-+++)\) for the metric.

2 Extended theories of gravity and stellar equilibrium configurations

We term extended theories of gravity (ETG) any alternative to GR in which the field equations can be recast in the form [35,36,37].

$$\begin{aligned} \sigma (\Psi ^i)(G_{\mu \nu }-W_{\mu \nu })=\kappa T_{\mu \nu }, \end{aligned}$$
(1)

where \(G_{\mu \nu }=R_{\mu \nu }-\frac{1}{2}Rg_{\mu \nu }\) is the Einstein tensor, \(\kappa =-8\pi G\), the factor \(\sigma (\Psi ^i)\) is a coupling to the gravity while \(\Psi ^i\) represents for instance curvature invariants or other fields, like scalar ones. The symmetric tensor \(W_{\mu \nu }\) stands for additional geometrical terms which may appear in the specific ETG under consideration. It is important to note that (1) represents a parameterization of gravitational theories at the level of field equations. The energy-momentum tensor \(T_{\mu \nu }\) will be considered as the one of a perfect fluid, that is, \(T_{\mu \nu }=pg_{\mu \nu }+(p+\rho )u_\mu u_\nu \), where p and \(\rho \) are the pressure and the energy density of the fluid. The four velocity \(u^\mu \) of the co-moving (with the fluid) observer is normalized with the condition \(u^\mu u_\mu = -1\).

It is worth noting that (1) does not encompass all the possible alternatives to GR at the field equations level. However, most of the main proposals like, for instance, scalar tensor theories and f(R), can be reshaped in this form. As an example, for theories which have a time dependent effective gravitational coupling, \(\sigma \equiv \sigma (t)\) and \(W_{\mu \nu }=0\).

One may also add a coupling to the matter source (as it appears often in the so-called Einstein frame) but here we will not consider that case. From the structure of (1) one sees that GR is immediately recovered if \(\sigma (\Psi ^i)=1\) and \(W_{\mu \nu }=0\). The extended Einstein field equations (1) can also be written as

$$\begin{aligned} G_{\mu \nu }=\kappa T^{\mathrm{eff}}_{\mu \nu }=\frac{\kappa }{ \sigma } T_{\mu \nu }+W_{\mu \nu }. \end{aligned}$$
(2)

It is worth noting that one cannot postulate that the energy-momentum tensor of the matter \(T_{\mu \nu }\) is conserved. Rather, due to the Bianchi identity, the effective energy-momentum tensor \(T^{\mathrm{eff}}_{\mu \nu }\) is conserved i.e., \(\nabla _\mu T_{\mathrm{eff}}^{\mu \nu }=0\). In some special ETG cases [40] one deals with modifications of the conservation of the matter energy-momentum tensor.

2.1 TOV equations in ETGs

The simplest configuration for a star is the static and spherically symmetric geometry is given by the metric

$$\begin{aligned} \mathrm{d}s^2=-B(r)\mathrm{d}t^2+A(r)\mathrm{d}r^2+r^2\mathrm{d}\theta ^2+r^2\sin ^2{\theta } \mathrm{d}\phi ^2. \end{aligned}$$
(3)

From the normalization condition one has \(u_0=-\sqrt{B(r)}\). As the metric is time independent and spherically symmetric, the pressure p and energy density \(\rho \) are functions of the radial coordinate r only. Hence we will assume that the coupling function \(\sigma \) and the geometric contributions \(W_{\mu \nu }\) are also independent of the coordinates \((t,\theta ,\phi )\).

We calculate in detail the components of (2). The components of the Ricci tensor read

$$\begin{aligned} R_{tt}&=-\frac{B''}{2A}+\frac{B'}{4A}\left( \frac{A'}{B}+\frac{B'}{B} \right) -\frac{B'}{rA} \end{aligned}$$
(4)
$$\begin{aligned}&=\frac{\kappa }{2\sigma }(\rho +3p)B+W_{tt}+\frac{BW}{2}, \end{aligned}$$
(5)
$$\begin{aligned} R_{rr}&=\frac{B''}{2A}-\frac{B'}{4B}\left( \frac{A'}{B}+\frac{B'}{B} \right) -\frac{A'}{rA} \end{aligned}$$
(6)
$$\begin{aligned}&=\frac{\kappa }{2\sigma }(p-\rho )A+W_{rr}-\frac{AW}{2}, \end{aligned}$$
(7)
$$\begin{aligned} R_{\theta \theta }&=-1+\frac{r}{2A}\left( -\frac{A'}{B}+\frac{B'}{B}\right) +\frac{1}{A} \end{aligned}$$
(8)
$$\begin{aligned}&=\frac{\kappa }{2\sigma }(p-\rho )r^2+W_{\theta \theta }-\frac{r^2W}{2}, \end{aligned}$$
(9)

where \(W=-B^{-1}W_{tt}+A^{-1}W_{rr}+2r^{-2}W_{\theta \theta }\) is the trace of the tensor \(W_{\mu \nu }\). The prime symbol \((^{\prime })\) denotes the derivative with respect to r. Using the above equations to write

$$\begin{aligned} \frac{R_{rr}}{2A}+\frac{R_{00}}{2B}+\frac{R_{\theta \theta }}{r^2}= & {} -\frac{A'}{rA^2}-\frac{1}{r^2}+\frac{1}{Ar^2}\nonumber \\= & {} \frac{\kappa \rho }{\sigma }+r^2B^{-1}W_{tt} \end{aligned}$$
(10)

we obtain the following relation:

$$\begin{aligned} \left( \frac{r}{A} \right) '=1+\kappa r^2\frac{\rho (r)}{\sigma (r)}+r^2B^{-1}(r)W_{tt}(r). \end{aligned}$$
(11)

Then we may solve Eq. (11) and write the solution in the very familiar form

$$\begin{aligned} A(r)=\left( 1-\frac{2G \mathcal {M}(r)}{r} \right) ^{-1}, \end{aligned}$$
(12)

where the mass function \(\mathcal {M}(r)\) is defined here as

$$\begin{aligned} \mathcal {M}(r)=\int ^r_0\left( 4\pi \tilde{r}^2\frac{\rho (\tilde{r})}{\sigma (\tilde{r})}-\frac{\tilde{r}^2W_{tt}(\tilde{r})}{2GB(\tilde{r})} \right) \mathrm{d}\tilde{r}. \end{aligned}$$
(13)

This solution is clearly different from the usual definition given by GR in which \(\mathcal {M}(R)\) (R is the radius of the star) is interpreted as the physical mass of the central object. Here, this expression should be interpreted as the mass function of the coupled TOV-like system. Geometric quantities also enter here. This expression is different from the actual physical mass, the one inferred from binary pulsar observations, for instance, and used to plot the usual mass–radius diagram.

The complete derivation also needs the relations

$$\begin{aligned} \frac{A'}{A}&=\frac{1-A}{r}-\frac{\kappa Ar}{\sigma }Q,\end{aligned}$$
(14)
$$\begin{aligned} \frac{B'}{B}&=\frac{A-1}{r}-\frac{\kappa Ar}{\sigma }\Pi , \end{aligned}$$
(15)

where we have defined the new quantities

$$\begin{aligned} Q(r)&:=\rho (r)+\frac{\sigma (r)W_{tt}(r)}{\kappa B(r)},\end{aligned}$$
(16)
$$\begin{aligned} \Pi (r)&:=p(r)+\frac{\sigma (r)W_{rr}(r)}{\kappa A(r)}. \end{aligned}$$
(17)

In GR the functions Q and \(\Pi \) would be interpreted as the energy density and pressure, respectively.

The conservation of the effective energy-momentum tensor is another useful relation. The hydrostatic equilibrium \(\nabla _\mu T^{\mu \nu }_{\mathrm{eff}}=0\) then reads

$$\begin{aligned} \kappa (\sigma ^{-1}\nabla _\mu T^{\mu \nu }-\sigma ^{-2}T^{\mu \nu }\nabla _\mu \sigma )+\nabla _\mu W^{\mu \nu }=0, \end{aligned}$$
(18)

or, more explicitly,

$$\begin{aligned}&\kappa \sigma ^{-1}\left( p'+(p+\rho )\frac{B'}{2B}\right) -\kappa p\frac{\sigma '}{\sigma ^2}-\frac{A'}{A^2}W_{rr}+A^{-1}W'_{rr}\nonumber \\&\quad +\;\frac{2W_{rr}}{Ar}+ \frac{B'}{2B}\left( \frac{W_{rr}}{A}+\frac{W_{tt}}{B}\right) -\frac{2W_{\theta \theta }}{r^2}=0. \end{aligned}$$
(19)

Let us notice that from (17) and with the help of (14)

$$\begin{aligned} \left( \frac{\Pi }{\sigma }\right) '=\frac{p'}{\sigma }-\frac{p\sigma '}{\sigma ^2}+\frac{W'_{rr}}{\kappa A}-\frac{W_{rr}(1-A)}{\kappa rA}+\frac{rW_{rr}Q}{\sigma }.\nonumber \\ \end{aligned}$$
(20)

This equation is the basic structure for deriving the generalized hydrostatic equilibrium for stars in ETG. Together with (15) and definition (16), Eq. (20) can be written as

$$\begin{aligned} \left( \frac{\Pi }{\sigma }\right) '= & {} -\frac{Gm}{r^2}\left( \frac{Q}{\sigma }+\frac{\Pi }{\sigma }\right) \left( 1+\frac{4\pi r^3\frac{\Pi }{\sigma }}{\mathcal {M}}\right) \nonumber \\&\times \left( 1-\frac{2G\mathcal {M}}{r}\right) ^{-1} +\frac{2\sigma }{\kappa r}\left( \frac{W_{\theta \theta }}{r^2}-\frac{W_{rr}}{A}\right) . \end{aligned}$$
(21)

Equation (21) and

$$\begin{aligned} \mathcal {M}(r)= \int ^r_0 4\pi \tilde{r}^2\frac{Q(\tilde{r})}{\sigma (\tilde{r})} \mathrm{d}\tilde{r} \end{aligned}$$
(22)

have a similar functional form to the standard GR result. But one remarkable difference is the existence of the geometrical contribution in the last term of (21). The set of equations (21) and (22) represent a useful tool for studying stellar configurations once a certain ETG is specified.

It is worth noting that such equations determine completely the stellar equilibrium since the assumption that the pressure is expressed as a function of the density only, i.e., the entropy per nucleon and the chemical composition as constant throughout the star. Such assumptions will also be used in the analysis of the stability of these systems.

It should be noticed that since the tensor \(W_{\mu \nu }\) can include some extra fields like scalar ones for example, besides the generalized Einstein’s field equations (1), one will inevitably deal with equations of motion for the additional fields which should be taken into account. This means that Eqs. (21) and (22) are general up to the definition of the specific theory. After that stage, these equations can be further simplified with the help of the new equations of motion of the specified theory. In order to exemplify such an issue, in the next section we will consider scalar–tensor gravity where the modified Klein–Gordon equation for the scalar field is taken into account.

3 Stability conditions

In order to obtain specific predictions on the stability of static and spherically symmetric systems within the general form like (1) one has to provide the \(W_{\mu \nu }\) and \(\sigma (\Psi ^i)\) terms. In this section, as a case study, we calculate the stability criterion for the k-essence class of theories.

3.1 Extended stability conditions applied to scalar–tensor gravity

In scalar–tensor theories the gravitational interaction is mediated not only by the metric field (as in GR), but also for a scalar field \(\phi \). Among many realizations of scalar–tensor theories, a simple prototype is the quintessence class in which the scalar field is said to be minimally coupled to the geometrical sector.

The theory can be written according to the following action:

$$\begin{aligned} S= & {} \frac{1}{2\kappa }\int d^4x\sqrt{-g}(R-\nabla _\mu \phi \nabla ^\mu \phi -2V(\phi ))\nonumber \\&+S_m[g_{\mu \nu },\psi ]. \end{aligned}$$
(23)

The field equations derived from the above action are

$$\begin{aligned}&G_{\mu \nu }+\frac{1}{2}g_{\mu \nu }\nabla _\alpha \phi \nabla ^\alpha \phi -\nabla _\mu \phi \nabla _\nu \phi +g_{\mu \nu }V(\phi )=\kappa T_{\mu \nu }, \nonumber \\\end{aligned}$$
(24)
$$\begin{aligned}&V'(\phi )-\Box \phi =0. \end{aligned}$$
(25)

Since we are working in a curved spacetime the scalar field \(\phi \) depends on the matter contribution (\(\rho \)) via the d’Alembertian (\(\Box \)) operator present in the modified Klein–Gordon equation above.

Comparing (24) with (1) one notices that in the k-essence case we identify \(\sigma =1\) and

$$\begin{aligned} W_{\mu \nu }=-\frac{1}{2}g_{\mu \nu }\nabla _\alpha \phi \nabla ^\alpha \phi +\nabla _\mu \phi \nabla _\nu \phi -g_{\mu \nu }V(\phi ). \end{aligned}$$
(26)

From the above definition of \(W_{\mu \nu }\) we can write the following components:

$$\begin{aligned} W_{tt}&=\frac{1}{2}B \nabla _\alpha \phi \nabla ^\alpha \phi +BV(\phi )=B(C+2V), \end{aligned}$$
(27)
$$\begin{aligned} W_{rr}&=AC, \end{aligned}$$
(28)
$$\begin{aligned} W_{\theta \theta }&=-r^2 (C+2V). \end{aligned}$$
(29)

In the above expressions we have defined \(V\equiv V(\phi )\) and

$$\begin{aligned} C\equiv C(Q, \phi ,\phi ')=\frac{1}{2}A^{-1}\phi '^2-V. \end{aligned}$$
(30)

Let us recall that A is a function of Q. Hence, the last term in the generalized TOV Eq. (21) is \(-\frac{4\sigma }{\kappa r}(C+V)=-2\sigma \frac{\phi '^2}{\kappa Ar}\). Moreover, in the k-essence case, the functions Q and \(\Pi \) will assume the form

$$\begin{aligned} Q_k&=\rho (r)+\kappa ^{-1}(C+2V), \end{aligned}$$
(31)
$$\begin{aligned} \Pi _k&=p(r)+\kappa ^{-1}C. \end{aligned}$$
(32)

Let us calculate in detail the stability analysis. We assume that the particle number \(N^\alpha =n u^\alpha \) is conserved,

$$\begin{aligned} \nabla _\alpha (n u^\alpha )=u^\alpha \nabla _\alpha n + n\nabla _\alpha u^\alpha =0. \end{aligned}$$
(33)

The crucial issue here is that we are dealing with the effective energy-momentum tensor (from the Bianchi identities \(\nabla _\mu G^{\mu \nu }=0\)), therefore

$$\begin{aligned} u_\nu \nabla _\mu T^{\mu \nu }_{\mathrm{eff}}= & {} \sigma ^{-1} \left( u^\mu \nabla _\mu p-n u^\mu \nabla _{\mu }\left( \frac{p+\rho }{n}\right) +\rho u^\mu \nabla _\mu \sigma \right) \nonumber \\&+\;u_\nu \nabla _\mu W^{\mu \nu } \end{aligned}$$
(34)

and

$$\begin{aligned} u^\mu \left( \frac{\sigma }{\kappa } W^\nu _{\;\mu ;\nu } -n p\nabla _\mu \left( \frac{1}{n}\right) -n\nabla _\mu \left( \frac{\rho }{n}\right) +\frac{\rho }{\sigma }\nabla _\mu \sigma \right) =0.\nonumber \\ \end{aligned}$$
(35)

Since we are working with the modified field of Eq. (24), the coupling term \(\nabla _\mu \sigma \) in the above formula vanishes. Keeping in mind that the tensor \(W_{\mu \nu }\) does not depend on the energy density, the only non-vanishing terms that undergo infinitesimal changes with respect to the infinitesimal changes of the energy density are

$$\begin{aligned} \delta \left( \frac{\rho }{n} \right) +p\delta \left( \frac{1}{n} \right) =0, \end{aligned}$$
(36)

and consequently

$$\begin{aligned} \delta n(r) =\frac{n(r)}{p(r)+\rho (r)}\delta \rho (r). \end{aligned}$$
(37)

Notice that the second law of thermodynamics will differ in ETGs [42] but the above general relation remains valid in our treatment. This expression will be our starting point but before doing that we should investigate in detail the dependence of the variation \(\delta \rho \) with respect to other quantities. It is important to notice the particular form of the effective energy-momentum tensor (24) in the ETG that we are considering here. As \(W_{\mu \nu }\) is symmetric and one also deals with the modified K-G equation, we have

$$\begin{aligned} \nabla ^\mu W_{\mu \nu }=\nabla ^\mu \phi (\nabla _\mu \nabla _\nu \phi -\nabla _\nu \nabla _\mu \phi )=0 \end{aligned}$$
(38)

where we have used the K-G equation \(\Box \phi =V'\). One may also compute it explicitly for the component \(\mu =r\),

$$\begin{aligned} \nabla _\nu W^\nu _{\;r}=C'+(C+V)(\frac{A-1}{r}-\kappa Ar\Pi +\frac{4}{r}):=C'+D.\nonumber \\ \end{aligned}$$
(39)

Applying the Klein–Gordon equation to the derivative \(C'=\frac{dC(\phi ,\phi ')}{\mathrm{d}r}\) gives rise to the expression \(C'=-(C+V)(\frac{A-1}{r}-\kappa Ar\Pi +\frac{4}{r})=-D\), which will be useful later. Therefore, the component \(\mu =r\) of Eq. (35) resembles the GR form

$$\begin{aligned} n'(r)=n\frac{\rho '}{\rho +p}. \end{aligned}$$
(40)

Now on, we are going to use the Lagrange multiplier method following the procedure presented, for example, in Ref. [39]. The nucleon number

$$\begin{aligned} N=\int ^R_0 4\pi r^2 [1-2G\mathcal {M}(r)/r]^{-1/2}n(r)\mathrm{d}r \end{aligned}$$
(41)

remains unchanged but we should remember that it also depends on the modified geometry (see Eq. (12) and below). Then we find

$$\begin{aligned} 0= & {} \delta \mathcal {M}-\lambda \delta N=\int _0^\infty 4\pi r^2 \delta Q \mathrm{d}r \nonumber \\&-\;\lambda \int _0^\infty 4\pi r^2\left( 1-\frac{2G\mathcal {M}(r)}{r}\right) ^{-\frac{1}{2}}\delta n(r)\mathrm{d}r\nonumber \\&-\;\lambda G\int _0^\infty 4\pi r\left( 1-\frac{2G\mathcal {M}(r)}{r}\right) ^{-\frac{3}{2}}n(r)\delta \mathcal {M}(r)\mathrm{d}r.\nonumber \\ \end{aligned}$$
(42)

In the above expression one has to identify explicitly the terms \(\delta Q_{\kappa }\) and \(\delta n(r)\) since they depend on the variations of geometrical quantities as well as \(\delta \rho (r)\). Therefore, the variation of each term e.g., \(\delta n \equiv \delta n (\delta Q_k, \delta C)\) should be written in detail.

From (31) one realizes that the variation \(\delta \rho (r)\) can be expressed as

$$\begin{aligned} \delta \rho =\delta Q_{k} -\kappa ^{-1}(\delta C + 2 V' \delta \phi ), \end{aligned}$$
(43)

where \(\delta C\) is a function of \(\delta Q_k\), \(\delta \phi \), and \(\delta \nabla ^\mu \phi \). Our goal is to show that the equilibrium is stable with respect to radial oscillations if \(\mathcal {M}\) is a minimum with respect to all possible variations.

In astrophysical applications, temporal variations of the scalar field can be neglected. Then, since the scalar field is a function of the radial coordinate only, i.e., \(\phi \equiv \phi (r)\), we may write \(\phi '=\partial _\mu \phi =\nabla _\mu \phi \). From (30) the term \(\delta C\) is written as

$$\begin{aligned} \delta C=-\frac{G}{r}\phi '^2\int ^R_0 (4\pi r^2 \delta Q_k \mathrm{d}r)+\nabla _\mu \phi \delta \nabla ^\mu \phi -\Box \phi \delta \phi ,\nonumber \\ \end{aligned}$$
(44)

where we have used the K-G equation \(\Box \phi =V'\). Therefore, the full expression for the variation of the energy density becomes

$$\begin{aligned} \delta \rho= & {} \delta Q_{k} -\kappa ^{-1}\nonumber \\&\times \left( -\frac{G}{r}\phi '^2\int ^R_0 (4\pi r^2 \delta Q_{k} \mathrm{d}r)+\nabla _\mu (\delta \phi \nabla ^\mu \phi )\right) .\nonumber \\ \end{aligned}$$
(45)

This quantity indicates how the thermodynamical relation (37) is modified in the presence of the scalar field \(\phi \). Moreover, we identify the quantity \(\delta \mathcal {M}(r)\) which appears in (42) as \(\delta \mathcal {M}(r')=\int _0^\infty 4\pi r'^2 \delta Q_{k} \mathrm{d}r'\). Applying such relations to Eq. (42) it is worth noting that such an equation becomes

$$\begin{aligned} 0&=\delta \mathcal {M}-\lambda \delta N=\int _0^\infty 4\pi r^2 \delta Q_k \mathrm{d}r\nonumber \\&\quad -\;\lambda G\int _0^\infty 4\pi rA^{\frac{3}{2}}n(r)\int _0^\infty (4\pi \tilde{r}^2 \delta Q_k \mathrm{d}\tilde{r})\mathrm{d}r\nonumber \\&\quad -\;\lambda \int _0^\infty 4\pi r^2A^{\frac{1}{2}} \frac{n(r)}{p(r)+\rho (r)}\nonumber \\&\quad \times \left( \delta Q_k -\kappa ^{-1}\left( -\frac{G}{r}\phi '^2\int ^R_0 (4\pi \tilde{r}^2 \delta Q_k \mathrm{d}\tilde{r})\right. \right. \nonumber \\&\quad \left. +\left. \nabla _\mu (\delta \phi \nabla ^\mu \phi )\right) \right) \mathrm{d}r. \end{aligned}$$
(46)

Our next step is to investigate carefully the terms appearing in the above expression. For example, one realizes that the last term appearing in (46),

$$\begin{aligned} \int _0^\infty 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)}\nabla _\mu (\delta \phi \nabla ^\mu \phi )\mathrm{d}r, \end{aligned}$$
(47)

is proportional to the integral of the term \(\nabla _\mu (\delta \phi \nabla ^\mu \phi )\). This term can be integrated by parts. Then, writing it explicitly after the integration one obtains the following terms:

$$\begin{aligned}&\int _0^\infty \nabla ^\mu \left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)} \delta \phi \nabla _\mu \phi \right) \mathrm{d}r\nonumber \\&\quad -\;\int _0^\infty \delta \phi \nabla ^\mu \phi \nabla _\mu \left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)} \right) \mathrm{d}r \nonumber \\&= \int _0^\infty \partial ^\mu \left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)} \delta \phi \partial _\mu \phi \right) \mathrm{d}r\nonumber \\&\quad +\;\int _0^\infty \left[ 4\pi r^2A^{\frac{1}{2}} \Gamma ^\mu _{\mu \nu } \frac{n(r)}{p(r)+\rho (r)} \right. \nonumber \\&\quad \left. -\;\partial _\nu \left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)}\right) \right] \delta \phi \partial ^\nu \phi \mathrm{d}r. \end{aligned}$$
(48)

It is important to realize that

$$\begin{aligned} \int _0^\infty \partial ^\mu \left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)} \delta \phi \partial _\mu \phi \right) \mathrm{d}r, \end{aligned}$$
(49)

which is present in Eq. (48), is a boundary term. We say in advance that our conclusion on the stability of stellar systems in such a particular k-essence theory crucially depends on this term. It vanishes since both upper and lower substitutions vanish. The former as both variations at the (finite) boundary vanish and the latter as the \(r^2\) factor takes it zero while other factors are supposedly finite. Therefore, we continue neglecting this term in our analysis although it should be given second thoughts if one wants to consider another theory of gravity rather than the minimally coupled scalar field model with the modified Klein–Gordon equation (24). The discussion above concerns only the minimal coupling case since a non-minimal coupling could also produce some non-trivial contribution to such a boundary term. The work on the non-minimal case is in progress.

Interchanging the r and \(\tilde{r}\) integrals will allow us to write

$$\begin{aligned} \delta \mathcal {M}-\lambda \delta N&=\int _0^\infty 4\pi r^2\left[ 1-\frac{\lambda n(r)}{p(r)+\rho (r)}A^{\frac{1}{2}}-\lambda G \right. \nonumber \\&\quad \left. \times \;\int _r^\infty 4\pi \tilde{r}n(\tilde{r})A^{\frac{3}{2}}\mathrm{d}\tilde{r}\right. \nonumber \\&\quad \left. -\;\lambda G\kappa ^{-1}\int ^\infty _r4\pi \tilde{r} A^{\frac{1}{2}}\frac{n}{p+\rho } \phi '^2 \mathrm{d}\tilde{r} \right] \delta Q(r)\mathrm{d}r\nonumber \\&\quad -\;\lambda \kappa ^{-1}\int _0^\infty \partial ^\nu \phi \left[ 4\pi r^2A^{\frac{1}{2}} \Gamma ^\mu _{\mu \nu } \frac{n(r)}{p(r)+\rho (r)}\right. \nonumber \\&\quad \left. -\;\partial _\nu \left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)}\right) \right] \delta \phi \mathrm{d}r=0. \end{aligned}$$
(50)

In order to ensure that the above equality holds one has to guarantee that all the integral terms vanish, that is, both terms containing variations must vanish independently. The term in the first line of (50) which is proportional to \(\delta Q\) will vanish if

$$\begin{aligned} \frac{1}{\lambda }&=\frac{n(r)}{p(r)+\rho (r)}A^{\frac{1}{2}}+ G\int _r^\infty 4\pi \tilde{r} n(\tilde{r})A^{\frac{3}{2}}\mathrm{d}\tilde{r}\nonumber \\&\quad +\;G\kappa ^{-1}\int ^\infty _r4\pi \tilde{r} A^{\frac{1}{2}}\frac{n(\tilde{r})}{p(\tilde{r})+\rho (\tilde{r})}\phi '^2 \mathrm{d}\tilde{r}, \end{aligned}$$
(51)

while the vanishing of the last term demands

$$\begin{aligned} 4\pi r^2A^{\frac{1}{2}} \Gamma ^\mu _{\mu r} \frac{n(r)}{p(r)+\rho (r)} =\partial _r\left( 4\pi r^2A^{\frac{1}{2}}\frac{n(r)}{p(r)+\rho (r)}\right) .\nonumber \\ \end{aligned}$$
(52)

Let us now concentrate on (51). Deriving it with respect to the radial coordinate r (where \(\lambda \) is constant) and using the fact that in our case \( n'(r)=n\frac{\rho '}{\rho +p}\) still holds, we find

$$\begin{aligned}&-4\pi GrA-\frac{p'}{(p+\rho )^2}+\frac{GA}{p+\rho }\left( 4\pi r Q -\frac{\mathcal {M}}{r^2}\right) \nonumber \\&\quad -\;\frac{4\pi r G}{\kappa }\frac{\phi '^2}{p+\rho }=0. \end{aligned}$$
(53)

Applying the following relations:

$$\begin{aligned} \frac{A-1}{r}&= \,A\frac{2GM}{r^2},\\ p+\rho&= \,\Pi _k+Q_k - 2\kappa ^{-1}(C+V),\\ A^{-1}\phi '^2&=\, 2(C+V), \end{aligned}$$

together with

$$\begin{aligned} \Pi '_k&=p'+\kappa ^{-1}C'\nonumber \\&=p'-\kappa ^{-1}(C+V)\left( \frac{A-1}{r}-\kappa Ar\Pi +\frac{4}{r}\right) , \end{aligned}$$
(54)

we are finally able to write

$$\begin{aligned} \Pi '=-\frac{AGM}{r^2}(\Pi +Q)\left( 1+4\pi r\frac{\Pi }{M}\right) -4\frac{C+V}{\kappa r}, \end{aligned}$$
(55)

which is exactly the TOV of Eq. (21) for the k-essence model.

We turn now our attention to Eq. (52). Writing the gamma term explicitly, \(\Gamma ^\mu _{\mu r}=\frac{2}{r}-\frac{1}{2}\left( \kappa Ar(\Pi +Q)\right) \), and using \( n'(r)=n\frac{\rho '}{\rho +p}\) and Eq. (54), we obtain again exactly (55), i.e., the TOV form.

Therefore, the system is stable since the boundary term (49) vanishes. If this would not be the case then we were not able to write down the stability equation in the TOV-like form as presented in Sect. 2.

4 Conclusions

In this work we have studied extended theories of gravity (ETG) based on the phenomenological field equation (1). Indeed, this class of theories are not derived via the standard variation principle from any known action, though this represents a general way to implement modifications of GR at the field equations level.

Our focus was on obtaining the stellar equilibrium equations for static, spherically symmetric geometries. In the general relativistic case this set of equations is known as the TOV equations. The main result of this work consists of the system of Eqs. (20) and (22) which is the analogous version of the TOV equations for any ETG. Such equations can now be further applied to specific gravitational theories. For the particular case shown in (21) the TOV structure is preserved only if one finds a suitable theory in which \(W_{\theta \theta }= W_{rr} r^2 / A\) and considering that we identify Q and \(\Pi \), as the effective density and effective pressure, respectively.

Concerning the stability of such systems, we argue that this analysis should be implemented case by case only, i.e., it is difficult to achieve general results without specifying the functions \(W_{\mu \nu }\) and \(\sigma (\Psi ^i)\). As an example showing the applicability of our results, we worked on the specific class of k-essence theories in Sect. 3. For this case, we generalized the stability theorem found for instance in [39], taking into account the new functions Q ans \(\Pi \). We found that the specific minimally coupled scalar–tensor case leads to stable configurations since the boundary term (49) does vanish. The considered example shows that there are other theories of gravitation besides GR in which a neutron star is a stable system. However, it is worth noting that other theories can lead to non-vanishing boundary terms.

If one finds a theory in which the equilibrium (21) is not recovered from the Lagrange multiplier method employed in Sect. 3, it is clear that the stability criterion should be reinterpreted. Contrary to the standard case, even assuming a uniform entropy per nucleon and chemical composition, the interpretation of the mass function, and consequently the proper definition of the quantity \(\mathcal {M}\), should be identified with the effective energy density Q. The same interpretation should also be extended to the quantity \(\mathcal {M}\), which appears in the definition of the nucleon number N.

The investigation of the stability of stellar systems in ETG and other modifications of gravity that cannot be recast in the form (1) should be further investigated. We will present such an analysis in a future work.