1 Introduction

Mota Although it is very common to consider the conservation of energy-momentum tensor in gravity theories, it has been argued that such conservation could be violated in quantum systems [1, 2]. See e.g. Ref.  [3] for a review about alternative gravity theories in which the null covariant divergence of the energy-momentum tensor is not achieved. In particular, by assuming that the covariant divergence of the energy-momentum tensor is no longer zero, but proportional to the covariant derivative of the Ricci scalar, Rastall modified the GR theory fifty years ago [4]. This assumption describes the non-minimal coupling between matter and geometry, and its cosmological consequences have been previously studied in the literature [5,6,7,8,9,10,11,12,13,14]. Manna and collaborators [15] investigated the classical tests (such as precession of perihelion, deflection of light and time delay) in Rastall theory. Furthermore, at cosmological level, we must emphasize that generalized versions for original Rastall gravity have also been explored [16,17,18,19,20]. The propagation of axial gravitational waves in the spatially flat conformal FLRW spacetime within the framework of generalized Rastall theory was discussed by Salti [21].

On the other hand, in the strong-field regime, various authors have reported black hole solutions in Rastall gravity [22,23,24,25], as well as their thermodynamic properties [26]. It was shown that Kiselev-like black holes surrounded by regular matter in Rastall theory may be considered as Kiselev black holes surrounded by exotic matter in GR [27]. The quasinormal oscillations corresponding to the black hole in presence of non-linear electrodynamic sources revealed significant deviations from a general charged black hole in Rastall gravity under certain conditions [28]. More recently, Shao et al. [29] investigated the quasinormal modes and late-time tail of massless scalar perturbations of a magnetized black hole, while the Hawking radiation of a Schwarzschild black hole surrounded by a cloud of strings in Rastall theory was discussed in Ref. [30]. Moreover, by means of Newman-Janis algorithm without complexification, an exact solution of Kerr black hole surrounded by a cloud of strings in Rastall gravity was obtained in Ref. [31].

Over the last years, there has been a growing interest in constructing compact stars within the context of Rastall gravity. As a matter of fact, the equilibrium structure of neutron stars described by an isotropic perfect fluid was examined in Refs. [32,33,34], and the tidal Love numbers of such stars were calculated in [35]. Anisotropic compact stars under the same gravitational framework were also investigated in the past [36,37,38,39], as well as taking into account electric charge [40,41,42] and rapid rotation effects [43]. In addition, the gravitational collapse process of a homogeneous perfect fluid and the dynamics of dissipative collapse of a self-gravitating source (using the Müller–Israel–Stewart approach) were explored in Refs. [44, 45], respectively. Exotic objects as wormholes in Rastall theory were also studied in [46, 47].

Theoretically, the radial stability of a compact star can be investigated by considering small perturbations from the hydrostatic equilibrium. In Einstein gravity, Chandrasekhar was the first to derive the linearized equations describing the adiabatic radial oscillations of isotropic compact stars [48, 49]. Specifically, the system of differential equations is treated as an eigenvalue problem and, subsequently, the emergence of real (complex) discrete frequencies is attributed to a radial stability (instability) of the star. For further reading on radial oscillations of compact stars in GR we also refer the reader to Refs. [50,51,52,53,54,55,56,57,58,59,60,61]. Additionally, this subject has also been addressed in some modified theories of gravity, see e.g. Refs. [62,63,64,65]. To the best of our knowledge, the dynamical stability of compact stars (adopting a perturbative approach to the field equations) has not yet been investigated in Rastall gravity, so the purpose of the present work is to fill this gap. To do so, we will first derive the modified TOV equations and they will be solved for two EoSs describing quark matter and hadronic matter. Our second task will be to perturb all equations involved up to first order in the metric and fluid variables in order to obtain the radial pulsation equations.

Before continuing with our study, it is important to comment on some criticisms about Rastall gravity, which have been raised in the paper [66]. Visser claimed that Rastall gravity is a trivial rearrangement of the matter sector in Einstein gravity; as gravity there is absolutely nothing new. This argument is not true for one simple reason: In any modified gravity theory it is possible to rearrange the field equations and rewrite them in a traditional form as the Einstein equations. For example, the field equations in the well-known f(R) gravity theories [67, 68]

$$\begin{aligned} f_R R_{\mu \nu } - \dfrac{1}{2}g_{\mu \nu }f - \nabla _\mu \nabla _\nu f_R + g_{\mu \nu }\square f_R = 8\pi T_{\mu \nu }^\textrm{ord} \end{aligned}$$
(1)

can be written as \(G_{\mu \nu }= 8\pi T_{\mu \nu }^\textrm{tot}\), where the total energy-momentum tensor \(T_{\mu \nu }^\textrm{tot} = T_{\mu \nu }^\textrm{ord}+ T^\textrm{cur}_{\mu \nu }\) is composed of two fluids indeed [69, 70]: a standard matter fluid (i.e., ordinary matter described by \(T_{\mu \nu }^\textrm{ord}\)) and a curvature fluid (also called in the literature as effective fluid), being the latter described by [70]

$$\begin{aligned} T^\textrm{cur}_{\mu \nu }&= \dfrac{1}{8\pi }\left[ (1 - f_R)R_{\mu \nu } + \dfrac{1}{2}(f -R)g_{\mu \nu } + \nabla _\mu \nabla _\nu f_R - g_{\mu \nu }\square f_R \right] . \end{aligned}$$
(2)

One can observe that equation \(G_{\mu \nu }= 8\pi T_{\mu \nu }^\textrm{tot}\) does not mean that GR is equivalent to f(R) gravity theory. In fact, such equivalence only exists when \(f(R)= R\). If we followed Visser’s argument, we would have that the f(R) theories contribute absolutely nothing new by simply rearranging the field equations, however, as we already know, that is false! Therefore, Rastall gravity is not equivalent to Einstein gravity. It is important to mention that in addition to this argument, there are other issues showing that these two theories are not equivalent. As a matter of fact, Darabi and collaborators [71] have obtained different conclusions from Visser’s ones, and they have indeed argued that Rastall gravity is an “open” theory when compared to GR. Specifically, the authors have stated that the ordinary definition of energy-momentum tensor is valid in the Rastall theory, unlike the claims of Visser [66].

Within the gravitational framework of GR, the \(M(\rho _c)\) method is often compatible with the analysis of the normal vibration modes, namely, the maximum-mass value on the \(M(\rho _c)\) curve and the zero fundamental mode frequency are found at the same central energy density. Nevertheless, these methods are not compatible in more realistic or general situations; such as in anisotropic stars [72] unless the tangential pressure is held fixed at the surface of the star [73], color superconducting quark stars [54], hybrid stars composed by a quark matter core and hadronic external layers [55], neutron stars with a dark-energy core [74], charged strange quark stars [75], and polytropic configurations in modified gravity [64]. As we will see later, the gravitational mass of a star in Rastall gravity does not only depend on the energy density, but there is also an extra mass contribution due to the Rastall term, also treated as “effective fluid” in modified gravity. In that regard, the standard \(M(\rho _c)\) method is expected to be invalid in the Rastall scenario. An indicator that could also establish the onset of instability is the formation of a cusp when the gravitational binding energy (as a function of the baryon rest mass) is a minimum. As a matter of fact, this analysis was carried out in scalar-tensor theories of gravity [76, 77], 4D Einstein-Gauss-Bonnet gravity [78], f(RT) theories with conserved energy-momentum tensor [64], and within the context of R-squared gravity [79]. In this study, we will therefore consider independent approaches (i.e., by analyzing the binding energy and calculating the fundamental vibration mode frequencies) in order to obtain rigorous results on the radial stability of compact stars in Rastall gravity.

The plan of this work is as follows: In Sect. 2 we briefly review Rastall gravity, we explicitly express the field equations for a spherically symmetric system, derive the corresponding modified TOV equations, and we present the equations of state. Considering small adiabatic perturbations from the equilibrium state, in Sect. 3 we address the dynamical stability and we derive the radial oscillation equations. Section 4 presents a discussion of the numerical results for the equilibrium configurations as well as an analysis about the frequencies of normal vibration modes. Finally, our conclusions are presented in Sect. 5. We will use a geometric unit system and the sign convention \((-,+,+,+)\) throughout the text. However, our results will be given in physical units for comparison reasons.

2 Stellar structure equations

We suppose that spacetime geometry of a spherically symmetric stellar configuration is described by the well-know line element

$$\begin{aligned} ds^2 = g_{\mu \nu }dx^\mu dx^\nu = -e^{2\psi }dt^2 + e^{2\lambda } dr^2 + r^2d\Omega ^2, \end{aligned}$$
(3)

where \(g_{\mu \nu }\) is the metric tensor, \(x^\mu = (t, r, \theta , \phi )\) are the Schwarzschild-like coordinates, and the metric functions \(\psi \) and \(\lambda \), in principle, depend on the coordinates t and r. Moreover, \(d\Omega ^2 = d\theta ^2 + \sin ^2\theta d\phi ^2\) is the line element on the unit 2-sphere.

With respect to the matter-energy distribution, we assume that the compact star is made of an isotropic perfect fluid, namely

$$\begin{aligned} T_{\mu \nu } = (\rho + p)u_\mu u_\nu + pg_{\mu \nu }, \end{aligned}$$
(4)

with \(\rho \) being the energy density, p the pressure, and \(u_\mu \) is the four-velocity of the fluid, given by

$$\begin{aligned} u^\mu = \frac{dx^\mu }{d\tau } = u^0\left( 1, \frac{dx^i}{dt} \right) , \end{aligned}$$
(5)

where \(\tau \) is the proper time and \(u_\mu u^\mu = -1\). Following the same procedure carried out by Chandrasekhar [48, 49] in GR theory, we consider a spherically symmetric system with motions, if any, only in the radial directions, so that \(u^\mu = (u^0, u^1, 0, 0)\) and \(T_2^{2} = T_3^{3} =p\).

Under the assumption that the energy-momentum tensor is not conserved in curved spacetime, Rastall proposed a generalization of Einstein’s conventional theory [4]. Indeed, within the framework of Rastall gravity, the modified field equations are given by

$$\begin{aligned} R_{\mu \nu } - \frac{\alpha }{2}g_{\mu \nu }R = 8\pi T_{\mu \nu }, \end{aligned}$$
(6)

or alternatively

$$\begin{aligned} G_{\mu \nu } = 8\pi \left[ T_{\mu \nu }- \frac{1-\alpha }{16\pi }Rg_{\mu \nu } \right] , \end{aligned}$$
(7)

where \(R_{\mu \nu }\) is the Ricci tensor, R denotes the scalar curvature, \(G_{\mu \nu }\) is the Einstein tensor and \(\alpha \) is the so-called Rastall parameter. Notice that the curvature itself contribute to the total energy of the system, as postulated by Rastall. As is evident, the standard GR theory is retrieved when \(\alpha =1\).

By taking the trace of Eq. (7), we get \(R = 8\pi T/(1-2\alpha )\) and hence the field equations can be written as

$$\begin{aligned} G_{\mu \nu } = 8\pi T_{\mu \nu } - 8\pi \beta Tg_{\mu \nu }, \end{aligned}$$
(8)

where we have defined \(\beta \equiv \frac{1-\alpha }{2(1 - 2\alpha )}\).

Maintaining the validity of the gravitational Bianchi identity (i.e., \(\nabla _\mu G^{\mu \nu } =0\)), the four-divergence of Eq. (8) leads to

$$\begin{aligned} \nabla _\mu T^{\mu \nu } = \beta \nabla ^\nu T = \frac{1- \alpha }{16\pi } \nabla ^\nu R. \end{aligned}$$
(9)

Rastall questioned the traditional assumption that the covariant derivative of the energy-momentum tensor is zero in curved spacetime [4]. As we can see in Eq. (9), he considered that the four-divergence of the energy-momentum tensor is proportional to the variation of the Ricci scalar. It is therefore evident that the energy-momentum tensor is a non-conserved quantity. Nevertheless, the assumption \(\nabla _\mu T^{\mu \nu } \ne 0\) opens the possibility of a gravitationally induced particle production as shown by Harko and collaborators [2, 80]. In fact, there exists a considerable number of modified gravity theories allowing departures from the usual conservative context. For a review of non-conservative gravity theories, we refer the reader to Ref. [3].

For the index \(\nu = 1\), the non-conservative equation \(\nabla _\mu T_1^{\mu } = \beta \nabla _1 T\) becomes

$$\begin{aligned} \partial _t T_1^{0} + \partial _r T_1^{1} + T_1^{0}({\dot{\psi }} + {\dot{\lambda }}) + \left[ T_1^{1} - T_0^{0}\right] \psi ^{\prime } + \dfrac{2}{r}\left[ T_1^{1} - p\right] = \beta \partial _r (-\rho + 3p) , \end{aligned}$$
(10)

where overdots and primes denote partial differentiation with respect to t and r, respectively. If \(\beta = 0\), the conservation law of energy and momentum is restored and Rastall gravity falls back to Einstein’s theory.

Furthermore, the non-null components of the field equations (8) are given by

$$\begin{aligned}&\dfrac{1}{r^2}\partial _r(re^{-2\lambda }) - \dfrac{1}{r^2} = 8\pi T_0^{0} + 8\pi \beta (\rho - 3p) , \end{aligned}$$
(11)
$$\begin{aligned}&e^{-2\lambda }\left( \dfrac{2}{r}\psi ^{\prime } + \dfrac{1}{r^2} \right) - \dfrac{1}{r^2} = 8\pi T_1^{1} + 8\pi \beta (\rho -3p) , \end{aligned}$$
(12)
$$\begin{aligned}&e^{-2\lambda }\left[ \psi ^{\prime \prime } + \psi '^2 - \psi ^{\prime }\lambda ^{\prime } + \dfrac{1}{r}(\psi ^{\prime } - \lambda ^{\prime }) \right] \nonumber \\&\quad + e^{-2\psi }\left[ {\dot{\lambda }}{\dot{\psi }} - \ddot{\lambda } - {\dot{\lambda }}^2 \right] = 8\pi p + 8\pi \beta (\rho -3p) , \end{aligned}$$
(13)
$$\begin{aligned}&\dfrac{2}{r}e^{-2\lambda }{\dot{\lambda }} = 8\pi T_0^{1} , \end{aligned}$$
(14)

and, by means of Eqs. (11) and (12), we can obtain the following relation which will be used later:

$$\begin{aligned} \frac{2}{r}e^{-2\lambda }(\psi ^{\prime }+\lambda ^{\prime }) = 8\pi (T_1^{1} - T_0^{0}). \end{aligned}$$
(15)

2.1 Modified TOV equations

When the stellar fluid remains in a state of hydrostatic equilibrium, none of the variables depend on the time coordinate. This implies that \(u^\mu = (u^0, 0, 0, 0)\), \(T_0^{0} = -\rho _0\) and \(T_1^{1} = T_2^{2} = T_3^{3} = p_0\), where the lower index 0 indicates that the quantities are evaluated in the equilibrium. As a consequence, Eqs. (11), (12), (10) and (15) assume the form, respectively,

$$\begin{aligned} \frac{d}{dr}(re^{-2\lambda _0})&= 1- 8\pi r^2\rho _0 + 8\pi \beta r^2(\rho _0- 3p_0), \end{aligned}$$
(16)
$$\begin{aligned} \frac{2}{r}e^{-2\lambda _0}\psi ^{\prime }_0&=\frac{1 - e^{-2\lambda _0}}{r^2} + 8\pi p_0 + 8\pi \beta (\rho _0 - 3p_0), \qquad \end{aligned}$$
(17)
$$\begin{aligned} \frac{dp_0}{dr}&= -(\rho _0+ p_0)\psi ^{\prime }_0 - \beta (\rho ^{\prime }_0 - 3p^{\prime }_0), \end{aligned}$$
(18)
$$\begin{aligned} \frac{2}{r}(\psi ^{\prime }_0 + \lambda ^{\prime }_0)&= 8\pi (\rho _0 + p_0)e^{2\lambda _0}. \end{aligned}$$
(19)

Integrating Eq. (16) we obtain the usual expression

$$\begin{aligned} e^{-2\lambda _0} = 1 - \frac{2m}{r}, \end{aligned}$$
(20)

where m(r) stands for the gravitational mass within a sphere of radius r, given by

$$\begin{aligned} m(r) = 4\pi \int _0^r {\bar{r}}^2\rho _0({\bar{r}})d{\bar{r}} - 4\pi \beta \int _0^r {\bar{r}}^2 \left[ \rho _0({\bar{r}}) - 3p_0({\bar{r}}) \right] d{\bar{r}}, \end{aligned}$$
(21)

or alternatively, \(m= m_\rho + m_\textrm{eff}\), where \(m_\rho \) is the standard mass widely known in GR and \(m_\textrm{eff}\) is an extra effective mass due to the modification of the field equations. In other words, the Rastall term contributes additional mass, and as we will see later in our results, it ends up modifying the radial stability of a compact star. As expected, when \(\beta =0\) we recover the typical expression obtained in Einstein gravity. At the surface, where the pressure vanishes, \(m(r_\textrm{sur}) \equiv M\) is the total mass of the star. Taking into account Eq. (20), from Eq. (17) we obtain

$$\begin{aligned} \frac{d\psi _0}{dr} = \left[ \frac{m}{r^2} + 4\pi rp_0 + 4\pi \beta r(\rho _0 - 3p_0) \right] \left( 1- \frac{2m}{r} \right) ^{-1}. \end{aligned}$$
(22)

Thus, in view of Eqs. (18), (21) and (22), the relativistic structure of a compact star within the framework of Rastall gravity is described by the modified TOV equations:

$$\begin{aligned} \frac{dm}{dr}&= 4\pi r^2\rho - 4\pi \beta r^2(\rho - 3p) , \end{aligned}$$
(23)
$$\begin{aligned} \frac{dp}{dr}&= -\frac{\rho + p}{1- 3\beta } \left[ \frac{m}{r^2}+ 4\pi rp + 4\pi \beta r(\rho - 3p) \right] \nonumber \\&\quad \times \left( 1- \frac{2m}{r} \right) ^{-1} - \frac{\beta }{1- 3\beta }\frac{d\rho }{dr} , \end{aligned}$$
(24)
$$\begin{aligned} \frac{d\psi }{dr}&= -\frac{1- 3\beta }{\rho + p}\frac{dp}{dr} - \frac{\beta }{\rho + p}\frac{d\rho }{dr} , \end{aligned}$$
(25)

where we have removed the subscript zero because all quantities correspond to the state of hydrostatic equilibrium. This set of differential equations plays a crucial role in describing the hydrostatic equilibrium of compact stars in Rastall theory. They are also known as stellar structure equations and, as in any gravity theory, they allow us to obtain the most basic macroscopic properties of a star such as its radius and gravitational mass. Similar to the GR context, they are the base equations for further analysis of moment of inertia, oscillation spectrum and tidal properties. Recent studies on the relativistic structure of compact objects in modified gravity can be found in Refs. [33,34,35,36,37,38,39,40,41,42,43, 70, 77, 79, 81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96]. This work aims to carry out a rigorous analysis about the radial stability of compact stars in Rastall gravity through radial and adiabatic pulsations. In other words, the static background, described by the modified TOV equations (23)–(25), will be subjected to small deviations from equilibrium. We will return to this in Sect. 3.

As expected, when the free parameter \(\beta \) vanishes (this is, \(\alpha =1\)), one retrieves the conventional TOV equations in the pure GR case [97, 98]. The variables to be determined by this system of equations are m(r), \(\rho (r)\), p(r) and \(\psi (r)\), while the metric function \(\lambda (r)\) can be determined from Eq. (20). Given an EoS in the form \(p= p(\rho )\), Eqs. (23) and (24) can be integrated for a specific value of central energy density and by guaranteeing regularity at the center of the star. Besides, since \(R=0\) outside the star, we can still use the Schwarzschild vacuum solution to describe the exterior spacetime. Namely, this allows the interior solution to be matched to the exterior Schwarzschild solution at the boundary \(r= r_\textrm{sur}\). Therefore, the system of differential equations (23)–(25) can be solved by imposing the following boundary conditions

$$\begin{aligned} \rho (0) = \rho _c, \quad m(0) = 0, \quad \psi (r_\textrm{sur}) = \frac{1}{2}\ln \left[ 1 - \frac{2M}{r_\textrm{sur}} \right] . \end{aligned}$$
(26)

The most basic macroscopic properties of a compact star such as mass and radius will be calculated for a range of central-density values and by considering different values of the Rastall parameter. Other observables such as the gravitational redshift of light emitted at the surface of the equilibrium star can also be analyzed in terms of the parameter \(\beta \). This quantity is given by

$$\begin{aligned} z_\textrm{sur} = \left[ 1- \frac{2M}{r_\textrm{sur}} \right] ^{-1/2} -1. \end{aligned}$$
(27)

2.2 Equations of state

In this subsection, we discuss the EoSs used in the present work to describe quark matter and hadronic matter. The first is then used to investigate quark stars and the second, hadronic stars. A didactic and more extensive explanation of the EoS can be found in Ref. [99] and references therein. These EoSs will be the input to the modified hydrostatic equilibrium and radial oscillation equations in Rastall gravity.

2.2.1 Quark matter

To investigate quark stars we use a simple relativistic model to describe quark matter, the MIT bag model [100]. In general terms, such model describes the confinement of quarks in a volume of space capable of containing hadronic fields. Inside the bag, creating and maintaining this region in a vacuum requires constant positive potential energy per unit volume, namely the bag constant (B). Inside this volume, the moving quarks have an associated kinetic energy and no colour currents survive on the surface. We therefore assume the quarks in the interior of the bag as a Fermi gas whose energy at the border of the bag is negligible when compared with the energies inside it.

The Lagrangian density that reproduces the dynamics of the quarks \(\psi _{q}\) contained in a bag of volume V delimited by the surface S can be written as

$$\begin{aligned} {\mathcal {L}}_\textrm{MIT} = \sum _{q} \left[ {\bar{\psi }}_{q}(i\gamma ^{\mu }\partial _{\mu } - m_{q})\psi _{q} - B\right] \Theta _{V} - \frac{1}{2}{\bar{\psi }}_{q}\psi _{q}\delta _{S}, \end{aligned}$$
(28)

where q denotes the flavours of the quarks involved, of masses \(m_{q}\); B is the bag constant; \(\Theta _{V}\) is the Heaviside function and the term \(\frac{1}{2}{\bar{\psi }}_{q}\psi _{q}\delta _{S}\), where \(\delta _{ S}\) is the Dirac delta, ensures continuity on the surface S. For the case of the spherical bag of radius R, the argument of the functions \(\Theta _{V}\) and \(\delta _{ S}\) is \((R - r)\). The equations of motion are here obtained by means of the Euler–Lagrange equations [101] applied to the Lagrangian density in expression (28).

Taking into account all the above considerations, the EoS for the MIT bag model takes the following form

$$\begin{aligned} {\mathcal {E}} = \frac{3}{\pi ^{2}} \sum _{q} \int ^{K_{F_{q}}}_{0}k^2 (m_{q}^2 +k^2)^{1/2}dk + B, \end{aligned}$$
(29)

and

$$\begin{aligned} P = \frac{1}{\pi ^{2}} \sum _{q} \int ^{K_{F_{q}}}_{0}\frac{k^4}{(m_{q}^2 +k^2)^{1/2}}dk - B, \end{aligned}$$
(30)

which are the expressions for energy density and pressure, respectively. Besides, \(K_{F_{q}}\) is the Fermi moment.

The baryonic number density (\(\rho \)) is given by the equation

$$\begin{aligned} \rho = \sum _{q}\frac{1}{3} \rho _q = \sum _{q}\frac{1}{3}\frac{(K_{F_{q}})^{3}}{\pi ^{2}}, \end{aligned}$$
(31)

where \(\rho _q\) is the density of the quark of flavour q. Equations (29)–(31) are sufficient to describe quark matter. Whenever stellar matter is considered, chemical \(\beta \) equilibrium and charge neutrality equations have to be imposed and hence, the inclusion of leptons (generally electrons and muons) is necessary. The relations between the chemical potentials of the different particles are given by the \(\beta \)-equilibrium conditions,

$$\begin{aligned} \mu _s=\mu _d=\mu _u+\mu _e, \quad \mu _e=\mu _\mu . \end{aligned}$$
(32)

Moreover, for charge neutrality we must impose

$$\begin{aligned} \rho _e+\rho _\mu =\frac{1}{3}(2\rho _u-\rho _d-\rho _s). \end{aligned}$$
(33)

The electron and muon densities read

$$\begin{aligned} \rho _l={K_{F_l}^3}/{3\pi ^2}, \end{aligned}$$
(34)

where \(K_{F_{l}}\) is the Fermi momentum for leptons. The energy density and pressure for the leptons are given, respectively, by

$$\begin{aligned} {\mathcal {E}}_l&= \frac{3}{\pi ^{2}} \int ^{K_{F_{l}}}_{0}k^2 (m_{l}^2 +k^2)^{1/2}dk, \end{aligned}$$
(35)
$$\begin{aligned} P&= \frac{1}{3 \pi ^{2}} \int ^{K_{F_{l}}}_{0}\frac{k^4}{(m_{l}^2 +k^2)^{1/2}}dk, \end{aligned}$$
(36)

where the electron mass is taken as \(0.511\, \textrm{MeV}\) and the muon mass is \(105.66\, \textrm{MeV}\). We use a value for the bag constant equal to \(B^{1/4} = 148\, \textrm{MeV}\), which satisfies the stability window for this model according to the results shown in Ref. [102].

2.2.2 Hadronic matter

The relativistic model used here to describe the hadronic matter is a rather generalized version of the quantum hadrodynamics (QHD) [103,104,105], which is based on a relativistic mean–field theory and describes the baryon interaction through the exchange of scalar and vector mesons, known as nonlinear Walecka model (NLWM).

Since the introduction of the \(\sigma -\omega \) model [106], several relativistic hadronic models have been used with great success to describe infinite nuclear matter, finite nuclei and stellar matter properties [107]. Despite the good description of the binding energy, other important properties, such as incompressibility and effective mass of nucleons, are not obtained with satisfactory values. This problem was circumvented by Boguta and Bodmer in Ref. [105] introducing self-interaction terms, cubic and quartic, in the scalar field. Likewise, to deal with asymmetric systems in numbers of protons and neutrons, the vector-isovector meson \(\rho \) was introduced, and to adjust other properties such as symmetry energy and the fact that protons and neutrons have slightly different masses, other mesons and interactions were being included, resulting in a huge number of generalizations and proposed parameterizations.

The complete Lagrangian density for the NLWM that describes baryons interacting among each other by exchanging scalar-isoscalar (\(\sigma \)), vector-isoscalar (\(\omega \)), vector-isovector (\(\rho \)) and scalar-isovector (\(\delta \)) mesons is given by [99, 107, 108]

$$\begin{aligned} {\mathcal {L}}_\textrm{NLWM}&= {\overline{\psi }}(i\gamma ^\mu \partial _\mu - M)\psi + g_\sigma \sigma {\overline{\psi }}\psi - g_\omega {\overline{\psi }}\gamma ^\mu \omega _\mu \psi \nonumber \\&\quad - \frac{g_\rho }{2}{\overline{\psi }}\gamma ^\mu \mathbf {\rho }_\mu \cdot \mathbf {\tau }\psi + g_\delta {\overline{\psi }}\mathbf {\delta }\cdot \mathbf {\tau }\psi \nonumber \\&\quad + \frac{1}{2}(\partial ^\mu \sigma \partial _\mu \sigma - m^2_\sigma \sigma ^2) - \frac{A}{3}\sigma ^3 - \frac{B}{4}\sigma ^4 - \frac{1}{4}F^{\mu \nu }F_{\mu \nu } \nonumber \\&\quad + \frac{1}{2}m^2_\omega \omega _\mu \omega ^\mu + \frac{C}{4}(g_\omega ^2\omega _\mu \omega ^\mu )^2 - \frac{1}{4}\textbf{B}^{\mu \nu }\textbf{B}_{\mu \nu } \nonumber \\&\quad + \frac{1}{2}m^2_\rho \mathbf {\rho }_\mu \cdot \mathbf {\rho }^\mu + \frac{1}{2}(\partial ^\mu \mathbf {\delta }\partial _\mu \mathbf {\delta } - m^2_\delta \mathbf {\delta }^2) \nonumber \\&\quad + g_\sigma g_\omega ^2\sigma \omega _\mu \omega ^\mu \left( \alpha _1+\frac{1}{2}{\alpha _1}'g_\sigma \sigma \right) + g_\sigma g_\rho ^2\sigma \mathbf {\rho }_\mu \cdot \mathbf {\rho }^\mu \left( \alpha _2+\frac{1}{2}{\alpha _2}'g_\sigma \sigma \right) \nonumber \\&\quad + \frac{1}{2}{\alpha _3}'g_\omega ^2 g_\rho ^2\omega _\mu \omega ^\mu \mathbf {\rho }_\mu \cdot \mathbf {\rho }^\mu . \end{aligned}$$
(37)

In this Lagrangian density, \(m_{i}\) represents the meson masses, with \(i=\sigma ,\omega ,\rho ,\delta \), and \(g_{i}\) stands for the coupling constant of the interaction of the i meson field with the baryonic field \(\psi \). The antisymmetric field tensors \(F_{\mu \nu }\) and \(\textbf{B}_{\mu \nu }\) are given by \(F_{\mu \nu }=\partial _\nu \omega _\mu -\partial _\mu \omega _\nu \) and \(\textbf{B}_{\mu \nu }=\partial _\nu \mathbf {\rho }_\mu -\partial _\mu \mathbf {\rho }_\nu - g_\rho (\mathbf {\rho }_\mu \times \mathbf {\rho }_\nu )\). The coefficients \(\gamma _{\mu }\) and \(\mathbf {\tau }\) are the Dirac gamma matrices and Pauli matrices for the isospin, respectively. Finally, M is the nucleon mass.

The equations of motion that describe the entire dynamics of the system are obtained via Euler–Lagrange equations [101] and rotational and translational invariance are assumed. The result is coupled nonlinear equations whose solution is an extremely complicated task, even numerically. One approximation that can be made is the relativistic mean field (RMF) approximation, where the meson fields are treated as classical fields, and the substitution below is performed, namely

$$\begin{aligned}&\sigma \rightarrow \left\langle \sigma \right\rangle \equiv \sigma _0, \end{aligned}$$
(38)
$$\begin{aligned}&\omega _\mu \rightarrow \left\langle \omega _0\right\rangle \equiv \omega _0, \end{aligned}$$
(39)
$$\begin{aligned}&\mathbf {\rho }_\mu \rightarrow \left\langle \mathbf {\rho }_0\right\rangle \equiv {\bar{\rho }}_{0(3)}, \end{aligned}$$
(40)
$$\begin{aligned}&\mathbf {\delta } \rightarrow \langle \mathbf {\delta } \rangle \equiv \delta _{(3)}, \end{aligned}$$
(41)

and the equations of motion are given in the following expressions:

$$\begin{aligned} m^2_\sigma \sigma _0&= g_\sigma \rho _s - A\sigma _0^2 - B\sigma _0^3 + g_\sigma g_\omega ^2\omega _0^2(\alpha _1+{\alpha _1}'g_\sigma \sigma ) +g_\sigma g_\rho ^2{\bar{\rho }}_{0(3)}^2(\alpha _2+{\alpha _2}'g_\sigma \sigma ) , \end{aligned}$$
(42)
$$\begin{aligned} m_\omega ^2\omega _0&= g_\omega \rho - Cg_\omega (g_\omega \omega _0)^3 - g_\sigma g_\omega ^2\sigma _0\omega _0(2\alpha _1+{\alpha _1}'g_\sigma \sigma _0) - {\alpha _3}'g_\omega ^2 g_\rho ^2{\bar{\rho }}_{0(3)}^2\omega _0 , \end{aligned}$$
(43)
$$\begin{aligned} m_\rho ^2{\bar{\rho }}_{0(3)}&= \frac{g_\rho }{2}\rho _3 -g_\sigma g_\rho ^2\sigma _0{\bar{\rho }}_{0(3)}(2\alpha _2+{\alpha _2}'g_\sigma \sigma _0) -{\alpha _3}'g_\omega ^2 g_\rho ^2{\bar{\rho }}_{0(3)}\omega _0^2 , \end{aligned}$$
(44)
$$\begin{aligned} m_\delta ^2\delta _{(3)}&= g_\delta \rho _{s3}, \end{aligned}$$
(45)

and

$$\begin{aligned}{}[ i\gamma ^\mu \partial _\mu -\gamma ^0 V_\tau - (M+S_\tau )] \psi = 0. \end{aligned}$$
(46)

The scalar and vector densities are given by

$$\begin{aligned} \rho _s&=\left\langle {\overline{\psi }}\psi \right\rangle ={\rho _s}_p+{\rho _s}_n, \end{aligned}$$
(47)
$$\begin{aligned} \rho _{s3}&=\left\langle {\overline{\psi }}{\tau }_3\psi \right\rangle ={\rho _s}_p-{\rho _s}_n, \end{aligned}$$
(48)
$$\begin{aligned} \rho&=\left\langle {\overline{\psi }}\gamma ^0\psi \right\rangle = \rho _p + \rho _n, \end{aligned}$$
(49)
$$\begin{aligned} \rho _3&=\left\langle {\overline{\psi }}\gamma ^0{\tau }_3\psi \right\rangle = \rho _p - \rho _n=(2y_p-1)\rho , \end{aligned}$$
(50)

with

$$\begin{aligned} {\rho _s}_{p,n}&= \frac{\gamma M^*_{p,n}}{2\pi ^2}\int _0^{{k_F}_{p,n}} \frac{k^2dk}{\sqrt{k^2+M^{*2}_{p,n}}},\end{aligned}$$
(51)
$$\begin{aligned} \rho _{p,n}&= \frac{\gamma }{2\pi ^2}\int _0^{{k_F}_{p,n}}k^2dk = \frac{\gamma }{6\pi ^2}{k_F^3}_{p,n}, \end{aligned}$$
(52)
$$\begin{aligned} V_{\tau }&=g_\omega \omega _0 + \frac{g_\rho }{2}{\bar{\rho }}_{0(3)}\tau _3, \quad S_{\tau } =-g_\sigma \sigma _0 -g_\delta \delta _{(3)}\tau _3, \end{aligned}$$
(53)

with \(\tau _3 = 1\) and \(\tau _3 = -1\) for protons and neutrons, respectively. Here, \(\gamma \) is the spin degeneracy. Besides, the proton and neutron effective masses are given by

$$\begin{aligned} M^{*}_{p} = M - g_{\sigma }\sigma _{0}-g_{\delta }\delta _{(3)}, \quad M^{*}_{n} = M - g_{\sigma }\sigma _{0}+g_{\delta }\delta _{(3)}. \end{aligned}$$
(54)

After some analytical procedures, the expressions for energy density and pressure are obtained [99, 107]

$$\begin{aligned} {\mathcal {E}}&=\frac{1}{2}m^2_\sigma \sigma _0^2 + \frac{A}{3}\sigma _0^3 + \frac{B}{4}\sigma _0^4 - \frac{1}{2}m^2_\omega \omega _0^2 - \frac{C}{4}(g_\omega ^2\omega _0^2)^2\nonumber \\&\quad - \frac{1}{2}m^2_\rho {\bar{\rho }}_{0(3)}^2 +g_\omega \omega _0\rho +\frac{g_\rho }{2}{\bar{\rho }}_{0(3)}\rho _3 \nonumber \\&\quad + \frac{1}{2}m^2_\delta \delta ^2_{(3)} - g_\sigma g_\omega ^2\sigma \omega _0^2 \left( \alpha _1+\frac{1}{2}{\alpha _1}'g_\sigma \sigma _0\right) - g_\sigma g_\rho ^2\sigma {\bar{\rho }}_{0(3)}^2 \left( \alpha _2+\frac{1}{2}{\alpha _2}' g_\sigma \sigma _0\right) \nonumber \\&\quad - \frac{1}{2}{\alpha _3}'g_\omega ^2 g_\rho ^2\omega _0^2{\bar{\rho }}_{0(3)}^2 + {\mathcal {E}}_{{\hbox {kin}}}^p + {\mathcal {E}}_{{\hbox {kin}}}^n, \end{aligned}$$
(55)

with

$$\begin{aligned} {\mathcal {E}}_{{\hbox {kin}}}^{p,n}=\frac{\gamma }{2\pi ^2}\int _0^{{k_F}_{p,n}}k^2 (k^2+M^{*2}_{p,n})^{1/2}dk, \end{aligned}$$
(56)

and pressure:

$$\begin{aligned} P&= - \frac{1}{2}m^2_\sigma \sigma _0^2 - \frac{A}{3}\sigma _0^3 -\frac{B}{4}\sigma _0^4 + \frac{1}{2}m^2_\omega \omega _0^2 + \frac{C}{4}(g_\omega ^2\omega _0^2)^2 \nonumber \\&\quad + \frac{1}{2}m^2_\rho {\bar{\rho }}_{0(3)}^2 + \frac{1}{2}{\alpha _3}'g_\omega ^2 g_\rho ^2\omega _0^2{\bar{\rho }}_{0(3)}^2 -\frac{1}{2}m^2_\delta \delta ^2_{(3)} \nonumber \\&\quad + g_\sigma g_\omega ^2\sigma _0\omega _0^2 \left( \alpha _1+\frac{1}{2}{\alpha _1}'g_\sigma \sigma _0\right) \nonumber \\&\quad + g_\sigma g_\rho ^2\sigma {\bar{\rho }}_{0(3)}^2 \left( \alpha _2+\frac{1}{2}{\alpha _2}' g_\sigma \sigma \right) +p_\textrm{kin}^p+p_\textrm{kin}^n , \end{aligned}$$
(57)

where

$$\begin{aligned} P_{{\hbox { kin}}}^{p,n} = \frac{\gamma }{6\pi ^2}\int _0^{{k_F}_{p,n}}\frac{k^4dk}{(k^2+M^{*2}_{p,n})^{1/2}}. \end{aligned}$$
(58)

At this stage, charge neutrality and chemical equilibrium conditions need to be implemented, which depend on the inclusion of leptons. These conditions read

$$\begin{aligned} \mu _p = \mu _n -\mu _e, \mu _e =\mu _\mu , \rho _p = \rho _e + \rho _\mu , \end{aligned}$$
(59)

where, the leptonic expressions for energy density, pressure and density are the same given in Sect. 2.2.1.

Of the many possible parameterizations of the QHD model, we chose the IU-FSU parameterization proposed by Piekarewicz and authors in [109]. In addition to satisfying the constraints investigated in [107, 110], the IU-FSU model also satisfactorily reproduces the recent astrophysical constraint from the observation of GW170817 [111].

Finally, to describe the star outer crust, we use the full BPS EoS [112].

3 Dynamical stability

The solution of the modified TOV equations (23)–(25) provides a family of equilibrium configurations, but such an equilibrium state may be stable or unstable with respect to a radial perturbation. As mentioned in the introduction, a technique widely used in the literature to identify the onset of instability is the \(M(\rho _c)\) method, that is, the first maximum in the mass-central density curve marks the boundary between stable and unstable stars. However, this method is very simple and provides a necessary but not sufficient condition for stability analysis along the sequence of equilibrium configurations [113, 114]. A more rigorous analysis of the radial stability of a compact star involves calculating the eigenfrequencies of the normal radial modes of pulsation (which may grow or be damped exponentially). In that regard, here we are going to derive for the first time the differential equations that govern the adiabatic radial oscillations within the context of Rastall gravity. With this in mind, we will deal with radial motions so that the stellar system maintains its spherical symmetry. Furthermore, in the adiabatic approximation, the heat transfer can be ignored during the dynamics of small perturbations.

We regard small deviations from the hydrostatic equilibrium where a fluid element located at r in the unperturbed configuration (characterized by zero velocities) is displaced to \(r+ \xi (t,r)\) in the perturbed system, and hence we can define \(v = \partial \xi /\partial t\). Moreover, the variable h (representing any metric or fluid quantity) can be written as \(h(t,r) = h_0(r)+ \delta h(t,r)\), where \(h_0\) is the background solution, \(\delta h\) is the Eulerian perturbation and \(\vert \delta h/h_0 \vert \ll 1\). Henceforth we will only maintain first-order terms in all perturbations. This means that we can write the four-velocity (5) as \(u^\mu = (e^{-\psi }, e^{-\psi _0}v, 0, 0)\), and the energy-momentum tensor (4) takes the form [64]

$$\begin{aligned} T_\mu ^{\nu }= \begin{pmatrix} -\rho &{}\quad -(\rho _0 + p_0)v &{}\quad 0 &{}\quad 0 \\ (\rho _0+p_0)ve^{2\lambda _0- 2\psi _0} &{}\quad p &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad p &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad p \end{pmatrix}. \end{aligned}$$
(60)

Although the procedure to derive the radial oscillation equations is a bit cumbersome, here we are going to summarize the main steps to obtain them. The approach is analogous to that carried out by Chandrasekhar in conventional GR [48]. Taking into account the static background equations (16)–(19), the perturbation of the field equations (11), (12) and (14) together with the non-conservative Eq. (10) leads to

$$\begin{aligned}&\delta \lambda = -\xi (\psi '_0 + \lambda '_0), \end{aligned}$$
(61)
$$\begin{aligned}&(\rho _0+ p_0)\frac{\partial }{\partial r}(\delta \psi ) = \left[ (1- 3\beta )\delta p + \beta \delta \rho - (\rho _0 + p_0)\left( \frac{1}{r} + 2\psi '_0 \right) \xi \right] (\psi '_0 + \lambda '_0), \end{aligned}$$
(62)
$$\begin{aligned}&\delta \rho = -\frac{3\beta }{1-\beta }(\delta p + \xi p'_0) - \xi \rho '_0 - \left[ \frac{\rho _0 + p_0}{1- \beta } \right] \frac{e^{\psi _0}}{r^2}\frac{\partial }{\partial r}\left( r^2\xi e^{-\psi _0}\right) , \end{aligned}$$
(63)
$$\begin{aligned}&(\rho _0+ p_0)e^{2\lambda _0 - 2\psi _0}\frac{\partial v}{\partial t} + \frac{\partial }{\partial r}(\delta p) + (\rho _0 + p_0)\frac{\partial }{\partial r}(\delta \psi ) + \psi '_0(\delta \rho + \delta p)\nonumber \\&\quad = \beta \frac{\partial }{\partial r}(3\delta p - \delta \rho ). \end{aligned}$$
(64)

Now let us assume that all perturbations have a harmonic time dependence, namely, \(\xi (t,r) = \chi (r)e^{i\omega t}\) and \(\delta h(t,r) = \delta h(r)e^{i\omega t}\), where \(\omega \) is the eigenfrequency of the radial vibrations to be determined. This assumption allows us to cancel the exponential factors in each linearized equation and hence we can obtain time-independent equations. This means that all equations are now in terms of the amplitudes \(\delta h(r)\) and quantities of the static background, and thus we can also take out the subscript zero. In view of Eq. (62), the linearized non-conservation equation (64) becomes

$$\begin{aligned} \omega ^2(\rho + p)e^{2\lambda - 2\psi }\chi&= (1- 3\beta )\frac{d(\delta p)}{dr} + \beta \frac{d(\delta \rho )}{dr} \nonumber \\&\quad + \left[ (2- 3\beta )\psi ' + (1- 3\beta )\lambda ' \right] \delta p + \left[ (1+ \beta )\psi ' + \beta \lambda ' \right] \delta \rho \nonumber \\&\quad - (\rho + p)\left( \frac{1}{r}+ 2\psi ' \right) (\psi ' + \lambda ')\chi . \end{aligned}$$
(65)

If the pressure is a function only of the energy density (this is, \(p = p(\rho )\)), we can write \(\delta p = (dp/d\rho ) \delta \rho \). As a consequence, by means of Eq. (63), we obtain

$$\begin{aligned} \delta p = -\chi p' - \frac{1}{1-\beta }\left[ 3\beta \Delta p\frac{dp}{d\rho } + \Gamma p\frac{e^\psi }{r^2}\frac{d}{dr}(r^2\chi e^{-\psi }) \right] , \end{aligned}$$
(66)

where \(\Delta p = \delta p + \chi p'\) is the Lagrangian perturbation of the pressure, and \(\Gamma \) is the adiabatic index at constant entropy:

$$\begin{aligned} \Gamma = \left( 1 + \frac{\rho }{p} \right) \frac{dp}{d\rho }. \end{aligned}$$
(67)

Note that Eq. (66) can be rewritten in a more compact form for the Lagrangian perturbation \(\Delta p\), namely

$$\begin{aligned} \Delta p = -\frac{\Gamma p}{{\mathcal {J}}} \frac{e^\psi }{r^2}\frac{d}{dr}(r^2\chi e^{-\psi }), \end{aligned}$$
(68)

where \({\mathcal {J}}\) has been defined as

$$\begin{aligned} {\mathcal {J}} \equiv 1 - \beta + 3\beta \frac{dp}{d\rho }. \end{aligned}$$
(69)

Furthermore, Eq. (63) can be rewritten as

$$\begin{aligned} \delta \rho = -\frac{3\beta }{1- \beta }\delta p - \frac{{\mathcal {Q}}}{1- \beta }, \end{aligned}$$
(70)

with \({\mathcal {Q}}\) being given by

$$\begin{aligned} {\mathcal {Q}}&\equiv \frac{d}{dr}\left[ (\rho + p)\chi \right] + \frac{2}{r}(\rho + p)\chi \nonumber \\&= \chi \rho ' - \beta \chi (\rho ' - 3p') - \left( \frac{\rho + p}{\Gamma p} \right) {\mathcal {J}}\Delta p . \end{aligned}$$
(71)

After substituting Eqs. (66) and (70) into (65), and by using Eqs. (13) and (18), we have

$$\begin{aligned} \omega ^2(\rho + p)e^{2\lambda - 2\psi }\chi&= \frac{1-4\beta }{1- \beta } \bigg \lbrace (\Delta p)' + (2\psi '+ \lambda ')\Delta p + (\rho +p)\big [ 8\pi p \nonumber \\&\quad + 8\pi \beta (\rho - 3p) \big ]e^{2\lambda }\chi - \chi (\rho + p)\psi '^2 + \frac{4}{r}\chi p' \nonumber \\&\quad + \beta \frac{d}{dr}[\chi (\rho ' - 3p')]+ 2\beta \chi (\rho '- 3p')\left( \frac{2}{r} + \psi ' + \frac{\lambda '}{2} \right) \bigg \rbrace \nonumber \\&\quad - \frac{\beta }{1- \beta }\left[ 3(\rho + p)\left( \frac{1}{r} + 2\psi ' \right) (\psi ' + \lambda ')\chi + {\mathcal {Q}}' + (5\psi '+ \lambda '){\mathcal {Q}} \right] , \end{aligned}$$
(72)

and through Eq. (71), the last expression becomes

$$\begin{aligned} {\mathcal {G}}(\Delta p)'&= \chi \bigg \lbrace \frac{1-\beta }{1- 4\beta }(\rho +p)\left[ \omega ^2e^{-2\psi } - 8\pi p - 8\pi \beta (\rho - 3p) \right] e^{2\lambda } \nonumber \\&\quad - \frac{1-7\beta }{1-4\beta }\frac{4}{r}p' + \frac{1+5\beta }{1-4\beta }(\rho + p)\psi '^2 \nonumber \\&\quad - \frac{\beta }{1-4\beta }\left[ \frac{4}{r}\rho ' - \beta (\rho '- 3p')\left( \frac{16}{r} + 3\psi '+ 3\lambda ' \right) \right. \nonumber \\&\quad \left. - 3p'(\psi '+ \lambda ') - 3(\rho + p)\left( \lambda '+ \frac{2}{r} \right) \psi ' \right] \bigg \rbrace \nonumber \\&\quad - \Delta p \left\{ 2\psi '+ \lambda ' + \frac{\beta }{1- 4\beta }\left[ (5\psi ' + \lambda ')\frac{\rho + p}{\Gamma p}{\mathcal {J}} + \frac{d}{dr}\left( \frac{\rho + p}{\Gamma p}{\mathcal {J}} \right) \right] \right\} \nonumber \\&\quad + \frac{3\beta }{1- 4\beta }\left[ \beta (\rho ' - 3p') + p'\right] \chi ' , \end{aligned}$$
(73)

where we have defined

$$\begin{aligned} {\mathcal {G}} \equiv 1+ \frac{\beta }{1- 4\beta }\left( \frac{\rho + p}{\Gamma p}{\mathcal {J}} \right) . \end{aligned}$$
(74)

Finally, it is convenient to introduce a new variable given by \(\zeta \equiv \chi /r\). Thus, from Eqs. (68) and (73) we obtain two first-order differential equations governing the adiabatic radial pulsations for a compact star in Rastall gravity:

$$\begin{aligned} \frac{d\zeta }{dr}&= -\frac{1}{r}\left[ 3\zeta + \frac{{\mathcal {J}}}{\Gamma p}\Delta p \right] + \psi '\zeta , \end{aligned}$$
(75)
$$\begin{aligned} {\mathcal {G}}\frac{d(\Delta p)}{dr}&= \zeta \bigg \lbrace \frac{1-\beta }{1- 4\beta }(\rho +p)\left[ \omega ^2e^{-2\psi } - 8\pi p - 8\pi \beta (\rho - 3p) \right] re^{2\lambda } \nonumber \\&\quad - 4\left( \frac{1-7\beta }{1-4\beta }\right) p' + \frac{1+5\beta }{1-4\beta }(\rho + p)r\psi '^2 \nonumber \\&\quad + \frac{\beta r}{1-4\beta }\left[ \beta (\rho '- 3p')\left( \frac{19}{r}+ 3\psi ' + 3\lambda ' \right) + 3p'\left( \frac{1}{r}+ \psi ' + \lambda ' \right) \right. \nonumber \\&\quad \left. - \frac{4}{r}\rho ' + 3(\rho + p)\left( \lambda '+ \frac{2}{r} \right) \psi ' \right] \bigg \rbrace \nonumber \\&\quad - \Delta p \left\{ 2\psi '+ \lambda ' + \frac{\beta }{1- 4\beta }\left[ (5\psi ' + \lambda ')\frac{\rho + p}{\Gamma p}{\mathcal {J}} + \frac{d}{dr}\left( \frac{\rho + p}{\Gamma p}{\mathcal {J}} \right) \right] \right\} \nonumber \\&\quad + \frac{3\beta r}{1- 4\beta }\left[ \beta (\rho ' - 3p') + p'\right] \zeta ' , \end{aligned}$$
(76)

and such equations reduce to the corresponding radial oscillation equations in standard GR when \(\beta = 0\), see for instance Refs. [52, 54,55,56]. Note that Eq. (75) has a trivial coordinate singularity at the center and hence the coefficient of 1/r term must vanish at \(r= 0\). Furthermore, the condition \(p(r_\textrm{sur})= 0\) leads to imposing another boundary condition for the Lagrangian perturbation of pressure at the surface. Consequently, the system of equations (75) and (76) will be solved by means of the following boundary conditions

$$\begin{aligned} \Delta p&= -3\frac{\Gamma p\zeta }{{\mathcal {J}}} \quad \text {as}\quad r\rightarrow 0 , \end{aligned}$$
(77)
$$\begin{aligned} \Delta p&= 0 \quad \text {as} \quad r\rightarrow r_\textrm{sur} . \end{aligned}$$
(78)

4 Numerical results

In this section, we present and discuss our numerical results. The essential ingredients of nuclear physics for astrophysical calculations are the appropriate EoSs. Such equations of state will be the input to the modified hydrostatic equilibrium and radial oscillation equations in Rastall gravity. For quark matter (2.2.1) we used the MIT bag model [100], in which the energy density and pressure are described by the expressions (29) and (30). Besides that, for hadronic matter (2.2.2) describing neutron stars, we used the IU-FSU parameterization [109] of the Walecka model with nonlinear terms [103,104,105], where energy density and pressure are given by Eqs. (55) and (57), respectively.

4.1 Hydrostatic equilibrium

Our first task is to obtain the metric variables and the thermodynamic quantities as functions of the radial coordinate. To do so, the stellar structure equations (23)–(25) with boundary conditions (26) will be numerically integrated from the origin up to the surface for a given equation of state \(p(\rho )\). As usual, the radius of the star is determined when the pressure vanishes (i.e., \(p(r_\textrm{sur})= 0\)), and the total gravitational mass is given by \(M \equiv m(r_\textrm{sur})\). In the left panel of Fig. 1, we plot the total mass versus radius for quark (blue lines) and hadronic (red lines) matter. Here we have considered values of \(\beta \) for which appreciable changes can be observed in the mass-radius diagram. The radius of neutron stars undergoes considerable deviations from GR in the low-mass region. This can be better observed when we plot the radius as a function of the central density, see the right panel of the same figure. Positive (negative) values of \(\beta \) result in larger (smaller) radii with respect to their pure general relativistic counterpart. Nonetheless, it should be noted that the changes in the maximum-mass values are insignificant.

Fig. 1
figure 1

Left panel: Mass-radius diagram for quarks stars (blue lines) and neutron stars (red lines) as predicted by Rastall gravity for different values of \(\beta \). The magenta horizontal band represents the observational measurement for the millisecond pulsar J1614−2230 reported in Ref. [115]. The NICER measurements for PSR J0030\(+\)0451 are shown by black dots with their respective error bars [116, 117], and the cyan area stands for the mass-radius constraint from the GW170817 event. Right panel: Radius versus central density relation. In the case of neutron stars, the more substantial deviations for \(r_\textrm{sur}\) from GR (\(\beta = 0\)) take place in the low-mass region, whereas for large masses (close to the maximum mass) the changes are very slight due to the Rastall parameter. Meanwhile, for quark matter, the radius undergoes little pronounced modifications and the maximum-mass values reveal relevant changes when \(\vert \beta \vert \) takes larger values than in the case of hadronic matter (color figure online)

On the other hand, noticeable changes in the most basic properties of a quark star are observed if we use larger values of \(\vert \beta \vert \) than in the case of hadronic matter. The main consequence of the Rastall term on quark stars is a significant increase (decrease) in the maximum mass for negative (positive) values of \(\beta \). Furthermore, according to the right plot of Fig. 1, we observe that a negative value of \(\beta \) increases the radius of a quark star, for a fixed central density. Remarkably, this behavior is contrary to the case of neutron stars.

Our numerical results provide a realistic description of compact stars in Rastall gravity in the sense that they satisfy the observational measurements. Specifically, for both equations of state, the set of values adopted for \(\beta \) satisfies the mass-radius constraint from the GW170817 event (see the filled cyan region). Moreover, the range \(\beta \in [-0.10, -0.05]\) consistently describes the millisecond pulsar J1614−2230 for the quark matter EoS. For the pulsar PSR J0030\(+\)0451, which was observed using the Neutron Star Interior Composition Explorer (NICER), we notice that positive values of \(\beta \) are more suitable for its description using a hadronic matter EoS.

Another interesting quantity that in principle can be observed is the gravitational redshift given by Eq. (27). Figure 2 shows the redshift of light emitted at the surface of each star as a function of gravitational mass for the same set of values of \(\beta \) as in Fig. 1. It can be seen that the maximum value of \(z_\textrm{sur}\) increases substantially with decreasing \(\beta \), while the changes are smaller for hadronic matter.

Fig. 2
figure 2

Gravitational redshift of light emitted at the stellar surface as a function of the total gravitational mass for the same values of \(\beta \) as considered in Fig. 1. The redshift exhibits significant changes only in the high-mass region for quark stars (color figure online)

Following Refs. [76,77,78,79], the gravitational binding energy \(E_B\) can be plotted as a function of the proper mass \(M_\textrm{pr}\) in order to analyze the stellar stability of the equilibrium configurations. The proper mass (also known as baryon mass) of a compact star is defined as

$$\begin{aligned} M_\textrm{pr} = 4\pi m_B\int _0^{r_\textrm{sur}} e^{\lambda (r)}r^2n_B(r)dr, \end{aligned}$$
(79)

with \(n_B(r)\) being the baryon number density function and \(m_B\) is the neutron mass which is chosen to agree with different stellar evolution models requiring the conservation of baryon number [79]. The difference between the total mass distribution of standard matter \(M_\rho \equiv m_\rho (r_\textrm{sur})\) and the proper mass gives us the binding energy, namely \(E_B = M_\rho - M_\textrm{pr}\) [64]. For quark matter EoS, the binding energy versus proper mass relation is shown in Fig. 3, where we can appreciate the emergence of a cusp for the different values of \(\beta \).

As already mentioned in the introduction, a turning point from stability to instability occurs when \(dM/d\rho _c =0\) according to the \(M(\rho _c)\) method. In other words, the stable branch of the quark stars shown in the left plot of Fig. 1 must be located below the critical central density corresponding to the maximum-mass configuration (see the full orange circles in the upper panel of Fig. 4). However, due to its simplicity, this criterion does not provide consistent results with the binding energy calculation. In particular, we find that the maximum-mass points and the minimum-binding-energy points do not coincide. This is because the Rastall term generates an extra mass contribution in Eq. (21). A more rigorous approach to investigate the radial stability of compact stars is by calculating the frequencies of the radial vibration modes which will be discussed below.

Fig. 3
figure 3

Binding energy \(E_B\) as a function of the proper mass \(M_\textrm{pr}\) of quark stars in Rastall gravity. Observe the formation of a cusp when the binding energy becomes minimal (see also Fig. 4 to visualize these minima as a function of the central energy density)

Fig. 4
figure 4

Upper panel: Mass-central density relation. Lower panel: Variation of the gravitational binding energy with respect to \(\rho _c\) for different values of \(\beta \) using the quark matter EoS. The full orange and green circles indicate the maximum-mass points and the minimum-binding-energy points, respectively. See also the left plot of Fig. 6, where the same values of central density corresponding to the minimum of \(E_B\) have been located in the inset (color figure online)

Fig. 5
figure 5

Eigenfunctions \(\zeta _n(r)\) in the left panel and \(\Delta p_n(r)\) in the right panel for the first six normal vibration modes as a function of the radial coordinate. The two plots correspond to a quark star in Rastall gravity with central density \(\rho _c= 1.5\times 10^{15}\, \mathrm g/cm^3\) and \(\beta = 0.05\). In can be observed that the solution corresponding to the nth oscillation mode has n nodes inside the star, where \(n=0\) describes the fundamental mode. Note also that the perturbations \(\zeta _n(r)\) have been normalized at the origin, i.e. \(\zeta (0) =1\), and the Lagrangian perturbation of the pressure \(\Delta p_n(r)\) satisfies the boundary condition (78) at the surface

4.2 Radial pulsations

Once the static background quantities (as well as the introduced variables \({\mathcal {J}}\) and \({\mathcal {G}}\)) are determined by integrating the modified TOV equations, our second task is to solve the radial pulsation equations in order to investigate the dynamical stability of the stellar configurations presented in Fig. 1. The system of differential equations (75) and (76), subject to the boundary conditions (77) and (78), constitutes a Sturm–Liouville eigenvalue problem for the squared frequencies. The corresponding solutions \(\zeta (r)\) and \(\Delta p(r)\) are the eigenfunctions associated to each eigenvalue \(\omega ^2\). In other words, there is an infinite number of solutions, but only specific values of \(\omega ^2\) which properly satisfy the boundary conditions are allowed.

As in the pure general relativistic case [52, 54,55,56], here we use the shooting method to solve first-order differential equations (75) and (76), namely, we perform the integration for a set of test values \(\omega ^2\) obeying the condition (77). Moreover, we assume that the normalized eigenfunctions correspond to \(\zeta (0)= 1\) at the stellar center, and we integrate up to the surface. The guessed values of \(\omega ^2\) that satisfy the boundary condition (78) will be the correct frequencies of the different radial vibration modes. In particular, for a specific value of the parameter \(\beta \) and considering a quark star with central density \(\rho _c = 1.5\times 10^{15}\, \mathrm {g/cm}^3\), the first six normal pulsations modes are shown in Fig. 5. Such configuration has a frequency spectrum \(\omega _0^2< \omega _1^2< \cdots< \omega _n^2< \cdots \), where n represents the number of nodes between the center and the stellar surface. The first eigenvalue corresponding to \(n=0\) is the fundamental or nodeless mode (see the black dotted line in Fig. 5) because it has the lowest frequency, while the higher frequencies are called overtones or excited modes. So, the first excited mode \(n=1\) (red curve) has a node, the second excited mode \(n=2\) (blue curve) has two, and so forth. If any of these eigenvalues is negative (i.e., \(\omega ^2< 0\)) for a particular stellar configuration, the frequency is purely imaginary and hence any radial perturbation of the star will generate a dynamical instability. On the other hand, the case \(\omega ^2> 0\) describes an oscillatory behavior and thereby corresponds to a stable star.

Let us now focus on \(\omega _0^2\) since it is the lowest eigenvalue of all the allowed pulsation modes. For a range of central densities, in Fig. 6 we plot the squared frequency of the fundamental mode as a function of the central density (left panel) and gravitational mass (right plot) for quark matter. Similar to the pure GR case, \(\omega _0^2\) is always a decreasing function of the central density for quark stars. For a fixed central density, a positive (negative) value of \(\beta \) leads to an increase (decrease) in \(\omega _0^2\). According to the right plot, it can be observed that the maximum mass does not correspond to \(\omega _0^2= 0\) when \(\beta \ne 0\). In other words, the existence of stable quark stars is possible after the maximum-mass configuration for negative values of \(\beta \), while the onset of instability is indicated before reaching the maximum mass for positive values of \(\beta \). Therefore, the classical \(M(\rho _c)\) method widely used to analyze the stellar stability in GR is not compatible with the calculation of vibration mode frequencies in Rastall gravity. Nevertheless, we remark that the cusp formed by plotting the binding energy as a function of proper mass can be used as an indicator for the onset of radial instability of relativistic stars in Rastall gravity. Specifically, we observe that the central density where the binding energy is minimal corresponds exactly to \(\rho _c\) where \(\omega _0^2= 0\) for all considered values of \(\beta \).

Unlike quark stars, the squared frequency of the fundamental mode for hadronic matter grows until it reaches a maximum value and then decreases with increasing central density, see Fig. 7. The increase in parameter \(\beta \) leads to a significant decrease in \(\omega _0^2\) at sufficiently low central densities, while the changes are irrelevant in the high-central-density region. Notice that this behavior is contrary to the case of quark stars. Nonetheless, since the values of \(\vert \beta \vert \) are smaller than those considered in the quark case, it is not possible to appreciate substantial variations in the maximum-mass values. In this direction, we could conclude that the maximum-mass configuration indicates (approximately) the transition between stable and unstable neutron stars in Rastall gravity.

Fig. 6
figure 6

Left panel: Squared frequency of the fundamental vibration mode as a function of the central density predicted by Rastall gravity for quark matter, where the different lines indicate different values of the parameter \(\beta \). The inset magnifies the behavior of \(\omega _0^2\) in the surroundings of its vanishing value, where the green points correspond precisely to the minimum-binding-energy points in Fig. 4. Right panel: Squared frequency of the fundamental oscillation mode versus gravitational mass. Note that, when \(\beta \ne 0\), the maximum-mass values do not correspond to \(\omega _0^2= 0\). This means that the conventional condition \(dM/d\rho _c =0\) to indicate the onset of instability is no longer valid in Rastall gravity. Stars cease to be stable before the maximum-mass configuration for positive values of \(\beta \), while stable stars still exist after the maximum-mass point for negative values of \(\beta \). However, the minimum binding energy is compatible with the zero frequency of the fundamental pulsation mode (color figure online)

Fig. 7
figure 7

Squared frequency of the fundamental pulsation mode against the central density (left panel) and gravitational mass (right panel) for hadronic matter in Rastall gravity. It can be observed that the largest impact of \(\beta \) on the eigenvalue \(\omega _0^2\) occurs in the low-central-density region, while it is practically unchanged in the high-mass region and, as a consequence, the maximum-mass value almost corresponds to \(\omega _0^2= 0\). Notice that the behavior here is different from the case of quark stars as shown in Fig. 6

5 Conclusions

Within the context of Rastall gravity, we have derived the modified TOV equations and we investigated the hydrostatic equilibrium of compact stars by adopting two equations of state. In the case of neutron stars, the radius undergoes a substantial modification due to the Rastall parameter \(\beta \) in the low-mass region, namely, positive values of \(\beta \) increase the radius and vice-versa. However, for quark stars it was necessary to use larger values of \(\beta \) in order to observe appreciable changes in the mass-radius diagram. The radius of these stars increases (decreases) for negative (positive) values of \(\beta \), contrary to the results obtained using the hadronic matter EoS. The maximum mass for quark stars can be significantly increased by considering negative values of \(\beta \). Furthermore, the gravitational redshift of light emitted at the stellar surface exhibits considerable changes only in the high-mass region for quark stars.

Following a perturbative procedure, similar to that carried out by Chandrasekhar in Einstein’s theory, we have derived for the first time the differential equations governing the adiabatic radial pulsations in Rastall gravity in order to examine the dynamical stability. In the GR limit (i.e., when \(\beta \rightarrow 0\)) we recover the corresponding Chandrasekhar equations. Under suitable boundary conditions, the system of equations has been treated as an eigenvalue problem, and vibration frequencies have been determined for a wide range of central densities for both quark and neutron stars. Our numerical results revealed that the standard \(M(\rho _c)\) criterion for stellar stability is no longer valid in Rastall gravity because the maximum-mass point does not correspond to \(\omega _0^2= 0\). Indeed, we found that there exist stable quark stars after the maximum-mass configuration for negative values of \(\beta \).

As an independent approach, we have also analyzed the gravitational binding energy as a function of proper mass for a whole family of quark stars using several values of \(\beta \). Our findings showed that the critical central density corresponding to the maximum-mass configuration deviates from \(\rho _c\) corresponding to the minimum-binding energy. However, the concept of binding energy has been shown to be useful in constructing stable compact stars since the squared frequency of the fundamental oscillation mode vanishes at the central-density value corresponding to the minimum-binding-energy configuration. Therefore, the cusp formed when the binding energy is minimal can be used as a turning point from stability to instability of compact stars in Rastall gravity.