1 Introduction

Einstein’s theory of gravity proposed over a century ago not only aids us in understanding various aspects of the universe but also continues to undergo significant experimental testing. These tests include the precession of Mercury’s perihelion [1], accurately predicted, recent detections of gravitational waves originating from binary black hole systems [2], and neutron star (NS) mergers [3] observed by the Virgo and LIGO collaboration (Laser Interferometer Gravitational-Wave Observatory), along with the first image of a black hole’s shadow obtained by the Event Horizon Telescope project [4]. Consequently, the results predicted by General Relativity (GR) are in excellent agreement with observational data collected, primarily since the early 20th century.

Despite the success of GR, in recent years, there have been proposals for alternative theories of gravity, often referred in the literature as modified gravity theories [5,6,7]. Some of these theories seek to extend GR by introducing additional terms into the standard Einstein-Hilbert action. An example of this is f(R) gravity [8,9,10,11,12] and its various extensions [13,14,15], where R is the Ricci scalar. Some arguments in favor of these theories suggest that the rotation speed of spiral galaxies, represented by the rotation curve, could be explained without resorting to the presence of dark matter. Additionally, it is proposed that the accelerated expansion of the universe could be understood without the inclusion of dark energy, through the updating of the theory of gravity beyond GR [16,17,18,19,20,21]. Indeed, it is expected that the adopted gravitational model be capable of describing all available astronomical observations, among which NSs and quark stars (QSs) stand out.

The gravitational environments surrounding NSs, exotic stars, and the proximity of black hole event horizons pose unique challenges and offer singular opportunities [22,23,24]. Shaped by the immense mass and density of compact celestial objects, these extraordinary scenarios establish a unique platform where gravity manifests with unparalleled intensity. These environments evolve into observational arenas, allowing for the direct observation of gravitational forces to conduct theoretical tests of gravity.

Among all the observables of a compact star we have the mass, radius and the gravitational redshift. The mass and radius are very important, because these quantities can be obtained directly from different astronomical observations. In fact, their values offer significant information about the global structure of the star and, at the same time, we can obtain improved insights into the equation of state that governs the microscopic interior of the star. It is important to mention that the recent launched telescopes have more sensitivity and therefore it is possible to obtain more precise values for the mass and radius of a NS and strange quark stars. Moreover, thanks to this new technology it is possible to investigate the validity of GR (as well as its modifications) in the strong-field regime. Nowadays, it has become very common to explore the extreme physics of neutron stars taking into account the mass-radius window imposed by the data from the Neutron Star Interior Composition Explorer (NICER) [25], MM-Newton Data and the gravitational wave laser interferometers LIGO-VIRGO [3]. Therefore we can say that we are in a era where it is possible to use advanced observations to obtain more information about compact stars and the possible modifications of General Relativity.

In this study we will focus on \(f(R,L_m, T)\) theory of gravity [26], which generalizes and unifies the f(RT) and \(f(R,L_m)\) gravity models. In other words, this theory consistently impose that the gravitational Lagrangian is an arbitrary function of the Ricci scalar, the trace of the energy-momentum tensor and of the matter Lagrangian density. Particularly, we will adopt the \(f(R,L_m,T) = R+ \alpha TL_m\) model and investigate the effect of the free parameter \(\alpha \) on the most basic macroscopic properties of a compact star such as radius and mass. To do so, it becomes necessary to obtain the modified stellar structure equations for the two different choices of \(L_m\).

We will specifically examine the effects of \(f(R,L_m, T)\) theory on the internal structure of relativistic compact stars made of hadronic matter for NSs and quark matter for QSs. For this purpose in 2, we will, at first, give a little review of how the gravitational field equations are obtained in \(f(R,L_m, T)\) theory of gravity. Then in Sect. 3, from the field equations, we will obtain a modified version of the well-know Tolman-Oppenheimer-Volkoff (TOV) equations for the hydrostatic equilibrium state of a compact star. In Sect. 4 we will compute the mass versus radius relation and discuss our outcomes in terms of \(\alpha \). Finally, in Sect. 5, we give some remarks and some perspectives.

2 Gravitational field equations in \(f(R,L_m,T)\) theories

Proposed by Haghani and Harko [26] as a generalization and unification of the f(RT) [13] and \(f(R,L_m)\) [14] gravity models, the gravitational Lagrangian is given by an arbitrary function of the Ricci scalar R, of the trace T of the energy-momentum tensor \(T_{\mu \nu }\), and of the matter Lagrangian \(L_m\), so that \(L_{grav}=f(R,L_m,T)\). Thus, the full action in \(f(R,L_m,T)\) gravity theories reads

$$\begin{aligned} S = \frac{1}{16 \pi } \int f(R,L_m,T) \sqrt{-g} d^4x + \int L_m \sqrt{-g}d^4x, \end{aligned}$$
(1)

where g is the determinant of the metric tensor \(g_{\mu \nu }\), with Greek indices assuming the values \(0-3\). Throughout this work we will use geometrized units, that is, \(c = G = 1\) and we use the metric signature \((-,+,+,+)\). However, our results will be given in physical units for comparison purposes.

Now, varying the action 1 with respect to the inverse metric \(g^{\mu \nu }\), one obtains the following field equations in \(f(R,L_m,T)\) gravity

$$\begin{aligned}&f_RR_{\mu \nu } - \frac{1}{2} [f-(f_L + 2f_T)L_m] g_{\mu \nu } + (g_{\mu \nu }\Box -\nabla _{\mu } \nabla _{\nu })f_R \nonumber \\&\quad = \left[ 8\pi + \frac{1}{2}(f_L + 2f_T)\right] T_{\mu \nu } + f_T\tau _{\mu \nu }, \end{aligned}$$
(2)

in which \(\Box \equiv \partial _{\mu }(\sqrt{-g}g^{\mu \nu }\partial _{\nu })/\sqrt{-g}\), \(f_{R}\equiv \partial f/ \partial R\), \(f_{T}\equiv \partial f/ \partial T\), \(f_{L} \equiv \partial f/ \partial L_{m}\), \(R_{\mu \nu }\) is the Ricci tensor, \(\nabla _{\mu }\) the covariant derivative with respect to the symmetric connection associated to \(g_{\mu \nu }\), and the new tensor \(\tau _{\mu \nu }\) is defined as [26]

$$\begin{aligned} \tau _{\mu \nu } = 2g^{\alpha \beta } \frac{\partial ^{2}L_m}{\partial g^{\mu \nu } \partial g^{\alpha \beta }}. \end{aligned}$$
(3)

It is evident that, when \(f(R,L_m,T)=f(R)\), from Eq. (2) we retrieve the field equations in the framework of metric f(R) gravity [27, 28]. If \(f(R,L_m,T)= f(R,T)\), we reobtain the field equations of the f(RT) gravity model, while the particular case \(f(R,L_m,T)= f(R,L_m)\) gives the field equations of the \(f(R,L_m)\) theory. Furthermore, when \(f(R,L_m,T)= R\) (i.e., the Hilbert-Einstein Lagrangian), we recover the standard field equations in pure GR, namely, \(R_{\mu \nu }-(1/2)g_{\mu \nu }R = 8\pi T_{\mu \nu }\).

Taking into account the covariant divergence of the field equations (2), we find the non-conservation equation of the energy-momentum tensor \(T_{\mu \nu }\):

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu } =&\ \frac{1}{8\pi + f_m}\left[ \nabla _{\nu } (L_m f_m) - T_{\mu \nu } \nabla ^{\mu } f_m \right. \nonumber \\&\left. - A_\nu - \frac{1}{2}(f_T \nabla _\nu T + f_L \nabla _\nu L_m) \right] , \end{aligned}$$
(4)

where we have used the fact that \(\nabla ^\mu R_{\mu \nu }= \nabla _\nu R/2\) and the mathematical property \((\square \nabla _\nu - \nabla _\nu \square )\phi = R_{\mu \nu }\nabla ^\mu \phi \), valid for any scalar field \(\phi \). Moreover, we have defined

$$\begin{aligned} f_m&= f_T + \frac{1}{2}f_L ,&A_\nu&= \nabla ^\mu (f_T \tau _{\mu \nu }) . \end{aligned}$$
(5)

The trace of the field equations leads to a second-order differential equation given by

$$\begin{aligned} 3\square f_R+ Rf_R- 2(f- 2f_mL_m) = (8\pi + f_m)T + f_T\tau , \end{aligned}$$
(6)

with \(\tau \) being the trace of the tensor \(\tau _{\mu \nu }\). For the particular case \(f(R,L_m,T)=f(R)\), such an expression reduces to the widely known dynamical equation for the Ricci scalar in pure f(R) gravity theories [29, 30]. Notice that non-linear functions in R lead to a non-vanishing scalar curvature in the exterior region of a compact star. For the sake of simplicity, in this work we are focused on the algebraic function originally proposed in Ref. [26], i.e., \(f(R,L_m,T) = R + \alpha T L_m\), with \(\alpha \) being a matter-geometry coupling constant. In other words, our main task will be to investigate the impact of the \(\alpha T L_m\) term on the internal structure of NSs and QSs.

For the above mentioned functional form, Eqs. (2) and (4) reduce to

$$\begin{aligned} G_{\mu \nu }= \left[ 8 \pi + \frac{\alpha }{2}(T + 2 L_m) \right] T_{\mu \nu } + \alpha L_m(\tau _{\mu \nu }- L_mg_{\mu \nu }) , \end{aligned}$$
(7)

and

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }= & {} \frac{\alpha }{8 \pi +\alpha (L_m + T/2 )}\left[ \nabla _{\nu }\Big (L_m^{2} + \frac{1}{2}T L_m \Big )\right. \nonumber \\{} & {} \left. - T_{\mu \nu } \nabla ^{\mu } \Big (L_m + \frac{T}{2} \Big ) - \nabla ^\mu (L_m\tau _{\mu \nu })\right. \nonumber \\{} & {} \left. - \frac{1}{2}(L_m \nabla _{\nu }T + T \nabla _{\nu }L_m) \right] , \end{aligned}$$
(8)

respectively, where \(G_{\mu \nu }\) is the usual Einstein tensor. As expected, the Einstein field equations \(G_{\mu \nu }= 8\pi T_{\mu \nu }\) and conservation equation \(\nabla ^{\mu }T_{\mu \nu }= 0\) are recovered when \(\alpha = 0\). Later we will examine the non-conservative effects of Eq. (8) on the internal structure of compact stars.

In the next section, we are going to obtain the system of differential equations that describe the hydrostatic equilibrium state of compact stars for the two choices of perfect fluid matter Lagrangian [31, 32], i.e., \(L_m= p\) and \(L_m= -\rho \).

3 Modified TOV equations

We discuss here some of the main procedures that lead to the deduction of the hydrostatic equilibrium equation in the context of \(f(R,L_m,T)= R+ \alpha TL_m\) gravity model. To study compact stars, such as NSs, magnetars and other astrophysical structures, we assume these objects as being static (no rotation) and spherically symmetric stellar systems [33]. Thus, we must use the appropriate metric in a convenient coordinate system that describes the object being studied. The most general metric describing the spacetime geometry under this consideration is given by the line element

$$\begin{aligned} ds^{2}=-e^{\nu (r)}dt^{2}+e^{\lambda (r)}dr^{2}+r^{2}(d\theta ^{2}+\sin {\theta }^{2}d\phi ^{2}), \end{aligned}$$
(9)

where \(\nu \) and \(\lambda \) are radial functions that we want to determine based on the field equations (7).

In addition, we consider that the dense matter can be described as an isotropic perfect fluid represented by the following energy-momentum tensor:

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

with p and \(\rho \) representing the pressure and energy density of the fluid, respectively. The quantity \(U_{\mu }\) is the four-velocity, which satisfies the normalization condition \(U_{\mu }U^{\mu }= -1\), so it can be written as \(U^\mu = e^{-\nu /2}\delta _0^\mu \). This implies that \(T_\mu ^\nu = \text {diag} (-\rho , p, p, p)\) and \(T= -\rho + 3p\).

As we can observe in Eq. (3), \(\tau _{\mu \nu }\) depends on the matter Lagrangian density \(L_m\). Since there are two possibilities for the matter Lagrangian that lead to the energy-momentum tensor of a perfect fluid (10), i.e., \(L_m = p\) and \(L_m = -\rho \) (see Ref. [34] and references therein for further discussion), we have a degeneracy on the form of the field equations (7) which will have an impact on the stellar structure equations. We will adopt these two choices and analyze their implications on the main macroscopic properties of compact stars, such as mass and radius, in the context of \(f(R,L_m,T)\) gravity. Let us start with the possibility \(L_m = p\).

3.1 Stellar structure equations for \(L_m = p\)

Using \(L_m= p\), the field equations (7) reduce to

$$\begin{aligned} G_{\mu \nu } = \left[ 8\pi + \frac{\alpha }{2}(5p- \rho )\right] T_{\mu \nu } - \alpha p^2g_{\mu \nu } , \end{aligned}$$
(11)

and hence the 00 and 11 components are given respectively by

$$\begin{aligned} e^{-\lambda }\left( \frac{\lambda '}{r} - \frac{1}{r^2}\right) + \frac{1}{r^2}&= 8\pi \rho - \frac{\alpha }{2}(\rho - 5p)\rho + \alpha p^2, \end{aligned}$$
(12)
$$\begin{aligned} e^{-\lambda }\left( \frac{\nu '}{r} + \frac{1}{r^2}\right) - \frac{1}{r^2}&= 8\pi p + \frac{\alpha }{2}(3p - \rho )p, \end{aligned}$$
(13)

where the prime denotes differentiation with respect to the radial coordinate r. In addition to the field equations, the non-conservation equation of the energy-momentum tensor (8), for the index \(\nu =1\), becomes

$$\begin{aligned} p' + \frac{\nu '}{2}(\rho + p) = -\frac{\alpha p(p'-\rho ')}{16\pi + \alpha (5p - \rho )} . \end{aligned}$$
(14)

Similar to the pure general relativistic scenario, we redefine the metric function \(\lambda (r)\) as

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

where m(r) represents the gravitational mass within a sphere of radius r. Rearranging Eqs. (12)–(14), we get the differential equations required to describe static spherically symmetric stellar structures in the \(f(R, L_m,T)= R+ \alpha TL_m\) gravity model with \(L_m =p\), which are given by

$$\begin{aligned} \frac{dm}{dr}&= 4\pi r^{2}\rho +\frac{\alpha r^2}{2}\left[ \frac{\rho }{2}(5p - \rho ) + p^2 \right] , \end{aligned}$$
(16)
$$\begin{aligned} \frac{dp}{dr}&= -\frac{(\rho + p) \left[ 4\pi r p +\frac{m}{r^2} + \frac{\alpha r}{4}(3p-\rho )p \right] }{\Big (1 - \frac{2m}{r}\Big ) \left[ 1 + \frac{\alpha p}{16\pi + \alpha (5p - \rho )} \Big (1-\frac{d\rho }{dp}\Big ) \right] } , \end{aligned}$$
(17)

where we have considered a barotropic EoS in the form \(p= p(\rho )\), so that \(\rho ' = (d\rho /dp)p'\).

3.2 Stellar structure equations for \(L_m = -\rho \)

In this case, Eq. (7) becomes

$$\begin{aligned} G_{\mu \nu } = \left[ 8\pi + \frac{3\alpha }{2}( p- \rho )\right] T_{\mu \nu } - \alpha \rho ^2 g_{\mu \nu } , \end{aligned}$$
(18)

so that its 00 and 11 components are

$$\begin{aligned} e^{-\lambda }\left( \frac{\lambda '}{r} - \frac{1}{r^2}\right) + \frac{1}{r^2}&= 8\pi \rho + \frac{\alpha }{2}(3p-\rho )\rho , \end{aligned}$$
(19)
$$\begin{aligned} e^{-\lambda }\left( \frac{\nu '}{r} + \frac{1}{r^2}\right) - \frac{1}{r^2}&= 8\pi p + \frac{3\alpha }{2}(p -\rho )p - \alpha \rho ^2 . \end{aligned}$$
(20)

On the other hand, from the non-conservation equation of the energy momentum tensor (8), we obtain

$$\begin{aligned} p' + \frac{\nu '}{2}(\rho + p) = \frac{\alpha \left[ 4\rho \rho '+ 3p(\rho '- p') \right] }{16\pi + 3\alpha (p - \rho )} . \end{aligned}$$
(21)

Similarly to the previous case, in view of Eqs. (19)–(21), the modified TOV equations for the matter Lagrangian \(L_m= -\rho \) take the form

$$\begin{aligned} \frac{dm}{dr}&= 4\pi r^2\rho + \frac{\alpha r^2}{4}(3p- \rho )\rho , \end{aligned}$$
(22)
$$\begin{aligned} \frac{dp}{dr}&= -\frac{(\rho + p) \left[ 4\pi r p +\frac{m}{r^2} + \frac{3\alpha r}{4}(p-\rho )p - \frac{\alpha r}{2}\rho ^2 \right] }{\Big (1 - \frac{2m}{r}\Big )\left\{ 1 + \frac{\alpha \left[ 3p(1-d\rho /dp) - 4\rho (d\rho /dp) \right] }{16\pi + 3\alpha (p - \rho )} \right\} } . \end{aligned}$$
(23)
Fig. 1
figure 1

Radial behavior of the mass distribution m, pressure p and non-conservative term X for neutron stars with \(L_m= p\) (left panel) and quark stars with \(L_m= -\rho \) (right panel). In both panels we have considered the same central density value \(\rho _c= 1.5\times 10^{15}\, \mathrm g/cm^3\). Furthermore, for the free parameters we have adopted different ranges, i.e., \(\alpha \in [-3.0, 3.0]\mu _1\) for \(L_m= p\) and \(\alpha \in [-1.5, 1.5]\mu _2\) for \(L_m= -\rho \). For hadronic matter, the main consequence of the \(\alpha TL_m\) term is a decrease in the total mass \(m(r_\textrm{sur})\) and an increase in the radius \(r_\textrm{sur}\) as \(\alpha \) increases from its negative values. On the other hand, for quark matter, both the total mass and radius decrease with increasing \(\alpha \)

For both choices of the matter Lagrangian density, the modified TOV equations will be solved from the center at \(r=0\) to the surface of the star at \(r= r_\textrm{sur}\) satisfying the boundary conditions:

$$\begin{aligned} m(0)&= 0,&\rho (0)&= \rho _c , \end{aligned}$$
(24)

where \(\rho _c\) is the central energy density and \(r_\textrm{sur}\) is determined when the pressure vanishes. In this way, the total gravitational mass of the compact star will be given by \(M\equiv m(r_\textrm{sur})\). Given a specific EoS for dense matter, we will next construct the mass-radius diagrams for both sets of differential equations.

4 Results

Here, we will discuss the impact of \(f(R,L_m,T)\) theory on the internal structure of relativistic compact stars. At first we investigate the case \(L_m = p\) and then the case \(L_m = -\rho \), where the free parameter for both theories is \(\alpha \). All our numerical results are therefore shown in terms of \(\alpha \), which is given in \(\mu _1= 10^{-78}\, \mathrm s^4/kg^2\) units (i.e., \(1.46\times 10^{10}\, \mathrm m^2\) in geometric units) for \(L_m= p\) and \(\mu _2= 0.1\mu _1\) for the second choice \(L_m= -\rho \). Of course, the solutions for \(\alpha =0\) correspond to pure Einstein gravity.

Fig. 2
figure 2

Gravitational mass as a function of radius (left side) and central density (right side) for NSs in \(f(R,L_m,T) = R + \alpha TL_m\) modified gravity using the IUFSU model, where the particular case \(\alpha = 0\) corresponds to the pure GR solutions. The numerical results in the top row correspond to \(L_m= p\), where \(\alpha \) is given in \(\mu _1= 10^{-78}\, \mathrm s^4/kg^2\) units (which in geometric units assumes the value \(1.46\times 10^{10}\, \mathrm m^2\)). Meanwhile, in the lower row we have chosen \(L_m= -\rho \), with \(\alpha \) given in \(\mu _2 = 10^{-79}\, \mathrm s^4/kg^2\) units. The cyan region represents the NS in the quiescent low mass X-ray binary (LMXB) NGC 6397 [42,43,44]. The blue and red lines stand for the massive NS pulsars J1614-2230 [45] and J0348+0432 [46], respectively. The radius of PSR J0740+6620 (which has a gravitational mass of \(2.08 \pm 0.07\, M_\odot \)) from NICER and XMM-Newton Data [25] is indicated by the green top dot with their respective error bars. Moreover, the orange bottom dot represents the radius estimate for a \(1.4\, M_\odot \) NS [25]

As input for the equations of stellar hydrostatic equilibrium, we utilized two realistic equations of state (EoS). The first one is derived from a relativistic mean-field approach, known as the IU-FSU parameterization [35]. We opted for this parameterization due to its satisfactory capability in explaining both nuclear properties [36] and stellar matter properties [37]. To describe the crust of neutron stars (NSs), we adopted the complete EoS proposed by Baym, Pethick, and Sutherland (BPS) [38]. Subsequently, we compared the results obtained with the IU-FSU with those derived from an EoS for quark matter. Specifically, we employed the MIT bag model [39]. For a more extensive and didactic explanation on the EoS, we refer the reader to Refs. [40, 41] and references therein.

Fig. 3
figure 3

Mass-radius diagrams (left) and mass versus central density (right) for QSs with MIT bag model EoS in \(f(R,L_m,T) = R + \alpha TL_m\) gravity, where several values of \(\alpha \) have been considered. As in Fig. 2, the top and bottom rows correspond to \(L_m= p\) and \(L_m= -\rho \), respectively

Given a specific central density \(\rho _c= 1.5\times 10^{15}\, \mathrm g/cm^3\), we begin our analysis by solving the stellar structure equations (16) and (17) for hadronic matter, where we vary the theory parameter in the range \(\alpha \in [-0.3, 0.3]\mu _1\). This solution is shown in the left panel of Fig. 1, where we observe that the mass profile (top plot) is strongly affected by \(\alpha \) near the surface of the NS, while the pressure (middle plot) undergoes substantial changes only in the intermediate region. As a result, the mass M increases (decreases) as \(\alpha \) becomes more negative (positive). Note further that the radius of the star grows with increasing \(\alpha \) from its negative values. However, as we will see below in the \(M-\rho _c\) relations, this behavior can be reversed depending on the value of \(\rho _c\).

From Eq. (8), it is evident that the null covariant divergence of the energy-momentum tensor is not achieved in \(f(R,L_m,T)\) gravity. In order to explore the non-conservative effects of this theory on the stellar structure, we will do a graphical analysis of the right-hand term of Eq. (8). For the matter Lagrangian density \(L_m= p\), such term becomes

$$\begin{aligned} X_1 = -\frac{\alpha p(p'-\rho ')}{16\pi + \alpha (5p - \rho )} , \end{aligned}$$
(25)

as can be seen in Eq. (14). The lower left plot of Fig. 1 illustrates the magnitude of non-conservative effects along the radial coordinate of the NS. As expected, such effects become stronger as \(\vert \alpha \vert \) increases. In particular, \(X_1(r)\) indicates that the violation of the conservation of energy-momentum tensor has a greater repercussion in the intermediate zone, while its impact is irrelevant both at the center and at the surface of the star.

Similarly, we obtain the solution of the modified TOV equations for \(L_m= -\rho \), namely, Eqs. (22) and (23). Considering the same central density value, the right plot of Fig. 1 displays the radial profile of the mass, pressure and non-conservative term for quark matter. In this case, the non-conservative effects are quantified by

$$\begin{aligned} X_2= \frac{\alpha \left[ 4\rho \rho '+ 3p(\rho '- p') \right] }{16\pi + 3\alpha (p - \rho )} , \end{aligned}$$
(26)

obtained from Eq. (21). It is observed that both the mass and the radius of the quark star decrease with the increase of the parameter \(\alpha \), which is varied in the interval \(\alpha \in [-1.5, 1.5]\mu _2\). The non-conservative impact, measured through \(X_2\), on the star has a similar behavior to \(X_1\), however, it is no longer zero at the surface. This last characteristic in \(X_2\) is due to the fact that the energy density is not zero at the surface of a quark star. As a consequence, given a central density, we can conclude that the internal structure of a compact star is strongly modified as the non-conservative effects are intensified by increasing \(\vert \alpha \vert \).

For hadronic matter EoS in Fig. 2, we have selected the IUFSU model for both choices of the matter Lagrangian density \(L_m\). We observe for the first case (upper row), that an increase for positive \(\alpha \) leads to a decrease in the maximum-mass values with respect to the GR counterpart. On the other hand, for sufficiently negative values of \(\alpha \) (see brown curves), it is not possible to reach the critical NS since the curve continues to grow. Concerning the radius of the star, \(r_\textrm{sur}\) is strongly affected by the presence of the \(\alpha TL_m\) term for both positive and negative values of \(\alpha \). According to the \(M-\rho _c\) relation (see right panel), the gravitational mass undergoes large alterations for central densities above \(10^{15}\, \mathrm g/cm^3\), while the changes are irrelevant below this value of \(\rho _c\). In addition, the lower row of Fig. 2 presents the results for \(L_m= -\rho \), where we can observe the strong impact of \(\alpha \) on the mass and radius for the full range of central densities. Specifically, regardless of the value of \(\rho _c\), the gravitational mass increases (decreases) for negative (positive) \(\alpha \). Unlike the first choice, here it is always possible to obtain a critical configuration, that is, a NS of maximum mass on the \(M-\rho _c\) curve. Another peculiar and interesting feature of this choice is that the radius does not decrease (and on the contrary, only increases as \(\rho _c\) increases) when positive \(\alpha \) is large enough in the small-mass region (i.e., when \(M\lesssim 0.3\, M_\odot \)), see for example the curve obtained for \(\alpha = 0.4\mu _2\).

In Fig. 3 we exhibit our results for quark stars adopting the MIT bag model EoS. For \(L_m= p\), we have a behavior similar to the NS case, that is, the mass decreases (increases) slightly for negative (positive) \(\alpha \) in the low-central-density region, however, this behavior is inverted after a certain value of \(\rho _c\). Indeed, it is observed that the greatest modifications take place when \(\rho _c \gtrsim 10^{15}\mathrm g/cm^3\). On the other hand, for quark stars with \(L_m= -\rho \), the effects of \(\alpha \) on the \(M-r_\textrm{sur}\) relation are irrelevant at small masses. Nonetheless, the modifications induced by \(\alpha \) become significant when \(M \gtrsim 1.2\, M_\odot \).

For hadronic stars, and case \(L_m =p\) we can see that the results for massive stars adjust better with the constraints of the low mass -ray binary (LMXB) NGC 6397 [42,43,44], but the case \(L_m= -\rho \) has more models outside the constrains, specifically models for positive \(\alpha \). On the other this type of constraint offer useful information for stars below approximately 2.0 \(\textrm{M}_{\odot }\), in specific for stars of 1.4 \(\textrm{M}_{\odot }\). For the case of quark stars the behavior repeats in a more strongly way. Note further that, for hadronic stars, considering the case of \(L_{m} =p\), our findings show that for negative values of \(\alpha \) results are compatible with the massive NS pulsars J1614-2230 [45] and J0348+0432 [46], contrarily to the case of positive values of \(\alpha \), which not satisfy the constraints. In the case of quark stars only the cases of negative \(\alpha \) satisfy the constraints from J1614-2230 and J0348+0432.

For an isolated static spherical star, described by the line element (9), the surface gravitational redshift establish a relation between mass and radius, namely \(z_\textrm{sur}= (1- 2M/r_\textrm{sur})^{-1/2} - 1\). Here, we can also calculate the gravitational redshift of light emitted at the surface of the compact stars belonging to the several sequences shown in Figs. 2 and 3. For hadronic matter, Fig. 4 exhibits the behavior of \(z_\textrm{sur}\) as a function of mass for for both choices of \(L_m\). As expected, due to the peculiar behavior of the different curves in the \(M-r_\textrm{sur}\) diagrams, the redshift is strongly affected by the theory parameter \(\alpha \) when \(L_m= p\) for sufficiently high masses, while the changes are smaller for \(L_m= -\rho \). Note further that the redshift behaves similarly for quark stars, as shown in Fig. 5.

Fig. 4
figure 4

Surface gravitational redshift \(z_\textrm{sur}\) plotted against the total mass M for neutron stars in \(f(R,L_m,T)\) gravity with both choices of \(L_m\). We have considered the same range for \(\alpha \) as in Fig. 2, where \(\alpha = 0\) (black curve) gives the redshift of the configuration sequence in pure Einstein gravity

Fig. 5
figure 5

Gravitational redshift of light emitted at the surface of quark stars as a function of the gravitational mass for the same values of \(\alpha \) as adopted in Fig. 3. Remark that in the case \(L_m= -\rho \), the redshift deviates substantially from the GR results only for high masses

5 Final remarks

In summary, in this work we have investigated the phenomenology of compact stars within the framework of \(f(R,L_m,T)\) gravity theories, focusing on the specific functional form \(f(R,L_m,T) = R + \alpha TL_m\). The gravitational field equations for this functional form were outlined, and the non-conservation equation for the energy-momentum tensor was derived. In addition, we have considered two choices for the matter Lagrangian density, namely \(L_m = p\) and \(L_m = -\rho \), and examined their impact on the equilibrium structure of relativistic compact stars. The modified stellar structure equations have been derived separately for the two adoptions of \(L_m\), so that the conventional TOV equations are retrieved when \(\alpha = 0\).

This study began with an introduction emphasizing the relevance of testing GR in extreme environments, such as NSs, and then introduced the \(f(R,L_m,T)\) gravity model. The central idea was to examine the deviations introduced by the \(\alpha TL_m\) term with respect to the GR counterpart when analyzing the most basic properties of a compact star. For two realistic EoSs of dense matter (IUFSU and MIT bag model), the resulting mass-radius diagrams were analyzed for various values of the free parameter \(\alpha \). As a result, our findings indicate that the parameter \(\alpha \) has a significant impact on the mass-radius relations for both NSs and QSs. We have also explored the influence of \(\alpha \) on the surface gravitational redshift for the different equilibrium configuration sequences.

Specifically, for \(L_m =p\), our outcomes have revealed that \(\alpha \) has a prominent effect on the gravitational mass for \(\rho _c \gtrsim 10^{15}\, \mathrm g/cm^3\), while the changes are irrelevant for central densities below this value. The maximum mass decreases as a consequence of using positive values of \(\alpha \), however, it is not possible to reach a maximum-mass point (i.e., a critical configuration) when \(\alpha \) is sufficiently negative. On the other hand, in the case of hadronic stars with \(L_m =-\rho \), both the radius and the mass suffer significant deviations from their general relativistic value throughout the range of central densities, which does not happen for \(L_m=p\). We can conclude therefore that each choice of \(L_m\) has a noticeably different influence on the radius and mass of compact stars composed of hadronic matter and quark matter. Similarly to the results reported in previous studies in the strong-field regime [47,48,49,50,51,52,53,54], here we have shown that the non-conservative effects (product of the modification of conventional GR) play an important role within compact stars in \(f(R,L_m,T)\) gravity theories.

We also confronted our results with the modern astrophysical constraint: the neutron star in the quiescent low mass X-ray binary (LMXB) NGC 6397 [42,43,44]. We observe that all our models and chosen parameters can satisfy this important constraint. Note further that our findings for sufficiently negative values of \(\alpha \) are compatible with the massive NS pulsars J1614-2230 [45] and J0348+0432 [46]. Remarkably, our mass-radius predictions for the choice \(L_{m}= -\rho \) using hadronic matter favors the description of the pulsar PSR J0740+6620 from NICER and XMM-Newton Data [25], while the choice \(L_m =p\) does not provide consistent results with this observational measurement. Note further that the EoSs adopted in this study do not provide maximum masses above \(2M_\odot \) in pure Einstein gravity, however, \(f(R,L_m,T) = R+ \alpha TL_m\) gravity with \(\alpha \) sufficiently negative favors the description of different massive millisecond pulsars with masses greater than two solar masses. Thus, this work contributes to the understanding of the impact of \(f(R,L_m,T)\) gravity on the internal structure of compact stars and provides valuable insights for future investigations in the field.