1 Introduction

General Relativity (GR) as the simplest realisation of a geometric description of gravity has so far shown, perhaps unexpectedly, total agreement with astrophysical and cosmological observations [1, 2], as long as the general picture is accepted that the dark sectors, as needed for the \(\Lambda \)CDM model, are related to the particle and energy content of the Universe. Despite this tremendous success, there are reasons to investigate modifications of GR. First, GR breaks down in the high curvature regime. Second, it is only a classical field theory without any quantum effects and which is not (perturbatively) renormalisable as a quantum field theory unless quadratic curvature corrections are added to the Lagrangian [3]. Moreover, it is conceivable that all or part of the effects currently attributed to dark sectors are in reality a manifestation of different gravitational dynamics [4,5,6,7].

Some of the (theoretical) problems of GR can be ameliorated in modified gravitational theories, like f(R) and f(RQ) theories in which the Einstein-Hilbert Lagrangian is modified by adding polynomial terms in the Ricci scalar R or in the contraction of the Ricci curvature \(Q=R_{\mu \nu }R^{\mu \nu }\) (see e.g. [8,9,10,11,12,13] and references therein). From a different point of view, if the different terms in a gravity action are considered as quantum operators in the spirit of effective quantum field theories, studying their renormalisation group evolution indicates that f(R) and f(RQ) terms render the theory asymptotically safe (and hence viable as a quantum theory) in the Planckian and super-Planckian regime [14,15,16,17,18]. Finally, classical theories of modified gravity can also serve as effective descriptions of their more fundamental quantum counterparts (see e.g. [19, 20]).

Studying the compatibility of modified theories of gravity with phenomenology is a highly non-trivial issue since an interpretation of observations involves a combination of many different and uncertain physical mechanisms. As mentioned above, cosmological observations compatible with GR and dark sectors can be also made compatible with certain modifications of gravity and different contributions from dark sectors [21]. Inflationary scenarios can also be expressed in terms of modified theories of gravity (see e.g. [22,23,24,25,26]). It has been suggested that modifications of GR can be identified via the detection of new modes in gravitational waves [27,28,29,30,31,32,33,34]. Another possibility to investigate deviations from GR is with astrophysical observations. Different gravitational dynamics reflects into different stellar equations of structure [2, 35,36,37,38,39] and hence, in particular, in mass to radius ratios of neutron stars different to those expected from GR (see e.g. [40,41,42,43,44,45,46,47,48,49,50,51,52]). This is particularly interesting with the growing volume of observational data on neutron stars and the discovery of compact objects that are difficult to accommodate in a standard GR picture (see e.g. [53,54,55,56]). These measurements are, unfortunately, riddled with enormous uncertainties coming from the equation of state (EoS) describing the interior of neutron stars and can as well be interpreted as providing a handle on EoS assuming the theory of gravity is GR [57]. However, as we will show in this paper, the changes in the mass-radius relation for neutron stars coming from the uncertainty in the EoS are sometimes comparable to the differences generated by the modifications of the gravity theory, which implies that if, in the future, reliable ab-initio calculations of the EoS were available, astrophysical observations could be used as discriminators for gravity theories.

In this paper we shall investigate the influence of two particular models of f(R) and f(RQ) theories, namely \(f(R)=R+\alpha R^2\) and \(f(R,Q)=R+\alpha R^2 + \beta Q\) on the mass-radius relation for neutron stars. We study those theories in the Palatini formalism in which the dynamical degrees of freedom are the metric and the affine connection [11]. We will perform our calculations using a small number of representative EoS with the goal of estimating the uncertainty stemming from the EoS and from the theory of gravity (in our case simply encoded in the values of \(\alpha \) and \(\beta \)).

The paper is organised as follows. We sketch the derivation of the equations of stellar structure for Palatini theories in Sect. 2 and discuss several aspects of the EoS chosen in Sect. 3. Our results are shown in Sect. 4 and we conclude a discussion of the implications of our results on the validity of theories studied herein and of possible future work.

2 Stellar structure equations for f(RQ) Palatini theories

We discuss here the main aspects of the equations of stellar structure solved in this work. We consider only the simplified case of non-rotating and static stars, whose only observables are their mass and radius. The equations for f(RQ) theories were derived in [36] and we refer to that paper for further details (see also [35, 48]). In GR, the equivalent equations are the well-known Tolman–Oppenheimer–Volkoff (TOV) equations.

In Palatini f(RQ) theories the action is given by

$$\begin{aligned} S[g,\Gamma ,\psi _m]=\frac{1}{2\kappa }\int d^4x \sqrt{-g}f(R,Q) +S_m[g,\psi _m], \end{aligned}$$
(1)

where R is the Ricci scalar, \(Q=R_{\mu \nu }R^{\mu \nu }\) the aforementioned contraction of two Ricci tensors, with \(R_{\mu \nu }=R_{\mu \rho \nu }^{\rho }\) and the Riemann tensor given by \(R^d_{abc}\equiv \partial _b\Gamma ^d_{ac}-\partial _c\Gamma ^d_{ab}+\Gamma ^e_{ac}\Gamma ^d_{eb}-\Gamma ^e_{ab}\Gamma ^d_{ec}\) with \(\Gamma \) the connection coefficients, \(g_{\mu \nu }\) is the metric, \(\kappa \equiv 8\pi G\) and \(S_m[g,\psi _m]\) is the matter action. In the Palatini formalism the equations of motion are obtained after varying the action with respect to both, the metric and the connection

$$\begin{aligned} f_R R_{\mu \nu }-\frac{f}{2}g_{\mu \nu }+2f_QR_{\mu \alpha }{R^\alpha }_\nu= & {} \kappa T_{\mu \nu } \end{aligned}$$
(2)
$$\begin{aligned} \nabla _{\beta }\left[ \sqrt{-g}\left( f_R g^{\mu \nu }+2f_Q R^{\mu \nu }\right) \right]= & {} 0 \ , \end{aligned}$$
(3)

with \(f_R \equiv \frac{\partial f}{\partial R}\) and \(f_Q \equiv \frac{\partial f}{\partial Q}\). One can introduce an auxiliary metric \(h_{\mu \nu }\) via the (matter-content dependent) mapping \(\sqrt{-g}\left( f_R g^{\mu \nu }+2f_Q R^{\mu \nu }\right) \equiv \sqrt{-h}h^{\mu \nu }\) such that the equation for the connection becomes \(\nabla _\beta \left[ \sqrt{-h}h^{\mu \nu }\right] =0\) and the connection \(\Gamma \) can thus be written as the Levi-Civita connection for \(h_{\mu \nu }\). Therefore, the Ricci tensor in Eqs. (2) and (3) can be written as the standard metric Ricci tensor of the metric h which we denote as \(R_{\mu \nu }(h)\). Introducing \({\Sigma _\alpha } ^\nu := \left( f_R \delta _\alpha ^\nu +2f_Q {B_\alpha }^\nu \right) \), with \({B_\alpha }^\nu \) given as \( {B_\alpha }^\nu =R_{\alpha \beta }(h)g^{\beta \nu }\), the relation between \(g_{\mu \nu }\) and \(h_{\mu \nu }\) is [36]

$$\begin{aligned} h_{\mu \nu }=\sqrt{\det \Sigma } {[\Sigma ^{-1}]_\mu }^\alpha g_{\alpha \nu } \ \text { } , \text { } \ h^{\mu \nu }=\frac{g^{\mu \alpha }{{\Sigma _\alpha } ^\nu }}{\sqrt{\det \Sigma }} \ . \end{aligned}$$
(4)

The Ricci tensor is given by

$$\begin{aligned} R_{\mu }^{\nu }(h)=R_{\mu \alpha }(h)h^{\alpha \nu }=\frac{1}{\sqrt{\mathrm {det}\Sigma }}\left( \frac{f}{2}\delta _{\mu }^{\nu }+\kappa T_{\mu }^{\nu }\right) . \end{aligned}$$
(5)

Note here that, when calculating R and Q from R(h) in f(RQ), the Ricci tensor \(R_{\mu \nu }(h)\) must be contracted with the physical metric \(g^{\mu \nu }\), that is, via the matrix \(B_{\alpha }^{\nu }\) above [36]

$$\begin{aligned} R=B_{\alpha }^{\alpha } \quad \mathrm {and} \quad Q=B_{\alpha }^{\nu }B_{\nu }^{\alpha }. \end{aligned}$$
(6)

In this paper we will only consider energy-momentum tensors of the form

$$\begin{aligned} T_{\mu \nu }=\left( \rho + P\right) u_\mu u_\nu + P g_{\mu \nu }, \end{aligned}$$
(7)

and Lagrangians of the form \(f(R)=R+\alpha R^2\) and \(f(R,Q)=R+\alpha R^2 + \beta Q\). In these cases we can write the scalars R and Q in terms of \(\rho \) and P as \(R=-\kappa T\), as in GR, and [36]

$$\begin{aligned} \beta Q= & {} -\left( {\tilde{f}}+\frac{\tilde{f}_R^2}{4f_Q}+2\kappa ^2P\right) \nonumber \\&+\frac{{f_Q}}{16}\left[ 3\left( R+\frac{\tilde{f}_R}{f_Q}\right) \pm \sqrt{\left( R+\frac{\tilde{f}_R}{f_Q}\right) ^2-\frac{4\kappa ^2(\rho +P)}{f_Q}}\right] ^2,\nonumber \\ \end{aligned}$$
(8)

where \(\tilde{f}=f(R)=R+\alpha R^2\), \(\tilde{f_R}=1+2\alpha R\) and \(f_Q=\beta \). The sign in front of the square root must be chosen so as to obtain the right limit at low curvatures.

The stellar structure equations are the dynamical equations for the star’s interior metric, parametrised as

$$\begin{aligned} g_{\mu \nu }=\mathrm {diag}\left( -A(r)e^{2\psi (r)}, \frac{1}{A(r)}, r^2, r^2\mathrm {sin}^2\theta \right) , \end{aligned}$$
(9)

where A(r) will be written as \(A(r)=1-\frac{2M(r)}{r}\). After a tedious but straightforward derivation (see [36] for details) one arrives at the stellar structure equations for Palatini in the case of \(f(R,Q)=R+\alpha R^2 + \beta Q\), which read

$$\begin{aligned}&\left( \frac{\Omega _r}{\Omega }+\frac{2}{r}\right) \psi _r =\frac{1}{A}\left( \tau _r^r-\frac{\Omega }{S}\tau _t^t\right) \nonumber \\&\quad -\frac{1}{2}\frac{\Omega _r}{\Omega }\left( 2\frac{\Omega _r}{\Omega }+\frac{S_r}{S}\right) -\frac{1}{r}\left( \frac{S_r}{S}-\frac{\Omega _r}{\Omega }\right) +\frac{\Omega _{rr}}{\Omega }, \end{aligned}$$
(10)
$$\begin{aligned}&\left( \frac{\Omega _r}{\Omega }+\frac{2}{r}\right) \frac{M_r}{r}\nonumber \\&\quad =\frac{3\tau _r^r-\frac{\Omega }{S}\tau _t^t}{2}+A\left( \frac{\Omega _{rr}}{\Omega }+\frac{\Omega _r}{\Omega }\left( \frac{2r-3M}{r(r-2M)}-\frac{3}{4}\frac{\Omega _r}{\Omega }\right) \right) , \nonumber \\ \end{aligned}$$
(11)
$$\begin{aligned}&P_r=-\frac{P^{(0)}_r}{\left[ 1-\alpha (r)\right] } \frac{2}{\left( 1\pm \sqrt{1-\beta (r)P^{(0)}_r}\right) }, \end{aligned}$$
(12)

where, as before, a subscript denotes partial derivation, i.e. \(M_r=\frac{\partial M}{\partial r}\) and \(\Omega _{rr}=\frac{\partial ^2 \Omega }{\partial r^2}\), and we introduced for compactness

$$\begin{aligned} \alpha (r)= & {} \frac{(\rho +P)}{2}\left( \frac{\Omega _P}{\Omega }+\frac{S_P}{S}\right) , \end{aligned}$$
(13)
$$\begin{aligned} \beta (r)= & {} (2r)\frac{\Omega _P}{\Omega }\left[ 1-\frac{(\rho +P)}{2}\left( \frac{3}{2}\frac{\Omega _P}{\Omega }-\left\{ \frac{\Omega _P}{\Omega }-\frac{S_P}{S}\right\} \right) \right] ,\nonumber \\ \end{aligned}$$
(14)
$$\begin{aligned} P^{(0)}_r= & {} \frac{(\rho +P)}{r(r-2M)}\left[ M-\left( \tau _r^r+\frac{\Omega }{S}\tau _t^t\right) \frac{r^3}{4}\right] . \end{aligned}$$
(15)

Here, \(\Omega \) and S are given by the relation between the auxiliary metric \(h_{\mu \nu }\) and the physical metric \(g_{\mu \nu }\)

$$\begin{aligned} h_{tt}=\frac{\sigma _2^2}{\sqrt{\sigma _1\sigma _2}}g_{tt}\equiv Sg_{tt} \quad \mathrm {and} \quad h_{ij}=\sqrt{\sigma _1\sigma _2}g_{ij}\equiv \Omega g_{ij}, \end{aligned}$$
(16)

where \(\sigma _1\) and \(\sigma _2\) appear upon rewriting the matrix \(\Sigma \) as \(\Sigma _{\alpha }^{\nu }=\text {diag(}\sigma _1,\sigma _2,\sigma _2,\sigma _2\text {)}\) from Eq. (5) and are given by [36]

$$\begin{aligned} \sigma _1 = \frac{f_R}{2}\pm \sqrt{2f_Q}\sqrt{\lambda ^2-\kappa (\rho +P)}, \end{aligned}$$
(17)
$$\begin{aligned} \sigma _2 = \frac{f_R}{2}+\sqrt{2f_Q}\lambda , \end{aligned}$$
(18)

where

$$\begin{aligned} \lambda = \frac{\sqrt{2f_Q}}{8}\left( 3\left( R+\frac{f_R}{f_Q} \right) \pm \sqrt{\left( R+\frac{f_R}{f_Q}\right) ^2-\frac{4\kappa (\rho +P)}{f_Q}}\right) .\nonumber \\ \end{aligned}$$
(19)

In order to recover the GR limit one has to use the positive sign in front of the square root in Eq. (12) and for \(\sigma _1\) but the negative sign in \(\lambda \) [36]. Finally, \(\tau \) refers to the right-hand side of Eq. (5), namely \(R_{\mu }^{\nu }\equiv \tau _{\mu }^{\nu }\).

Note that, in Eq. (11), we have \(\Omega _{rr}=\Omega _{PP}P_r^2+\Omega _PP_{rr}\) which involves the second derivative \(P_{rr}\), in contrast to the standard TOV equations. As it turns out, it is possible to write \(P_{rr}\) in terms of the first order derivative \(P_r\). The result is [36]

$$\begin{aligned} \frac{P_{rr}}{P_{r}}= & {} \frac{P^{(0)}_{rr}}{P^{(0)}_{r}}\left[ 1+\frac{s}{2}\frac{\beta P^{(0)}_{r}}{\sqrt{1-\beta P^{(0)}_{r}}(1\pm \sqrt{1-\beta P^{(0)}_{r}})}\right] \nonumber \\&+\left[ \frac{\alpha _r}{1-\alpha }+\frac{\pm 1}{2}\frac{\beta _r P^{(0)}_{r}}{\sqrt{1-\beta P^{(0)}_{r}}(1\pm \sqrt{1-\beta P^{(0)}_{r}})}\right] ,\nonumber \\ \end{aligned}$$
(20)

with \(\alpha _r=\alpha _PP_r\) and \(\beta _r=\beta _PP_r\) and

$$\begin{aligned} \frac{P^{(0)}_{rr}}{P^{(0)}_{r}}= & {} \left[ \left( \frac{1+\rho _P}{\rho +P}\right) -\frac{\Phi _P \frac{r^3}{4}}{\left( M-\Phi \frac{r^3}{4}\right) }\right] P_r\nonumber \\&-\left( \frac{2(r-M)}{r(r-2M)}+\frac{ \frac{3\Phi r^2}{4}}{M-\Phi \frac{r^3}{4} }\right) \nonumber \\&+M_r\left( \frac{2}{r-2M}+\frac{1}{M-\Phi \frac{r^3}{4}}\right) . \end{aligned}$$
(21)

where we introduced \(\Phi \equiv (\tau _r^r+\frac{\Omega }{S}\tau _t^t)\). In this way, Eqs. (10)–(12) are a closed (after fixing an equation of state) system of equations expressed in terms of r, \(\rho (P)\), P, M and their first radial derivatives only.

3 Equations of state

The essential ingredient to solve the equations of stellar structure is an equation of state that relates the pressure to the energy density inside the star.

In order to estimate the different effects on the mass and radius of neutron stars coming from the modifications of the gravity lagrangian and from the uncertainty in the EoS, we use a number of different EoS in analytic as well as tabulated form. Specifically, we use two different tabulated and two different analytic EoS. The analytic equations of state we used are the so-called SLy and FPS [58] The SLy and FPS EoS are analytic parametrisations of the results of many-body calculations with unified effective nuclear Hamiltonians [59, 60], describing all regions of the neutron star interior from crust to core including its transitions. The analytic paramerisations take care that all thermodynamic conditions involving derivatives of the EoS are fulfilled, an aspect that will become problematic when using tabular data directly, as we will see. The SLy and FPS EoS are both parametrised by the following function

$$\begin{aligned} \zeta= & {} \frac{a_1+a_2\xi +a_3\xi ^3}{1+a_4\,\xi }\,f_0(a_5(\xi -a_6)) \nonumber \\&+ (a_7+a_8\xi )\,f_0(a_9(a_{10}-\xi )) \nonumber \\&+ (a_{11}+a_{12}\xi )\,f_0(a_{13}(a_{14}-\xi )) \nonumber \\&+ (a_{15}+a_{16}\xi )\,f_0(a_{17}(a_{18}-\xi )), \end{aligned}$$
(22)

where \(\xi = \text {log}(\rho /\text {g cm}^{-3})\) and \(\zeta = \text {log}(P/\text {dyn cm}^{-2})\) and \(f_0(x)\) is given by [58]

$$\begin{aligned} f_0(x)=\frac{1}{e^x+1}. \end{aligned}$$
(23)

The fitted parameters \(a_i\) in Eq. (22) are shown in Table 1.

Table 1 SLy and FPS parameters for Eq. (22), given in [58]

Additionally to the two analytic EoS above, we also studied neutron star solutions based on two other EoS in tabulated form. We choose EoS available in the CompOSE online service [61], namely the so called HS(DD2) [62, 63] and HS(TMA) [62, 64] EoS. These two EoS are both based on the the statistical model presented in [62], which includes the contribution of nuclei, nucleons, electrons, positrons and photons (excluding neutrino contributions) and which requires as input the masses and binding energies of nuclei and an effective model for the nucleon-nucleon interaction, which is then treated in the relativistic mean-field (RMF) approximation. The two EoS thus differ in the different model used for that dynamical input. The HS(DD2) equation of state uses the density-dependent nuclear model called DD2 [63], with the nuclei properties given by the FRDM model [65]. The HS(TMA) equation of state uses instead the TMA model [64], with the masses of nuclei taken from [66].

The drawback of using tabulated data to solve the equations of stellar structure is that interpolation functions and numerical derivatives thereof must be used. This procedure is ambiguous (as one can use many different forms for the interpolating functions) and, as mentioned above, certain thermodynamic relations must be preserved by the derivatives of the EoS (see e.g. [58]). This is a particularly difficult problem to tackle in the case of modified Palatini theories, since higher derivatives of the EoS are needed as compared to GR. Indeed, in the stellar structure equations for Palatini f(R) and f(RQ) the first and second derivative of the density \(\rho \) with respect to the pressure P appear. For the analytically given EoS above this is relatively straightforward. Remembering that \(P(\rho )=10^{\zeta (\xi (\rho ))}=10^{\zeta (\text {log}_{10}(\rho ))}\) we have

$$\begin{aligned} \frac{dP(\rho )}{d\rho }=\frac{dP}{d\zeta }\frac{d\zeta }{d\xi }\frac{d\xi }{d\rho } = \frac{P}{\rho }\frac{d\zeta }{d\xi }, \end{aligned}$$
(24)

and

$$\begin{aligned} \frac{d^2P}{d\rho ^2}=\frac{d}{d\rho }\left( \frac{dP}{d\rho }\right) =\frac{dP}{d\rho }\frac{1}{\rho }\frac{d\zeta }{d\xi }-\frac{P}{\rho ^2}\frac{d\zeta }{d\xi }+\frac{P}{\rho ^2}\frac{d^2\zeta }{d\xi ^2}, \end{aligned}$$
(25)

in order to arrive at the first and second derivative of the density with respect to the pressure we now have to invert Eqs. (24) and (25). One gets

$$\begin{aligned}&\frac{d\rho }{dP}=\frac{1}{\frac{dP}{d\rho }}, \end{aligned}$$
(26)
$$\begin{aligned}&\frac{d^2\rho }{dP^2}=-\frac{\frac{d^2P}{d\rho ^2}}{\left( \frac{dP}{d\rho }\right) ^3}. \end{aligned}$$
(27)

The result for the parametrization of the SLy and FPS EoS together with the first and second derivative of the parametrisations are shown in Fig. 1. For tabulated EoS data one can either apply a similar procedure as above after defining appropriate interpolating functions or simply calculate the derivatives numerically, as we did. When calculating the derivatives numerically, the different ways in which the data can be interpolated and hence derivatives can be taken has an impact on the results, as we discuss below.

Fig. 1
figure 1

The Sly and FPS equation of state and their first and second derivatives

4 Results

The mass and radius of a star are obtained by integrating from inside out the stellar structure equations after fixing a central density and until the pressure reaches a pre-determined threshold. In our calculations, the threshold was set to \(P=P_c \times 10^{-12}\) where \(P_c\) is the initial central pressure (determined by the EoS from the central density) in case of the analytic EoS. For tabulated EoS we stopped the integration when reaching the last entry of the EoS tables. We considered central densities in the range \(\xi = [14.4,16]\) (at \(r=0.01\) mm for numerical stability). The integration was performed using a fourth-order Runge–Kutta method with a fixed stepsize of 1m, since after exploring several adaptive-step methods we concluded that a fixed step was accurate enough and sped up the calculations.

Fig. 2
figure 2

Mass-radius relation for GR and \(f(R)=R+\alpha R^2\), the SLy and FPS EoS and different values of the parameter \(\alpha \)

Fig. 3
figure 3

Mass-radius relation for GR and \(f(R)=R+\alpha R^2\), the HS(DD2) and HS(TMA) EoS and different values of the parameter \(\alpha \)

A problem arising whenever a modified theory of gravity is used, is to determine the relative strength of the additional terms of the Lagrangian. Since in the present paper we use theories of the type \(f(R)=R+\alpha R^2\) and \(f(R,Q)=R+\alpha R^2 + \beta Q\), the problem reduces to finding reasonable values for \(\alpha \) and \(\beta \), consistent with phenomenology. However until now no solid experimental bounds on the values of \(\alpha \) and \(\beta \) exist for theories in the Palatini formalism (see [67] for a study in Palatini). There exist, however, more restrictive experimental bounds on \(\alpha \) for theories in the metric formalism (where only the metric is considered a dynamical degree of freedom). The Gravity Probe B experiment constrains \(\alpha \) to \(\alpha \lesssim 5 \times 10^{15}\) cm\(^2\), while the constraint coming the Pulsar B in PSR J0737-3039 is four orders of magnitude higher [68]. In [68] they derived an even more stringent constraint on \(\alpha \) from the Eöt-Wash experiment, constraining \(\alpha \) to \(\alpha \lesssim 10^{-6}\) cm\(^2\). However, this bound was derived in the low curvature regime of a laboratory on earth. Since possible modifications to GR will likely only be relevant in the high curvature regime, we do not take the bound from this experiment into consideration. Recently another bound for \(\alpha \) has been derived by calculating the stability of stars in metric \(f(R)=R+\alpha R^2\) gravity [69]. Using polytropic EoS and looking for the maximum value of \(\alpha \) which still fulfills the stability criteria they found \(\alpha \lesssim 2.4 \times 10^8\) cm\(^2\). To the best of our knowledge, no bounds on \(\beta \) exist at the moment.

Since the dynamics of metric and Palatini theories can be very different, the bounds discussed above may not apply in our case. Lacking a thorough analysis along the lines of [68, 69] for Palatini theories, we used values for \(\alpha \) and \(\beta \) for which an appreciable change in the mass-radius curve was obtained and that, for the case of \(\alpha \), are still within the bounds obtained in the metric formalism and in [67].

4.1 \(R+\alpha R^2\) case

We begin with the study of \(f(R)=R+\alpha R^2\) theories and show the mass-radius relation for a range of positive and negative values of \(\alpha \). Note that an analogous study was performed in [48] for the SLy and FPS EoS. However, our results are in contradiction with those presented in [48]. While in [48] the authors found only minor variations with respect to GR of the mass and radius of neutron stars, our calculations show instead a significant deviation from GR in some cases. We show in Fig. 2 our results for the mass-radius relation using the SLy and FPS EoS, compared to the corresponding GR result. As one can see, significant deviations from GR appear in the low-radius region even though smaller deviations are also observed for less compact stars. Interestingly, for negative values of \(\alpha \), \(f(R)=R+\alpha R^2\) theories generate heavier stars than GR and thus push the mass limit for the SLy and FPS EoS.

Fig. 4
figure 4

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2\) and GR, for the SLY EoS

Fig. 5
figure 5

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2\) and GR, for the FPS EoS

Fig. 6
figure 6

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2\) and GR, for the HS(DD2) EoS

Fig. 7
figure 7

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2\) and GR, for the HS(TDA) EoS

The situation is less pronounced in the case of the tabulated HS(DD2) EoS, Fig. 3. In this case, the differences in the mass-radius relation with respect to GR are still visible but are significantly smaller than in the previous case. What remains true is that negative values of \(\alpha \) allow for a larger maximum mass. In the case of the HS(TMA) EoS, Fig. 3, the deviations with respect to GR are dramatic for the largest values of \(\alpha \) we used. This is certainly an unexpected behaviour that we were able to trace back to a small difference in the HS(TMA) EoS with respect to the other EoS we used,Footnote 1 which induces a larger difference in the first and second derivative of the EoS. As can be seen in the first panel of Fig. 9 at around \(P=10^{32}\ \frac{g}{cm\ s}\) the HS(TMA) EoS differs slightly from all other EoS but the difference is amplified for the first and second derivatives as can be seen in the second and third panel of Fig. 9. Note finally, that the range of radii obtained in the case of tabulated EoS is limited by the maximum and minimum values of the data provided, unlike in the case where we used analytic expressions.

In addition to the mass-radius plots, it is instructive to analyse the results as in Figs. 4, 5, 6 and 7, were we show the difference in percentage between the f(R) and the GR solutions, for the mass and the radius of a star separately. In this way we observe that the effect of the \(R^2\) term on the radius of stars is generally smaller than on the mass, except for the lowest central-density regions. The shift in the mass is thus the main responsible of the change of the mass-radius ratios discussed above. The changes, moreover, are strongly dependent on the EoS; SLy, FPS and HS(TMA) exhibit large deviations with respect to GR, but the latter shows a qualitatively different behaviour as a function of the central density. For HS(DD2), the deviations with respect to GR are significantly smaller than for the other EoS, for both mass and radius.

It is clear from our discussion so far, that as long as the ambiguities in the EoS of neutron stars are not resolved, it is hardly possible to draw conclusions from mass and radius observations on the theory of gravity, as for a fixed f(R) (here, for a given \(\alpha \) value) the mass-radius relation changes dramatically for different EoS. However, it is still interesting to speculate how relevant would astrophysical observations be, if we knew the correct EoS of a neutron star. For example, the observation of the 2.2\(M_\odot \) neutron star MSP J0740+6620 [70] has been used as an argument to rule out certain EoS, including some used in this paper. This is can be seen in Fig. 8, where we show the constraints put by MSP J0740+6620 on EoS, assuming GR is the theory of gravity and also using \(f(R)=R+\alpha R^2\) with \(\alpha =-4\times 10^{9}\) cm\(^2\) (for which the increase of mass is the largest in our calculations). Clearly, some EoS can be rescued adding an \(R^2\) term to the theory of gravity. Reversing the argument, with increasing certainty in the EoS of neutron stars, observations could be used to constraint deviations of the theory of gravity from GR.

Fig. 8
figure 8

Maximum mass allowed by an \(f(R)=R+\alpha R^2\) theory with \(\alpha =-4\times 10^{9}\) cm\(^2\) for the different EoS used in this paper, compared with the observed mass of the MSP J0740+6620 neutron star

Fig. 9
figure 9

The EoS used in this paper (first panel) together with their first and second derivatives (second and third panel respectively)

Fig. 10
figure 10

Difference between the exact and numeric derivative for the first (upper panel) and second derivative (lower panel) of the EoS

Fig. 11
figure 11

Mass-radius relation for fake tabulated SLy EoS using the exact values for the derivative (left panel) and the values derived by the finite difference method (right panel)

At this point, we would like to discuss in some detail the differences in the results induced by the different methods used to calculate derivatives of the EoS in the case of tabulated data. To this end, we repeated the calculations with the analytic EoS SLy, this time generating tabulated data from the analytic expressions as follows. In one case, the derivatives were calculated analytically as outlined in Sect. 3 and separate data tables were generated from them; these values then had to be interpolated (in the same way as the EoS data is interpolated). As a second method we calculated the derivatives numerically with a finite difference approach, using second order central differences. In Fig. 10 the difference between the derivatives using those methods can be seen. While the difference for the first derivative is rather small and never exceeds \(4\%\), the second derivative shows very large differences, of about \(200\%\) which rises up to \(400\%\), at some points. To exemplify the impact of such differences in the mass-radius relations, we repeated the calculation for the SLy EoS with the different methods of calculating derivatives. The results are shown in Fig. 11. In the upper panel we show the calculation where the tabulated data for exact derivatives is interpolated, which clearly leads to the same results as when using the fully analytic version. However, in the lower panel, where the derivatives have been calculated with a finite difference method, shows only a minor difference between f(R) and GR, in fact in agreement with the results published in [48]. This discussion points to a potential problem appearing when calculating with tabulated EoS and theories with high-order derivatives of matter; all calculations that rely on numerical differentiation must be taken with due caution.

4.2 \(R+\alpha R^2+\beta Q\) case

We proceed now to discuss the results for the \(f(R,Q)=R+\alpha R^2+\beta Q\). As already indicated above, we consider values of \(\beta \) for which an appreciable change in the mass-radius curve is obtained. This means that, even the small changes in the stars masses that we observe, as discussed next, may be artificially large.

Fig. 12
figure 12

Mass-radius relation for \(f(R,Q)=R+\alpha R^2+\beta Q\) for SLY (upper panel) and FPS (lower panel) EoS

Fig. 13
figure 13

Mass-radius relation for \(f(R,Q)=R+\alpha R^2+\beta Q\) for HS(DD2) (upper panel) and HS(TMA) (lower panel) EoS

Fig. 14
figure 14

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2+\beta Q\) and GR, for the SLy EoS

Fig. 15
figure 15

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2+\beta Q\) and GR, for the FPS EoS

Fig. 16
figure 16

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2+\beta Q\) and GR, for the HS(DD2) EoS

Fig. 17
figure 17

Difference between the mass (upper panel) and the radius (lower panel) obtained, given a central density value \(\xi \), with \(f(R,Q)=R+\alpha R^2+\beta Q\) and GR, for the HS(TDA) EoS

Fig. 18
figure 18

Metric function M(r) as a function of the radial coordinate r, for a neutron star with a central density \(\xi _c = 15.1\) and the SLy EoS

We show in Figs. 12 and 13 the mass-radius relation for two values of \(\beta \), with and without the \(R^2\) term (here the \(R^2\) term is excluded by setting \(\alpha \) to a very small value, for computational convenience). The effect of the Q term appears to be generally small, the deviation from GR mostly coming from the \(R^2\) term as we have seen in the previous section. The effect of the Q term seems to be more pronounced for analytic EoS than for the tabulated ones, which may point to the problem with numerical derivatives that we discussed above.

As in the f(R) case, it is interesting to plot separately the differences between the f(RQ) and the GR solutions, for the mass and the radius of a star. We show them in Figs. 14, 15, 16, 17. In contrast to the \(R^2\) term, for which the dependence of the mass and radius as a function of the central density showed a very different qualitative behaviour for different EoS, in the case of the Q term these show a similar dependence on \(\xi _c\) for all studied EoS. In all four cases the effect is somewhere below \(5\%\) on the mass, with the exception of HS(DD2) which is up to \(8\%\) for low central densities. As for the \(R^2\) case, it is interesting to note that the Q terms influences the mass of the star much more than its radius, again with the exception of lowest values of the central density. In that region, the radius and mass effects compensate in a way such that they are not visible in the mass-radius plots.

To conclude, we wish to mention a peculiar feature of the solutions we obtained for f(R) gravities. In Fig. 18, we show a star profile (that is, the metric function M(r) as a function of the radial coordinate r) for the SLy EoS and \(\xi =15.1\). The metric function M(r) shows an unexpected cusp near the surface of the star. This feature, absent in GR, was already seen in [48] and predicted in [71] (see also [72]), where it was argued that it invalidates Palatini f(R) theories as physically viable. In [71] it was also speculated that a Q term may ameliorate this odd behaviour of the metric inside the star. As we see in Fig. 18, it is true that an f(Q) term (without \(R^2\)) does not show a cusp.Footnote 2 However, in an f(RQ) model (i.e. with both \(R^2\) and Q terms) the cusp remains; that is, the Q term is not able to compensate for the unexpected behaviour generated by the \(R^2\) term. Note that in [71] the authors argue that for nonlinear f(R) one always finds divergences at the surface of the star, which may in turn generate curvature divergences. For our numerical results, we have carefully investigated the appearance of divergences in all terms of the equations of structure (e.g. divergences in \(P_r\) or \(P_{rr}\) which may result, upon integration, in finite values of M(r)) but found none. From our calculations, thus, we can only conclude that the cusp in Fig. 18 is simply a dynamical effect with no clear relation to the arguments in [71]. Note finally that, even though in Fig. 18 we showed one particular solution only , in all cases we have studied in this paper the qualitative behaviour of the metric function M(r) was analogous.

5 Summary

In this paper we studied neutron stars solutions in Palatini \(f(R)=R+\alpha R^2\) and \(f(R,Q)=R+\alpha R^2+\beta Q\) gravities. We performed calculations using four different EoS and different values for \(\alpha \) and \(\beta \).

Our study shows that the differences in the masses and radius of stars induced by modifications of the gravity Lagrangian can in fact be as large as the uncertainty induced by the use of different EoS. Notably, it is the mass of the star and not its radius that is mostly affected by modifications of GR. We have also discussed separately the effect of the \(R^2\) and the Q terms. The deviations from GR induced by the \(R^2\) term are qualitatively different for different EoS. The Q term instead shows a similar behaviour for all EoS, and in general smaller than the effect from the \(R^2\) term.

Even though it was not a goal of our investigations, we found that some of the EoS which have previously been ruled out by neutron star observations, might become viable again if the \(\alpha R^2\) correction is indeed part of the right theory of gravity. For negative \(\alpha \) the maximum mass allowed by a given EoS tends to be increased. For some EoS, such as SLy or HS(TMA), it turns out that an \(\alpha R^2\) term can produce solutions as heavy as the MSP J0740+6620, the heaviest neutron star found so far [70].

To further highlight the relevance of studies like the present one it is interesting to mention the 2.6\(M_{\odot }\) secondary component of GW190814 [11]. Calculations using modified gravity theories indicate that it could be described as a neutron star (replacing MSP J0740+6620 as the heaviest known neutron star) Indeed, as shown in [49, 50] for metric \(f(R)=R+\alpha R^2\) gravities, it is possible for certain EoSs to support neutron stars in the 2.6\(M_{\odot }\) mass range. Interestingly, the authors showed that studying rotating stars also increases the maximum mass of neutron stars for those modified gravities. In this paper we observe a similar effect for Palatini \(f(R)=R+\alpha R^2\) and \(f(R,Q) = R+\alpha R^2 + \beta Q\), obtaining neutron star solutions in the 2.6\(M_{\odot }\) mass range for the HS(TMA) EoS (see Fig. 3). Alternatively, allowing a sufficiently negative value for \(\alpha \) also leads to neutron stars in this mass range when using other EoS, like the analytic SLy EoS.

In this work we focused on the relatively simple problem of calculating the mass, radius and profiles of spherically symmetric stars. In the future, it is necessary to perform more detailed studies. For example, it is crucial to study the stability of a solution in order to understand whether it is viable as a physical solution. For example, it could be that the solutions beyond the GR mass limit are unstable and hence not realised in Nature. This is an even more pressing issue, considering the odd behaviour of the metric function M(r) for f(R) theories, as discussed in last section. Also, realistic neutron stars rotate and the system of equations solved herein provides only an estimate of their properties. Finally, on the technical side, it is necessary to establish reliable and unambiguous methods to calculate high-order derivatives of EoS, as we have seen.

Clearly, no conclusive results can be obtained yet, at least until the ongoing efforts to nail down the EoS for a neutron star from first principles are successful. However, our study indicates that, in the future, astrophysical observations may serve as discriminators of modified gravity.