1 Introduction

The unexpected discovery of the accelerating behavior of the Universe [1,2,3,4,5], that began at a redshift z of around \(z\approx 0.6\), brought into question the very foundations of the most successful gravitational theory developed so far, general relativity. The simplest answer to explain the late time acceleration is to resort again to the old cosmological constant \(\Lambda \), which was introduced by Einstein to build the first general relativistic cosmological model [6]. Based on this ansatz, and strongly supported by the excellent fits a cosmological constant provide to the observations, the standard model of cosmology, called the \(\Lambda \)CDM paradigm, was established, which also requires the existence of another intriguing (and yet undetected) constituent of the Universe, called dark matter [7]. The \(\Lambda \)CDM model describes well observations [8,9,10,11], however, it is confronted with a major problem: no fundamental physical theory can give a reason for it. The main problem arises from the difficulties encountered in explaining the nature and origin of the cosmological constant [12,13,14]. A popular explanation for \(\Lambda \) as a Planck-scale vacuum energy density \(\rho _{vac}\) leads to the “worst prediction in physics” [15], since \(\rho _{vac}\approx \left( \hbar /c\right) \int _{k_{dS}}^{k_{Pl}}{\sqrt{k^2+\left( mc/\hbar \right) ^2}d^3k}\approx \rho _{Pl}=c^5/\hbar G^2=10^{93}\; \mathrm{g/cm^3}\), a predictions that differs by a factor of around \(10^{-120}\) from the observed value of the cosmological constant, \(\rho _{\Lambda }=\Lambda c^2/8\pi G\approx 10^{-30}\;\mathrm{g/cm^3}\) [10].

Actually, the \(\Lambda \)CDM model can fit the cosmological observational data at a very high level of precision. Additionally, it is a very simple (empirical in some sense) general relativistic theoretical approach to cosmology. However, even at the observational level it faces some important problems, the most important being the “Hubble tension”, representing the significant differences between the values of the Hubble constant, \(H_0\), as determined from the CMB measurement [11], and those obtained from direct measurements in the local Universe [16,17,18]. For example the SH0ES measurement of \(H_0\) give \(H_0 = 74.03 \pm 1.42\) km/s/Mpc [16], while from the early Universe measurement of the Planck satellite one finds \(H_0 = 67.4 \pm 0.5\) km/s/Mpc [10], results which differ by \(\sim 5\sigma \).

On the other hand, important theoretical questions cannot be also answered in the framework of the \(\Lambda \)CDM paradigm. Why it happens that the numerical value of the cosmological constant is extremely small? Why is its value adjusted so fine? What determined the Universe to begin to accelerate only recently, after a long decelerating phase? And, after all, is a cosmological constant really necessary for theoretical and observational cosmology? Hence, the present day observational situation of cosmology strongly requires the exploration of alternative pathways for the understanding of the gravitational interaction, and its influence on the dynamics of the Universe. In fact, one can distinguish (at least) three possible theoretical approaches as substitutes of the \(\Lambda \)CDM paradigm.

The first avenue leading to an alternative description of cosmological evolution may be called the dark constituents model. It is based on the generalization of the Einstein gravitational field equations through the addition of two new terms in the total energy momentum tensor of the Universe, which describe dark energy and dark matter, respectively. In this approach gravitational phenomena are described by the generalized field equation [19]

$$\begin{aligned} G_{\mu \nu }= & {} \kappa ^2 T^{\mathrm{bar}}_{\mu \nu }+\kappa ^2T^{\mathrm{DM}}_{\mu \nu }(\phi , \psi _{\mu },\ldots )\nonumber \\&+\kappa ^2T^{\mathrm{DE}}_{\mu \nu }(\phi , \psi _{\mu },\ldots ), \end{aligned}$$
(1)

where \(G_{\mu \nu }\) is the Einstein tensor, \(T^{\mathrm{bar}}_{\mu \nu }\), \(T^{\mathrm{DM}}_{\mu \nu }(\phi , \psi _{\mu },\ldots )\), and \(T^{\mathrm{DE}}_{\mu \nu }(\phi , \psi _{\mu },\ldots )\) denote the energy–momentum tensors of baryonic matter, dark matter and dark energy, respectively. In this approach dark energy is understood as a form of matter, an interpretation based on the equivalence between mass and energy in the theory of relativity. Both the energy–momentum tensors of dark matter and dark energy can be constructed from some scalar or vector fields. The simplest dark constituent model can be obtained by assuming that dark energy is a scalar field \(\phi \) with a self-interaction potential \(V(\phi )\). Hence the action of the gravitational theory becomes \(S=\int {\left[ M_{Pl}^2R/2-\left( \partial \phi \right) ^2-V(\phi )\right] \sqrt{-g}d^4x}\), leading to so-called quintessence models [20,21,22,23,24,25]. Other dark constituent models are k-essence models [26,27,28], tachyon field models [28, 29], models considering phantom fields [30,31,32], or quintom field models [33,34,35], respectively. In [25] it was pointed out that quintessence always lower \(H_0\) relative to the \(\Lambda \) CDM model, thus making the Hubble tension worse. Chameleon field [36,37,38,39,40], Chaplygin gas [41, 42] and vector field [43,44,45] dark energy models have also been investigated. Notwithstanding its impressive success, the dark constituents avenue is still confronted with its own intrinsic problems, the most important being the lack of any direct experimental evidence for the existence of dark matter. Furthermore, the existence of so many distinct field type models for dark energy, each one facing its own theoretical problems, leads to the problem of the existence of a single, theoretically consistent field theoretical picture of the major components of the Universe. For reviews of the dark energy models see [46,47,48,49].

The second pathway to gravitational phenomena is the so-called dark gravity approach. The dark gravity avenue, going beyond the Einsteinian perspective, is based on a purely geometrical description of the gravitational phenomena, with their dynamics and evolution explained as a result of the modification of the geometric format of the Einstein field equations. In the dark gravity approach, the Einstein equations are generally formulated as

$$\begin{aligned} G_{\mu \nu }=\kappa ^2T_{\mu \nu }^{(mat)}+\kappa ^2 T_{\mu \nu }^{(\mathrm geom)}\left( g_{\mu \nu }, R, \square R,\ldots \right) , \end{aligned}$$
(2)

where \(T_{\mu \nu }^{(mat)}\) is the matter energy–momentum tensor, while \(T_{\mu \nu }^{(\mathrm geom)}\left( g_{\mu \nu }, R, \square R,\ldots \right) \), playing the role of an effective energy–momentum tensor, is a geometric quantity, constructed entirely from the metric. \(T_{\mu \nu }^{(\mathrm geom)}\left( g_{\mu \nu }, R, \square R,\ldots \right) \) may mimic dark energy, dark matter, or both. An important example of dark gravity is the f(R) theory, introduced initially in [50], and developed in its early stages in [51,52,53,54]. In f(R) gravity theory the standard Hilbert–Einstein action \(S=\int {\left( R/\kappa ^2+L_m\right) \sqrt{-g}d^4x}\) is replaced by a more general action given by \(S= \int {\left[ f(R)/\kappa ^2+L_m\right] \sqrt{-g}d^4x}\), where f(R) is an arbitrary analytical function of the Ricci scalar R. The astrophysical and cosmological implications of the f(R) gravity have been extensively investigated [55,56,57,58,59,60,61,62,63,64,65,66,67,68,69]. The first internally consistent f(R) gravity model, describing both inflation, as well as present day dark energy, was constructed in [64]. Another geometric theory, the hybrid metric-Palatini gravity theory [70,71,72,73] extends and unifies two geometric formalisms, the metric and the Palatini ones, respectively. Theories involving geometric structures that go beyond the Riemannian one, like, for example, Weyl geometry, have also been investigated [74,75,76,77,78,79,80,81,82,83,84]. For reviews of modified gravity theories, and their applications, see [85,86,87,88,89].

A third way for understanding gravitation has also been developed, which we may call the dark coupling approach. The basic idea of this approach is the substitution of the standard Hilbert–Einstein Lagrangian density, which has a simple additive structure in curvature and matter Lagrangian, with a more general algebraic system. In this way the maximal extension of the standard Hilbert–Einstein gravitational Lagrangian can be established by considering that the gravitational action is an arbitrary analytical function of the curvature scalar R, of the matter Lagrangian \(L_m\), and, possibly, of other thermodynamic parameters. This approach leads naturally to the existence of a nonminimal coupling between geometry and matter. Many types of coupling between matter and geometry are possible, including the coupling between the Ricci scalar and the trace of the matter energy–momentum tensor.

Therefore, in the dark coupling approach, the Einstein gravitational equations can be extended to the form

$$\begin{aligned} G_{\mu \nu }= & {} \kappa ^2T_{\mu \nu }^{(mat)} + \kappa ^2 T_{\mu \nu }^{(\mathrm coup)}\left( g_{\mu \nu }, R, L_m, T, \square R, \square T,\ldots \right) ,\nonumber \\ \end{aligned}$$
(3)

with the effective energy–momentum tensor of the theory \(T_{\mu \nu }^{(\mathrm coup)}\left( g_{\mu \nu }, R, L_m, T, \square R, \square T,\ldots \right) \) is obtained by considering generally the maximal extension of the Hilbert–Einstein Lagrangian, and by introducing a non-additive geometry-matter algebraic structure that describes the couplings between matter in all its forms, and space-time curvature, respectively. It is important to mention that in both dark gravity and dark coupling theories the gravitational constant \(\kappa ^2\) turns into an effective quantity, generally a function of the couplings, and of the field parameters.

The dark coupling type theories were initiated in [90], where a gravitational action of the form \(S=\int [f_1(R)+\left( 1+\lambda f_2(R)\right) L_m ]\sqrt{-g}d^4x\) was investigated. This action was extended in [91], finally leading to the \(f\left( R,L_m\right) \) gravity theory [92], with the gravitational action given by an arbitrary function of the Ricci scalar and of the matter Lagrangian, \(S=\int {f\left( R,L_m\right) \sqrt{-g}d^4x}\). Different astrophysical and cosmological applications of the \(f\left( R,L_m\right) \), as well as fundamental aspects of the theory were considered in [93,94,95,96,97,98,99,100,101,102,103].

An alternative possibility of coupling between matter and geometry is described by the f(RT) gravity theory [104], in which the trace of the matter energy–momentum tensor is nonminimally coupled to geometry, with the action given by \(S=\int {\left[ f\left( R,T\right) +L_m\right] \sqrt{-g}d^4x}\). The astrophysical and cosmological implications of f(RT) theory were investigated in detail in [105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130].

The viability of the f(RT) cosmological models were discussed in [116] for a Lagrangian density of the form \(f(R, T) = R + \lambda T + \gamma _nT^n\), where \(\gamma _n\) and n are constants. Several models were considered, corresponding to different values of the model parameters, and confronted with the H(z) data and Supernovae data. The H(z) comparison indicates consistency with \(\Lambda \)CDM at low redshifts, but a significant deviation of the models from the standard scenario does appear when going to higher redshifts. Similar pathological behaviors also show up in the dynamics of the deceleration parameter of the models, leading to universes where a transition from a decelerating phase to an accelerated one does not exist. The existence of such a transition is a basic requirement for any cosmological model compatible with the observational data. However, one can find models with transitions from deceleration to acceleration transition, but the predictions of these models are not in agreement with both the H(z) and Supernovae data at higher redshift regimes. On the other hand, at lower redshifts there is a good concordance between model and data. These results indicate the difficulties faced by the considered version of the f(RT) theory in correctly representing the cosmological evolution in its entirety.

A detailed analysis of the cosmological model based on the field equations \(R_{\mu \nu }-(1/2)Rg_{\mu \nu }=[(8\pi +\lambda )/\lambda ]T_{\mu \nu }+(p+T/2)g_{\mu \nu }\) was performed in [120]. The maximum likelihood analysis was used to obtain the constraints on the Hubble parameter \(H_0\) and the model parameter by taking into account the observational Hubble data set H(z), the Union 2.1 compilation data set SNeIa, the Baryon Acoustic Oscillation data BAO, and the joint data set H(z) + SNeIa and H(z) + SNeIa + BAO, respectively. It was found that the model is in good agreement with these observations.

An extension of the f(RT) gravity theory by introducing higher derivatives matter fields was proposed in [131], based on an action of the form \(S=(1/16\pi )\int f(R,T,\Box T)\sqrt{-g}d^4x+\epsilon \int {L_m\sqrt{-g}d^4x}\), where \(\epsilon =\pm 1\). Accelerated evolution does appear in this scenario in the dust-filled Universe without any additional matter sources. The inflationary model is also in quite good agreement with observations.

Gravitational theories in which the Ricci scalar is coupled to the square of the energy–momentum tensor \(T^2=T_{\mu \nu }T^{\mu \nu }\), with action of the form \(S=\int {f\left( R,T^2\right) \sqrt{-g}d^4x}\) were analyzed in [132,133,134,135,136]. Theoretical models involving couplings between the Ricci tensor \(R_{\mu \nu }\) and the energy momentum tensor \(T^{\mu \nu }\), extending the action of the standard f(RT) theory to an action of the form \(S=\left( 1/8\pi G\right) \int {\left[ f\left( R,T, R_{\mu \nu }T^{\mu \nu }\right) +L_m\right] \sqrt{-g}d^4x}\) were introduced and discussed in [137,138,139]. Derivative matter couplings are also considered in [140, 141], where the Galileon interactions are promoted to contain matter Lagrangians. Nonminimal couplings between nonmetricity and matter were investigated in [142,143,144,145]. For reviews and detailed discussions on the gravitational theories with geometry-matter coupling see [146] and [147], respectively.

It is the goal of the present paper to extend, generalize, and at the same time unify two classes of gravitational theories with geometry-matter coupling, namely, the \(f\left( R,L_m\right) \) and the f(RT) theories, respectively. Hence we will consider a gravitational theory in which matter is non-minimally coupled with geometry at both the levels of the matter Lagrangian \(L_m\), and of the trace of the energy–momentum tensor T, with Lagrangian density given by \(f\left( R,L_m,T\right) \). This theory has as limiting cases the f(R), \(f\left( R,L_m\right) \) and f(RT) gravity theories, respectively.

After introducing the gravitational action, as a first step in our study, we obtain the gravitational field equations of the theory. The energy and momentum balance equations are also obtained, and, as usual in theories with geometry-matter coupling, it turns out the matter energy–momentum tensor is not conserved anymore. The Newtonian limit of the equations of motion is investigated in detail, and the expression of the extra-acceleration is obtained for small particle velocities and weak gravitational fields. The Dolgov–Kawasaki instability is investigated in detail, and the condition for the existence of stable perturbations is obtained. The cosmological applications of the theory are also investigated. We consider two particular choices of the Lagrangian density \(f\left( R,L_m,T\right) \) of the field, having a multiplicative and additive algebraic structure in the matter couplings. We also investigate the effects of the two possible different choices of the matter Lagrangian (\(L_m=p\) and \(L_m=-\rho \), respectively) on the description of the cosmological evolution.

The present paper is organized as follows. The gravitational field equations of the \(f\left( R,L_m,T\right) \) theory are obtained in Sect. 2. The divergence of the matter energy–momentum tensor is derived in Sect. 3. The energy and momentum balance equations are also presented, and it is shown that the equation of motion of test particles is not geodetic, but it takes place in the presence of an extra-force. The Newtonian limit of the equation of motion is investigated by using a variational approach, and the general expression of the extra-acceleration is obtained in the limit of small velocities. The generalized Poisson equation for the Newtonian gravitational potential is also derived. The Dolgov–Kawasaki instability of the theory is analyzed in Sect. 4, and the condition for obtaining stable perturbations is found. The cosmological implications of the theory are examined in Sect. 5, for two specific choices of the function \(f\left( R,L_m,T\right) \), which assumes a multiplicative and an additive form in the matter couplings. The cosmological evolution equations are studied for the two forms of the matter Lagrangian, \(L_m=-\rho \), and \(L_m=p\), respectively. The possibility of the existence of a de Sitter type phase for the models is explored. We discuss and conclude our results in Sect. 6.

2 Field equations of \(f\left( R,L_m,T\right) \) gravity

We assume that the action describing the modified gravity theory with strong geometry-matter coupling takes the form

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

where \(f\left( R,L_{m},T\right) \) is an arbitrary function of the Ricci scalar R, of the trace T of the matter energy–momentum tensor \(T_{\mu \nu }\), \( T=g^{\mu \nu }T_{\mu \nu }\), and of the Lagrangian density of the ordinary matter, \(L_{m}\), respectively. The main physical motivation for considering this function is that it will ensure that the modification is non-trivial for all kinds of matter fields, including radiation with \(T=0\).

The energy–momentum tensor of the ordinary (baryonic) matter is defined in the standard way according to the relation [148]

$$\begin{aligned} T_{\mu \nu }=-\frac{2}{\sqrt{-g}}\frac{\delta \left( \sqrt{-g}L_{m}\right) }{ \delta g^{\mu \nu }}. \end{aligned}$$
(5)

In the following we introduce the important assumption that the Lagrangian density \(L_{m}\) of the matter depends only on the metric tensor components \(g_{\mu \nu }\), and not on its derivatives. Therefore for \(T_{\mu \nu }\) we find the simple expression

$$\begin{aligned} T_{\mu \nu }=g_{\mu \nu }L_{m}-2\frac{\partial L_{m}}{\partial g^{\mu \nu }}. \end{aligned}$$
(6)

The variation of the action S with respect to the metric tensor components \(g^{\mu \nu }\) can be obtained as

$$\begin{aligned} \delta S&=\frac{1}{16\pi }\int \bigg [ f_{R}\delta R+\bigg (f_{T} \frac{\delta T}{\delta g^{\mu \nu }}+f_{L} \frac{\delta L_{m}}{\delta g^{\mu \nu }} \nonumber \\&\quad -\frac{1}{2}g_{\mu \nu }f -8\pi T_{\mu \nu }\bigg )\delta g^{\mu \nu }\bigg ] \sqrt{-g}\,d^{4}x, \end{aligned}$$
(7)

where we have denoted \(f_{R} =\partial f/\partial R\), \(f_{T} =\partial f /\partial T\), and \(f_{L} =\partial f /\partial L_{m}\), respectively. The variation of the Ricci scalar can be obtained from the Palatini identity \( \delta R_{\sigma \nu } = \nabla _\rho (\delta \Gamma ^\rho _{\nu \sigma }) - \nabla _\nu (\delta \Gamma ^\rho _{\rho \sigma })\) [149] as

$$\begin{aligned} \delta R=R_{\mu \nu }\delta g^{\mu \nu }+g_{\mu \nu }\nabla _{\rho }\nabla ^{\rho }\delta g^{\mu \nu }-\nabla _{\mu }\nabla _{\nu }\delta g^{\mu \nu }, \end{aligned}$$
(8)

where \(\nabla _{\lambda }\) represents the covariant derivative with respect to the connection \(\Gamma \), associated to the metric g, while \(\Gamma _{\mu \nu }^{\lambda }\) denotes the Christoffel symbols associated to the metric. We also assume the metric compatibility of the covariant derivative, \(\nabla _\sigma g^{\mu \nu } = 0\).

The variation of the trace \(T=T_{\mu }^{\mu }\) of the matter energy–momentum tensor \(T_{\mu \nu }\) with respect to the metric tensor is defined as

$$\begin{aligned} \frac{\delta \left( g^{\alpha \beta }T_{\alpha \beta }\right) }{\delta g^{\mu \nu }}=T_{\mu \nu }+\Theta _{\mu \nu }, \end{aligned}$$
(9)

where

$$\begin{aligned} \Theta _{\mu \nu }\equiv g^{\alpha \beta }\frac{\delta T_{\alpha \beta }}{ \delta g^{\mu \nu }}=L_{m}g_{\mu \nu }-2T_{\mu \nu }-\tau _{\mu \nu }, \end{aligned}$$
(10)

and we have denoted

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

After substituting the above expressions into Eq. (7), and integrating by parts, one can obtain the field equation of the \(f(R,T,L_{m})\) gravity as

$$\begin{aligned}&f_{R}R_{\mu \nu }-\frac{1}{2}\left[ f-(f_{L}+2f_{T})L_{m}\right] g_{\mu \nu } \nonumber \\&\quad +\left( g_{\mu \nu }\Box -\nabla _{\mu }\nabla _{\nu }\right) f_{R}=\left[ 8\pi +\frac{1}{2}(f_{L}+2f_{T})\right] T_{\mu \nu } \nonumber \\&\quad +f_{T}\tau _{\mu \nu }. \end{aligned}$$
(12)

For perfect fluid matter Lagrangian with \(L_{m}=-\rho \), and also for the scalar field theory with \(L_{m}=-\frac{1}{2}\partial _{\mu }\phi \partial ^{\mu }\phi +V(\phi )\), one can immediately see that \(\tau _{\mu \nu }\) vanishes. However, in the case of vector field theory, with Lagrangian \(L_{m}=-\frac{1}{ 4}F_{\mu \nu }F^{\mu \nu }+f(A^{2})\), we obtain

$$\begin{aligned} \tau _{\mu \nu }=F_{\alpha \mu }F_{\nu }^{~\alpha }+2A_{\mu }A_{\nu }A^{2}f^{\prime \prime }(A^{2}). \end{aligned}$$
(13)

If \(f=R\) (the Hilbert–Einstein Lagrangian), from Eq. (12) we recover the standard field equations of general relativity, \(R_{\mu \nu }-(1/2)g_{\mu \nu }R=8\pi T_{\mu \nu }\) [148]. If \(f=f\left( R,L_m\right) \), we reobtain the field equations of the \( f\left( R,L_m\right) \) gravity model [90], while \(f=f\left( R,T\right) \) gives the field equations of the \(f\left( R,T\right) \) theory [104].

By taking the trace of the gravitational field equations (12), in the absence of electromagnetic type fields we obtain

$$\begin{aligned}&f_{R}R-2\big [ f-(f_{L}+2f_{T})L_{m}\big ] +3\Box f_{R} \nonumber \\&\quad =\left[ 8\pi +\frac{1}{2}\left( f_{L}+2f_{T}\right) \right] T+f_T\tau . \end{aligned}$$
(14)

With the use of Eq. (14) the gravitational field equation of the \( f\left( R,T,L_{m}\right) \) gravity theory can be written in an alternative form as

$$\begin{aligned} R_{\mu \nu }-\frac{1}{4}Rg_{\mu \nu }= & {} \frac{1}{f_{R}}\left[ 8\pi +\frac{1}{ 2}(f_{L}+2f_{T})\right] \left( T_{\mu \nu }-\frac{1}{4}g_{\mu \nu }T\right) \nonumber \\&- \frac{1}{f_{R}}\left( \frac{1}{4}g_{\mu \nu }\Box -\nabla _{\mu }\nabla _{\nu }\right) f_{R} \nonumber \\&+\frac{f_T}{f_R}\left( \tau _{\mu \nu }-\frac{1}{4}\tau g_{\mu \nu }\right) . \end{aligned}$$
(15)

We call this form of the gravitational field equations of the \( f\left( R,T,L_m\right) \) the traceless representation of the theory. It is interesting to note that for \(f(R)=R\), Eq. (15), the basic field equation of the traceless representation of the \(f\left( R,L_m,T\right) )\) reduces to the geometry-matter symmetric Einstein equations [150, 151],

$$\begin{aligned} R_{\mu \nu }-\frac{1}{4}Rg_{\mu \nu }=8\pi G \left( T_{\mu \nu }-\frac{1}{4}g_{\mu \nu }T\right) , \end{aligned}$$
(16)

which have been proposed as a possible solution to the cosmological constant problem. For the applications and further generalizations of the geometry-matter symmetric Einstein equations see [45].

3 Energy and momentum balance equations, equations of motion, and extra-force in \(f\left( R,L_m,T\right) \) gravity

It is obvious that due of the non-minimal coupling between matter and geometry, in the present theory the energy–momentum tensor is not conserved. In this section we will first obtain the non-conservation equation of the matter energy–momentum tensor (the energy and momentum balance equations), and then we will consider the equations of motion of particles, thus obtaining the expression of the extra-force generated by the curvature-matter coupling.

3.1 The divergence of the matter energy–momentum tensor

Let us start with taking the covariant derivation of the gravitational field equations Eq. (12)

$$\begin{aligned}&R_{\mu \nu }\nabla ^{\mu }f_{R}+f_{R}\nabla ^{\mu }R_{\mu \nu }-\frac{1}{2} \nabla _{\nu }f \nonumber \\&\quad =\left[ 8\pi +\frac{1}{2}(f_{L}+2f_{T})\right] \nabla ^{\mu }T_{\mu \nu } \nonumber \\&\qquad +(\Box \nabla _{\nu }-\nabla _{\nu }\Box )f_{R}-\nabla _{\nu }\Bigg [ L_{m}\left( f_{T}+\frac{1}{2}f_{L}\right) \Bigg ] \nonumber \\&\qquad +T_{\mu \nu }\nabla ^{\mu }\left( f_{T}+\frac{1}{2}f_{L}\right) +A_{\nu }, \end{aligned}$$
(17)

where we have defined

$$\begin{aligned} A_{\nu }\equiv \nabla ^{\mu }\left( f_{T}\tau _{\mu \nu }\right) . \end{aligned}$$
(18)

One should note that in the case of perfect fluid and scalar field theory we have \(A_{\nu }=0\). By taking into account that

$$\begin{aligned} \nabla _{\nu }f\left( R,L_{m},T\right) =f_{R}\nabla _{\nu }R+f_{T}\nabla _{\nu }T+f_{L}\nabla _{\nu }L_{m}, \end{aligned}$$
(19)

and after using the geometric identities \(\nabla ^{\mu }G_{\mu \nu }=0\), and [152]

$$\begin{aligned} \left( \Box \nabla _{\nu }-\nabla _{\nu }\Box \right) f_{R}=R_{\mu \nu }\nabla ^{\mu }f_{R}, \end{aligned}$$
(20)

the non-conservation equation of the energy–momentum tensor is reduced to

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }&=\frac{1}{8\pi +f_{m}}\Big [\nabla _{\nu }\big ( L_{m}f_{m}\big )-T_{\mu \nu }\nabla ^{\mu }f_{m}-A_{\nu }\nonumber \\&\quad -\frac{1}{2}(f_T\nabla _\nu T+f_L\nabla _\nu L_m)\Big ], \end{aligned}$$
(21)

where we have defined

$$\begin{aligned} f_{m}=f_{T}+\frac{1}{2}f_{L}. \end{aligned}$$
(22)

Equation (21) is direct a consequence of the presence of the matter fields in the expression of the gravitational Lagrange density, given by the function \(f\left( R,L_m,T\right) \). One can immediately see that in the case of \(f_{T}=0=f_{L}\), the matter content of the Universe is conserved.

By using the traceless representation of the field equations, one can obtain the non-conservation of the energy–momentum tensor as

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }&=\frac{1}{4}\nabla _{\nu }T-\frac{1}{\left( 8\pi +f_{m}\right) }\nabla ^{\mu }(f_TS_{\mu \nu })\nonumber \\&\quad -\left( T_{\mu \nu }-\frac{1}{4}g_{\mu \nu }T\right) \nabla ^{\mu }\ln \left( 8\pi +f_{m}\right) \nonumber \\&\quad +\frac{1}{4\left( 8\pi +f_{m}\right) }\left( Rf_{R}\nabla _{\nu }\ln \frac{R}{f_{R}}-3\nabla _{\nu }\square f_{R}\right) , \end{aligned}$$
(23)

where we have denoted

$$\begin{aligned} S_{\mu \nu }= \tau _{\mu \nu }-\frac{1}{4}\tau g_{\mu \nu }. \end{aligned}$$
(24)

3.2 The energy and momentum balance equations

In the following we adopt the simplifying assumption according to which the matter content of the Universe consists of a perfect fluid that can be described by only two basic thermodynamics parameters, the energy density \(\rho \), and the thermodynamic pressure p of the fluid, respectively. In this case the matter energy–momentum tensor is given by

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

where the four-velocity \(u_{\mu }\) is normalized as \(u^{\mu }u_{\mu }=-1\). Next, we introduce the projection operator \(h_{\lambda }^{\nu }\), defined as

$$\begin{aligned} h_{\lambda }^{\nu }=\delta _{\lambda }^{\nu }+u_{\lambda }u^{\nu }, \end{aligned}$$
(26)

with the basic property \(u_{\nu }h_{\lambda }^{\nu }\equiv 0\).

By taking the covariant divergence of Eq. (25), we first find

$$\begin{aligned} \nabla ^{\mu }T_{\mu \nu }= & {} \left( \nabla ^{\mu }\rho +\nabla ^{\mu }p\right) u_{\mu }u_{\nu }+\left( \rho +p\right) \nabla ^{\mu }u_{\mu }u_{\nu } \nonumber \\&+\left( \rho +p\right) u_{\mu }\nabla ^{\mu }u_{\nu }+\nabla _\nu p. \end{aligned}$$
(27)

Therefore Eq. (21) takes the form

$$\begin{aligned}&\nabla ^{\mu }(\rho +p) u_{\mu }u_{\nu }+\left( \rho +p\right) \nabla ^{\mu }(u_{\mu }u_{\nu }) \nonumber \\&\quad +\nabla _{\nu }p= \frac{ 1}{8\pi +f_{m}}\bigg [\nabla _{\nu }\left( L_{m}f_{m}\right) \nonumber \\&\quad -T_{\mu \nu }\nabla ^{\mu }f_{m}- \frac{1}{2}(f_{T}\nabla _{\nu }T+f_{L}\nabla _{\nu }L_{m})\bigg ], \end{aligned}$$
(28)

where we have taken into account that \(A_\nu =0\) in the case of a perfect fluid. By multiplying Eq. (28) with \(u^{\nu }\), and by considering the identity \(u^{\nu }\nabla ^{\mu }u_{\nu }=0\), we arrive at the energy balance equation in the \(f\left( R,L_{m},T\right) \) gravity theory as given by

$$\begin{aligned}&{\dot{\rho }}+3\left( \rho +p\right) H\nonumber \\&\quad =-\frac{1}{8\pi +f_{m}}\Bigg [(\rho +L_m)\dot{f}_m-\frac{1}{2}f_T(\dot{T}-2\dot{L}_m)\Bigg ], \end{aligned}$$
(29)

where we have denoted \(H=(1/3)\nabla ^{\mu }u_{\mu }\), and \(\dot{}=u^{\mu }\nabla _{\mu }=d/d{s}\), respectively. Here d s denotes the line element constructed with the help of the metric \(g_{\mu \nu }\), \(d{s}^{2}=g_{\mu \nu }dx^{\mu }dx^{\nu }\). We note that the equality \(u^{\mu }\nabla _{\mu }=d/d{s}\) is only true when we apply it on a scalar function. In the case of tensors, we will substitute the definition with the absolute derivative \(u^{\mu }\nabla _{\mu }=D/D{s}\), as we will see in the following.

The multiplication of Eq. (28) with \(h_{\lambda }^{\nu }\) gives the momentum balance equation for a perfect fluid in the alternative \(f\left( R,L_{m},T\right) \) gravity theory as

$$\begin{aligned} u^{\mu }\nabla _{\mu }u^{\lambda }&=\frac{d^{2}x^{\lambda }}{ds^{2}} +\Gamma _{\mu \nu }^{\lambda }\frac{dx^\mu }{ds}\frac{dx^\nu }{ds}\nonumber \\&=\frac{1}{(\rho +p)(8\pi +f_{m})}\Big [(L_m-p)D^\lambda f_m\nonumber \\&\quad -\frac{1}{2}f_TD^\lambda (T-2L_m)-(8\pi +f_{m})D^\lambda p\Big ], \end{aligned}$$
(30)

where we have defined \(D^\lambda \equiv h^{\nu \lambda }\nabla _\nu \), with \(D^{\lambda }\) orthogonal to the vector field \(u^\nu \), and lying in the spatial hypersurfaces of constant time.

Alternatively, we can write down the equation of motion of particles as

$$\begin{aligned} \frac{d^{2}x^{\lambda }}{ds^{2}}+\Gamma _{\mu \nu }^{\lambda }u^{\mu }u^{\nu }=f^{\lambda }, \end{aligned}$$
(31)

where

$$\begin{aligned} f^{\lambda }&=\frac{1}{(\rho +p)(8\pi +f_{m})}\Big [(L_m-p)D^\lambda f_m\nonumber \\&\quad -\frac{1}{2}f_TD^\lambda (T-2L_m)-(8\pi +f_{m})D^\lambda p\Big ], \end{aligned}$$
(32)

or, equivalently,

$$\begin{aligned} f^{\lambda }= & {} \frac{h^{\nu \lambda }}{(\rho +p)(8\pi +f_{m})}\Big [ (L_{m}-p)\nabla _{\nu }f_{m} \nonumber \\&-\frac{1}{2}f_{T}\nabla _{\nu }(T-2L_{m})-(8\pi +f_{m})\nabla _{\nu }p\Big ], \end{aligned}$$
(33)

is the extra-force generated by the geometry-matter coupling in the \(f\left( R,L_m,T\right) \) theory. It is straightforward to see that the extra-force is perpendicular to the four-velocity, \(u_{\lambda }f^{\lambda }=0\).

3.3 The variational principle for the equation of motion of a test particle

In the following we assume that the extra-force in the \(f\left( R,L_m,T\right) \) theory, as given by Eq. (32), can be represented in a formal mathematical way as

$$\begin{aligned} f^{\lambda }=-\left( u^{\nu }u^{\lambda }+g^{\nu \lambda }\right) \nabla _{\nu }\ln \sqrt{Q}=-h^{\nu \lambda }\nabla _{\nu }\ln \sqrt{Q}, \end{aligned}$$
(34)

where the expression of \(\nabla _{\nu }\ln \sqrt{Q}\) can be obtained after a simple comparison with Eq. (33), once the full set of parameters of the \(f\left( R,L_m,T\right) \) theory is established. If it happens that the extra-force admits such a mathematical representation, the equation of motion of the massive particles can be derived from a variational principle, which is given by

$$\begin{aligned} \delta S_{p}=\delta \int L_{p}ds=\delta \int \sqrt{Q}\sqrt{-g_{\mu \nu }u^{\mu }u^{\nu }}ds=0, \end{aligned}$$
(35)

where \(S_{p}\) and \(L_{p}=\sqrt{Q}\sqrt{-g_{\mu \nu }u^{\mu }u^{\nu }}\) are the action and the Lagrangian density for massive test bodies moving in a curved geometry described by the metric \(g_{\mu \nu }\). As usual, by s we have denoted the affine parameter along the curve.

To prove this result we begin by writing down the Euler–Lagrange equations obtained from the variation of the action (35), and which are given by

$$\begin{aligned} \frac{d}{ds}\left( \frac{\partial L_{p}}{\partial u^{\lambda }}\right) - \frac{\partial L_{p}}{\partial x^{\lambda }}=0. \end{aligned}$$
(36)

By considering the mathematical relations

$$\begin{aligned} \frac{\partial L_{p}}{\partial u^{\lambda }}=\sqrt{Q}u_{\lambda }, \end{aligned}$$
(37)

and

$$\begin{aligned} \frac{\partial L_{p}}{\partial x^{\lambda }}=\frac{1}{2} \sqrt{Q}g_{\mu \nu ,\lambda }u^{\mu }u^{\nu }+\frac{ 1}{2} \frac{Q_{,\lambda }}{\sqrt{Q}}, \end{aligned}$$
(38)

respectively, after a simple calculation we obtain the equations of motion of the particle in the form

$$\begin{aligned} \frac{d^{2}x^{\mu }}{ds^{2}}+\Gamma _{\nu \lambda }^{\mu }u^{\nu }u^{\lambda }+\left( u^{\mu }u^{\nu }+g^{\mu \nu }\right) \nabla _{\nu }\ln \sqrt{Q}=0. \end{aligned}$$
(39)

By the simple identification of the terms in the equation of motion given by Eq. (39), and the expression of the extra-force generated by the geometry-matter coupling, as given by Eq. (34), we can immediately obtain the explicit functional form of \(\sqrt{Q}\). In the limit \( \sqrt{Q}\rightarrow 1\), we reobtain the usual general relativistic equation \(\frac{d^{2}x^{\mu }}{ds^{2}}+\Gamma _{\nu \lambda }^{\mu }u^{\nu }u^{\lambda }=0\), describing geodesic motion in the gravitational field.

3.4 The Newtonian limit of the equation of motion

The variational principle (35) provides a very simple and efficient way for the study of the Newtonian limit of the equations of motion of the test particles in \(f\left( R,T,L_{m}\right) \) gravity. In the Newtonian limit of the weak gravitational fields and slow motions, one can approximate the metric according to

$$\begin{aligned}&\sqrt{-g_{\mu \nu }u^{\mu }u^{\nu }}ds\approx \sqrt{1+2\phi -\vec {v}^{\,2}} dt\nonumber \\&\approx \left( 1+\phi -\frac{\vec {v}^{\;2}}{2}\right) dt, \end{aligned}$$
(40)

where by \(\phi \) we have denoted the Newtonian potential, and \(\vec {v}\) is the usual tridimensional velocity of the fluid, satisfying the condition \(\vec {v}^{\,2}/c^2\ll 1\). By assuming that in the Newtonian limit of weak gravitational fields the function \(\sqrt{Q}\) can be represented in the \(f\left( R,L_m,T\right) \) theory as,

$$\begin{aligned} \sqrt{Q}=1+U\left( \phi ,\rho ,p,T, L_m,f_m, \nabla _{\nu }T,\ldots \right) , \end{aligned}$$
(41)

where we assume that in the first order of approximation \(U\left( \phi ,\rho ,p,T, L_m,f_m, \nabla _{\nu }T,\ldots \right) \ll 1\), the equations of motion of the fluid do follow from the variational principle

$$\begin{aligned} \delta \int \left[ U\left( \phi ,\rho ,p\right) +\phi -\frac{\vec {v}^{\,2} }{2}\right] dt=0, \end{aligned}$$
(42)

and are obtained as

$$\begin{aligned} \vec {a}=-\nabla \phi -\nabla U=\vec {a}_{N}+\vec {a}_{E}, \end{aligned}$$
(43)

where \(\vec {a}\) denotes the total acceleration of the system, the term \(\vec {a} _{N}=-\nabla \phi \) gives the Newtonian gravitational acceleration, while

$$\begin{aligned} \vec {a}_{E}=-\nabla U\left( \phi ,\rho ,p,T, L_m,f_m, \nabla _{\nu }T,\ldots \right) , \end{aligned}$$
(44)

represents the supplementary acceleration induced by the inclusion of the different forms of the geometry-matter coupling in the action of the gravitational field of the \(f\left( R,L_m,T\right) \) theory.

In the case of the extra-force generated in the \(f\left( R,L_m,T\right) \) gravity, the expression of Q can be obtained from the relation

$$\begin{aligned} \nabla _{\nu }\ln \sqrt{Q}&=-\frac{1}{(\rho +p)(8\pi +f_{m})}\Bigg \{(L_{m}-p)\nabla _{\nu }f_{m}\nonumber \\&\quad -\frac{1}{2}f_{T}\nabla _{\nu }(T-2L_{m})-(8\pi +f_{m})\nabla _{\nu }p\Bigg \}. \end{aligned}$$
(45)

The function \(\sqrt{Q}\) can always be represented in a closed form obtained by integrating the left-hand side of Eq. (45). But we must point out that generally Q cannot be expressed in a simple mathematical form, and to find its expression some approximate methods must be used.

In order to obtain the explicit expressions of the extra-acceleration induced by the geometry-matter coupling, we analyze the simple case in which the pressure of the gravitating fluid is given as a function of the density by a linear barotropic equation of state having the standard form \(p=w\rho \), where w is a constant satisfying the condition \(w\ll 1\). Hence it follows that we can approximate \(\rho +p\approx \rho \), and \(T=-\rho +3p\approx -\rho \), respectively. Hence in this approximation T is a function of the density only. Furthermore, we assume that the function \(f\left( R,T,L_m\right) \) can be represented as \(f\left( R,T,L_m\right) =R+\epsilon \Psi \left( L_m,T\right) \), where \(\epsilon \) is a small parameter. We also adopt for the matter Lagrangian the expression \(L_m=-\rho \). Hence the gravitational Lagrangian density becomes a function of the Ricci scalar and of the matter density only, \(f\left( R,T,L_m\right) =R+\epsilon \Psi \left( \rho \right) \).

Now we can expand \(\Psi (\rho )\) near a fixed value \(\rho _0\) of the matter density, thus obtaining in the first order of approximation

$$\begin{aligned} \Psi \left( \rho \right)\approx & {} \Psi \left( \rho _0\right) +\left( \rho -\rho _0\right) \left. \frac{d\Psi (\rho )}{d\rho } \right| _{\rho =\rho _0}+\cdots \nonumber \\= & {} a_0+ b_0\left( \rho -\rho _0\right) +\cdots , \end{aligned}$$
(46)

where we have denoted \(a_0=\Psi \left( \rho _0\right) \) and \(b_0=[d\Psi (\rho )/d\rho ]|_{\rho =\rho _0}\), respectively. Hence we immediately find \(f_T=\epsilon b_0\), \(f_L=-\epsilon b_0\), and \(f_m=f_T+f_L/2=\epsilon b_0/2\), respectively.

Then, with the use of the above approximations, Eq. (45) giving the expression of \(\sqrt{Q}\) takes the form

$$\begin{aligned} \nabla _{\nu }\ln \sqrt{Q}\approx \left( w-\frac{\epsilon b_0/2}{8\pi +\epsilon b_0/2}\right) \frac{1}{\rho }\nabla _{\nu } \rho , \end{aligned}$$
(47)

giving

$$\begin{aligned} \sqrt{Q}\left( \rho \right) \approx \left( \frac{\rho }{\rho _0}\right) ^\alpha , \end{aligned}$$
(48)

where \(\alpha =w-\left( \epsilon b_02\right) /\left( 8\pi +\epsilon b_0/2\right) \). Equation (48) also maintains its validity for a fluid satisfying a linear barotropic equation of state of the form \(p=\left( \gamma -1\right) \rho \), \(\gamma =\mathrm{constant}\), with \((\gamma -1)\) not necessarily very small. Hence an equation of the form (48) can be applied for the description of both non-relativistic and the extreme relativistic regimes.

By using the mathematical relation \(x^{\alpha }=\exp (\alpha \ln x)\approx 1+\alpha \ln x\), we can approximate \(\sqrt{Q}\left( \rho \right) \) given by Eq. (48) as

$$\begin{aligned} \sqrt{Q}\left( \rho \right) \approx 1+\alpha \ln \frac{\rho }{\rho _0}=1+U(\rho ), \end{aligned}$$
(49)

where

$$\begin{aligned} U\left( \rho \right) = \alpha \ln \frac{\rho }{\rho _0}. \end{aligned}$$
(50)

Hence in the first order of approximation in \(f\left( R,L_m,T\right) \) gravity the equations of motion of the gravitating hydrodynamic type system can be obtained from the variational principle

$$\begin{aligned} \delta \int \left[ 1+\alpha \ln \frac{\rho }{\rho _0} +\phi -\frac{\vec {v}^{\,2}}{2}\right] dt=0, \end{aligned}$$
(51)

and they are given by

$$\begin{aligned} \vec {a}=-\nabla \phi -\nabla U\left( \rho \right) =\vec {a}_{N}+\vec {a}_{E}, \end{aligned}$$
(52)

with the extra-acceleration of the fluid given by

$$\begin{aligned} \vec {a}_{E}(\rho )=\alpha \nabla \ln \frac{\rho }{\rho _0} =\alpha \frac{1}{\rho }\nabla \rho . \end{aligned}$$
(53)

In the present approach and within the framework of the adopted approximations the supplementary acceleration induced by the modification of the action of the gravitational field due to the geometry-matter coupling is a function of the matter density only.

3.5 The modified Poisson equation

In this subsection we will obtain the modified Poisson equation in \( f(R,L_m,T)\) gravity. In order to find it we consider the first order approximation of the function \(f\left( R,L_m,T\right) \), which can be written with the help of a Taylor series expansion in the vicinity of a fixed point \( \left( R_0,T_0,L_{m0}\right) \) as

$$\begin{aligned}&f\left( R,T,L_m\right) \approx \lambda +\alpha R+\beta _0T+\gamma _0L_m\nonumber \\&\quad +{\mathcal {O}}\left( R-R_0\right) ^2+\mathcal {O}\left( L-L_{m0}\right) ^2+\mathcal {O}\left( T-T_0\right) ^2, \end{aligned}$$
(54)

where we have denoted

$$\begin{aligned}&\alpha =f_R\left( R_0,T_0,L_{m0}\right) , \beta _0=f_T\left( R_0,T_0,L_{m0}\right) , \end{aligned}$$
(55)
$$\begin{aligned}&\gamma _0=f_L\left( R_0,T_0,L_{m0}\right) , \end{aligned}$$
(56)
$$\begin{aligned}&\lambda =f\left( R_0,T_0,L_{m0}\right) - \alpha R_0-\beta T_0-\gamma L_{m0}. \end{aligned}$$
(57)

Therefore, in this approximation, the field equations (12) for a perfect fluid with energy–momentum tensor given by Eq. (25) become

$$\begin{aligned} R_{\mu \nu }-\frac{1}{2}Rg_{\mu \nu }=\Lambda g_{\mu \nu }+\beta Tg_{\mu \nu }+8\pi G_{eff}T_{\mu \nu }, \end{aligned}$$
(58)

where we have denoted

$$\begin{aligned} \beta =\frac{\beta _0}{2\alpha },\ \gamma =\frac{\gamma _0}{2\alpha },\ \Lambda = \frac{\lambda }{2\alpha },\ G_{eff}=\left[ \frac{1}{\alpha }+\frac{\gamma +2\beta }{8\pi }\right] .\nonumber \\ \end{aligned}$$
(59)

Equivalently, Eq. (58) can be reformulated as

$$\begin{aligned} R_{\mu \nu }=-\Lambda g_{\mu \nu }-\beta Tg_{\mu \nu }+8\pi G_{eff}\left( T_{\mu \nu }-\frac{1}{2}g_{\mu \nu }T\right) .\nonumber \\ \end{aligned}$$
(60)

In the Newtonian limit one can write the metric as

$$\begin{aligned} ds^2=-(1+2\phi (\vec {x}))dt^2+d\vec {x}^2, \end{aligned}$$
(61)

where \(\phi \) is the Newtonian potential. In the following we assume that the macroscopic motion takes place at small velocities, and consequently in the four-velocity we can keep only the time component, and neglect all the space components with a very good approximation. Therefore we have \(u^0\approx -1\), and \(u^i\approx 0\), \(i=1,2,3\).

We will apply the same approximation in the gravitational field equations, thus keeping only their time component. A similar approximation is used for the components of the energy–momentum tensor. Therefore, we can approximate \(T_{\mu \nu }\) as \(T_0^0\approx -\rho \), and \(T=-\rho \), respectively. By taking into account the explicit expression of the metric tensor, we obtain \(\Gamma _{00}^{\alpha }\approx -(1/2)g^{\alpha \beta }\partial g_{00}/\partial x^{\beta }=\partial \phi /\partial x^{\alpha }\), giving \(R_0^0=-\Delta \phi \). Then Eq. (60) immediately gives

$$\begin{aligned} \Delta \phi =4\pi G_{New}\rho +\Lambda , \end{aligned}$$
(62)

with \(G_{New}=G_{eff}-\beta /4\pi \). Hence, we have obtained the generalized Poisson equation in \( f\left( R,L_m,T\right) \) gravity theory, which, in the first order of approximation, determines a slight modification of the gravitational constant, and induces a cosmological term.

4 The Dolgov–Kawasaki instability

In this section we will obtain the Dolgov–Kawasaki criterion [153] in \(f\left( R,L_m,T\right) \) gravity theory. Let’s consider the dynamics of a small celestial body like, for example, the Sun. In this case, the gravitational force is very small, and the metric is very close to the flat one. However, the curvature of the space-time is still non-zero, and the geometry is curved. Suppose that there exist a solution of the field equations corresponding to constant values of the variables of the theory, \(R_0\), \(T_0\) and \(L_{0}\), respectively. Let us now perturb the curvature, the matter energy–momentum tensor, and the matter Lagrangian around their background values as

$$\begin{aligned} R&=R_0+R_1,\end{aligned}$$
(63)
$$\begin{aligned} T&=T_0+T_1,\end{aligned}$$
(64)
$$\begin{aligned} L_m&=L_{0}+L_1. \end{aligned}$$
(65)

Also, we can expand the tensor \(\tau _{\mu \nu }\) as \(\tau _{\mu \nu }=\tau _{0\mu \nu }+\tau _{1\mu \nu }\). In order to be consistent with the Solar System observations, in addition to the above relations, we assume that the function f can be expressed as

$$\begin{aligned} f(R,L_m,T)=R+\epsilon \Phi \left( R,L_m,T\right) , \end{aligned}$$
(66)

where \(\epsilon \) is a small constant, with its value set by Solar System tests, and \(\Phi \left( R,L_m,T\right) \) is an arbitrary function.

Let us start with the trace of Einstein’s field equation (14). To the first order in perturbations, we have

$$\begin{aligned} f(R,L_m,T)=R_0+\epsilon \Phi (0)+(1+\epsilon \Phi _R(0))R_1+H_1,\nonumber \\ \end{aligned}$$
(67)

where \(H_1\) contains all first order contributions of the matter field, i.e. \(T_1\) and \(L_1\). One can also obtain

$$\begin{aligned} f_R&=1+\epsilon \Phi _R(0)+\epsilon \Phi _{RR}R_1+H_{R1},\end{aligned}$$
(68)
$$\begin{aligned} f_T&=\epsilon \Phi _T(0)+\epsilon \Phi _{RT}(0)R_1+H_{T1},\end{aligned}$$
(69)
$$\begin{aligned} f_L&=\epsilon \Phi _L(0)+\epsilon \Phi _{RL}(0)R_1+H_{L1}. \end{aligned}$$
(70)

The higher order derivatives of the function f can be easily written as above. We also have

$$\begin{aligned} \Box f_{1R}=\epsilon \Phi _{RR}(0)\Box R_1+\epsilon \Phi _{RT}(0)\Box T_1+\epsilon \Phi _{RL}(0)\Box L_1.\nonumber \\ \end{aligned}$$
(71)

By using the above approximations, it follows that the d’Alembertian can be expanded in the Minkowski space as

$$\begin{aligned} \Box R_1=-\ddot{R}_1+\nabla ^2 R_1. \end{aligned}$$
(72)

The resulting trace equation (14) at first order can be written as

$$\begin{aligned} \ddot{R}_1-\nabla ^2 R_1+m_{eff}^2 R_1=V_{eff}, \end{aligned}$$
(73)

where we have defined the effective mass, and effective potential, respectively, as

$$\begin{aligned} m_{eff}^2&=\frac{1}{3\epsilon \Phi _RR(0)}\Bigg (1+\epsilon \Phi _R(0)-\epsilon \Phi _{RR}(0)R_0\nonumber \\&\quad -2\epsilon \Phi _{RL}(0)L_0-4\epsilon \Phi _{TR}L_0+\frac{1}{2}\epsilon \Phi _{LR}(0)T_0\nonumber \\&\quad +\epsilon \Phi _{TR}(0)T_0+\epsilon \Phi _TR(0)\tau _0\Bigg ), \end{aligned}$$
(74)

and

$$\begin{aligned} V_{eff}^2&=\frac{1}{3\epsilon \Phi _RR(0)}\Bigg (2H_1-H_{R1}R_0-2(H_{L1}+2H_{T1})L_0\nonumber \\&\quad -2\epsilon (\Phi _{L}(0)+2\Phi _T(0))-3\epsilon \Phi _{RT}(0)\Box T_1\nonumber \\&\quad -3\epsilon \Phi _{RT}(0)\Box L_1+\frac{1}{2}\big ((H_{L1}+2H_{T1})T_0+16\pi T_1\nonumber \\&\quad +\epsilon (\Phi _L(0)+2\Phi _T(0))T_1\big )+H_{T1}\tau _0+\epsilon \Phi _T(0)\tau _1\Bigg ). \end{aligned}$$
(75)

In order to have a stable perturbation, and to avoid tachyonic instability, one must impose the condition \(m_{eff}^2\ge 0\). However, the mass term (74) is dominated by its first term, which gives us the constraint \(\Phi _{RR}(0)\ge 0\). Noting that \(\Phi _{RR}(0)=f_{RR}(0)\), we finally obtain the Dolgov–Kawasaki criterion in \(f\left( R,L_m,T\right) \) gravity as

$$\begin{aligned} f_{RR}(0)\ge 0. \end{aligned}$$
(76)

The same condition applies in the special cases of f(R), f(RT) and \(f(R,L_m)\) theories, which were proven elsewhere.

5 Cosmological consequences of \(f\left( R,L_m,T\right) \) gravity

Let us assume that the Universe can be described by the flat, homogenous and isotropic Friedmann–Lemaître–Robertson–Walker (FLRW) metric of the form

$$\begin{aligned} ds^{2}=-dt^{2}+a(t)^{2}(dx^{2}+dy^{2}+dz^{2}), \end{aligned}$$
(77)

where a(t) is the scale factor. In the following we denote by \(H=\dot{a}/a\) the Hubble function, describing the rate of expansion of the Universe. The accelerating/decelerating nature of the cosmological expansion can be characterized with the help of the deceleration parameter q, defined as

$$\begin{aligned} q=\frac{d}{dt}\left( \frac{1}{H}\right) -1. \end{aligned}$$
(78)

Also, let us assume that the Universe is filled with a perfect fluid. We adopt for the Lagrangian density of the cosmic (baryonic) matter the expression \(L_{m}=-\rho \). In the comoving frame the non-zero components of the energy–momentum tensor are given by

$$\begin{aligned} T_{\nu }^{\mu }=\mathrm {diag}\left( -\rho ,p,p,p\right) . \end{aligned}$$
(79)

Moreover, we impose on the function f the condition \(f_{R}\ne 0\), a condition that is assumed to be valid for all times.

5.1 Generalized Friedmann equations

In the case of the traceless representation of the \(f\left( R,L_{m},T\right) \) gravitational theory, the traceless equation (15) and the trace equation (14) reduce for the FLRW metric to the evolution equations (generalized Friedmann equations)

$$\begin{aligned} -\dot{H}=\frac{1}{2f_{R}} \left( 8\pi +f_{m}\right) \left( \rho +p\right) +\frac{1}{2f_{R}}\left( \ddot{f}_{R}-H \dot{f}_{R}\right) , \end{aligned}$$
(80)

and

$$\begin{aligned} \dot{H}+2H^2&=\frac{1}{3f_R}(f-2L_mf_m)\nonumber \\&\quad -\frac{1}{6f_{R}} \!\left( 8\pi \! +\!f_{m}\right) \left( \rho -3p\right) \!+\!\frac{1}{2f_{R}}\left( \ddot{f}_{R}\!+\!3H \dot{f}_{R}\right) . \end{aligned}$$
(81)

In order to obtain a consistent solution it is usually necessary to solve both cosmological equations above. This is due to the fact that the original set of Einstein equations are decomposed into a traceless equation, and the trace equation, with \(L_m\) appearing only in the second equation.

To close the system of field equations we must add to cosmological system the energy balance equation (23), which gives the time evolution of the density as

$$\begin{aligned} {\dot{\rho }}+4H\left( \rho +p\right)&=-\dot{p}-\frac{1}{3\left( 8\pi +f_{m}\right) }Rf_{R}\frac{d}{dt}\ln \frac{R}{f_{R}} \nonumber \\&\quad -\left( \rho +p\right) \frac{d}{dt}\ln \left( 8\pi +f_{m}\right) \nonumber \\&\quad -\frac{1}{\left( 8\pi +f_{m}\right) }\frac{d}{dt}\left[ \frac{1}{a^{3}} \frac{d}{dt}\left( a^{3}\frac{df_{R}}{dt}\right) \right] . \end{aligned}$$
(82)

The deceleration parameter can be obtained in a general form as

$$\begin{aligned} q=\frac{1}{2f_{R}H^{2}}\left[ \left( 8\pi +f_{m}\right) \left( \rho +p\right) +\ddot{f}_{R}-H\dot{f}_{R} \right] -1. \end{aligned}$$
(83)

Equation (80) immediately gives the main criterion for the existence of an asymptotic de Sitter type evolution with \(H=\mathrm {constant}=H_{0}\) in \(f\left( R,L_m,T\right) \) gravity as

$$\begin{aligned} \left( 8\pi +f_{m}\right) \left( \rho +p\right) +\left( \ddot{f}_{R}-H_0\dot{f}_{R}\right) =0. \end{aligned}$$
(84)

Assuming that matter and geometry are minimally coupled \(f\left( R,L_{m},T\right) =R+g\left( L_{m},T\right) \), the condition for accelerated de Sitter type expansion reduces to

$$\begin{aligned} 8\pi +\frac{\partial g\left( L_m,T\right) }{\partial T}+\frac{1}{2}\frac{ \partial g\left( L_{m},T\right) }{\partial L_{m}}=0, \end{aligned}$$
(85)

representing a linear first order partial differential equation, with the general solution given by

$$\begin{aligned} g\left( T,L_{m}\right)= & {} -8\pi \big [\alpha T+2(1-\alpha )L_m\big ]\nonumber \\&+C\left( L_{m}- \frac{1}{2}T \right) , \end{aligned}$$
(86)

where \(\alpha \) is an arbitrary constant and C is an arbitrary function of the variable \(\left( 2L_{m}-T\right) /2\). In the simple case of an additive structure of the gravitational Lagrangian of the form \(f\left( R,L_m,T\right) =R+\alpha L_m+\beta T\), the condition for de Sitter type expansion is given by \(8\pi +\alpha /2+\beta =0\).

The general condition for an accelerating expansion of the Universe, with \(q<0\), can be formulated as

$$\begin{aligned} \ddot{f}_R-H\dot{f}_R+\left( 8\pi +f_m\right) \left( \rho +p\right) <2f_RH^2. \end{aligned}$$
(87)

The condition given by Eq. (87) depends on the Hubble parameter and the time/redshift derivative of the function \(f\left( R,L_m,T\right) \). Hence, once the functional form of \(f\left( R,L_m,T\right) \) is specified, the sign of the above condition changes for different time/redshift intervals, thus allowing for the existence of both decelerating and accelerating phases during the cosmological evolution.

5.2 The multiplicative case: \(f(R,L_m,T)=R+\alpha TL_m+\beta \), with \(L_m=-\rho \)

In order to build some explicit cosmological models in \(f\left( R,L_m,T\right) \) theory we will consider some explicit expressions for f. Let us consider first the choice

$$\begin{aligned} f\left( R,L_m,T\right) =R+\alpha TL_m+\beta , \end{aligned}$$
(88)

for the Lagrangian density.

5.2.1 The radiation dominated Universe

In the case of radiation dominated Universe, we have \(p=\rho /3\), and the evolution equations (80)–(82) can be simplified to

$$\begin{aligned}&3 \dot{H}-2 (\alpha \rho -8 \pi )\rho =0,\nonumber \\&6 H^2+3 \dot{H}-2 \alpha \rho ^2+\beta =0, \end{aligned}$$
(89)

and

$$\begin{aligned} 2 \pi {\dot{\rho }}- (\alpha \rho -8 \pi )H\rho =0, \end{aligned}$$
(90)

respectively. The above equations have an exact solution representing the radiation dominated Universe. Eliminating \(\dot{H}\) in Eqs. (89) one can easily obtain

$$\begin{aligned} H=\sqrt{\frac{8 \pi \rho }{3}-\frac{\beta }{6}}, \end{aligned}$$
(91)

substituting the above equation into the field equations, we have

$$\begin{aligned} t-t_0&=-\sqrt{\frac{3}{2\beta }}\,\tan ^{-1}\left( \sqrt{\frac{16\pi }{\beta }\rho -1}\right) \nonumber \\&\quad -\sqrt{\frac{3\alpha }{2\mathcal {A}}}\,\tanh ^{-1}\left( \sqrt{\frac{16\pi \alpha \rho -\alpha \beta }{\mathcal {A}}}\right) , \end{aligned}$$
(92)

where \(\mathcal {A}=128\pi ^2-\alpha \beta \).

Also, in the case \(\alpha >0\), we have an accelerating solution with the Hubble parameter

$$\begin{aligned} H=H_0=\sqrt{\frac{\mathcal {A}}{6\alpha }}, \end{aligned}$$
(93)

with energy density \(\rho =8\pi /\alpha \).

5.2.2 The dust Universe

In the case of dust dominated Universe, one has the evolution equations

$$\begin{aligned}&4\dot{H}+(16\pi -3 \alpha \rho )\rho =0, \end{aligned}$$
(94)
$$\begin{aligned}&4 (3 \dot{H}+6 H^2+\beta )-(5 \alpha \rho +16 \pi )\rho =0, \end{aligned}$$
(95)

and

$$\begin{aligned} 2 (8 \pi -\alpha \rho ) {\dot{\rho }}+3 (16 \pi -3 \alpha \rho ) H\rho =0, \end{aligned}$$
(96)

respectively.

By using Eqs. (94) and (95), we obtain

$$\begin{aligned} H=\frac{\sqrt{ (16 \pi -\alpha \rho )\,\rho -\beta }}{\sqrt{6}}. \end{aligned}$$
(97)

Substituting the above relation for the Hubble function in the field equation (95) we find

$$\begin{aligned} t-t_0&=\sqrt{\frac{2\alpha }{3\mathcal {B}}}\ln \left[ \frac{16\pi -3\alpha \rho }{\sqrt{\alpha }\left( 128\pi ^2-3\alpha \beta +8\alpha \rho +\sqrt{\alpha \mathcal {B}\mathcal {C}}\right) }\right] \nonumber \\&\quad +\sqrt{\frac{2}{-3\beta }}\ln \left[ \frac{4(8\pi \rho -\beta )}{\sqrt{-\beta }}+\sqrt{\mathcal {C}}\right] , \end{aligned}$$
(98)

where we have defined

$$\begin{aligned} \mathcal {B}=512\pi ^2-9\alpha \beta , \quad {\mathcal {C}}=16\pi \rho -\alpha \rho ^2-\beta . \end{aligned}$$
(99)

This model has also a de Sitter type expansionary phase with \(H=H_0=\mathrm{constant}\), for \(H_0\) given by

$$\begin{aligned} H_0=\sqrt{\frac{\mathcal {B}}{54\alpha }}, \quad \rho =\frac{16\pi }{3\alpha }. \end{aligned}$$
(100)

Hence in this model the de Sitter type phase is triggered by the generalized geometry-matter coupling, and takes place in the presence of ordinary matter only.

5.2.3 Numerical results

Now, we consider the cosmological evolution of the Universe in the present model by assuming it is filled with a mixture of dust and radiation, with the total energy density given by

$$\begin{aligned} \rho =\rho _r+\rho _m. \end{aligned}$$

The equation of state of the radiation is \(p=p_r=\rho _r/3\). In order to simplify the mathematical formalism we introduce a set of dimensionless parameters defined as

$$\begin{aligned} H&=H_0 h,\quad \rho _i= 6\kappa ^2 H_0^2 \Omega _i,\quad i=r,m\nonumber \\ \bar{\alpha }&= 6\kappa ^4 H_0^2 \,\alpha ,\quad \beta =3\,H_0^2 \,\bar{\beta }, \end{aligned}$$
(101)

where \(H_0\) is the current value of the Hubble function.

In terms of the redshift

$$\begin{aligned} 1+z=\frac{1}{a}, \end{aligned}$$

the equations of motion (80) and (81) take the form

$$\begin{aligned}&2 (1+z) h\,h'-3 \Omega _m-4 \Omega _r\nonumber \\&\quad +\bar{\alpha } \left( 18 \Omega _m \Omega _r+9 \Omega _m^2+8 \Omega _r^2\right) =0, \end{aligned}$$
(102)

and

$$\begin{aligned}&2 (1+z) h\,h'-4 h^2+\Omega _m-2 \bar{\beta }\nonumber \\&\quad +\bar{\alpha } \left( 14 \,\Omega _m \Omega _r+5 \Omega _m^2+8 \Omega _r^2\right) =0, \end{aligned}$$
(103)

respectively, where the prime denotes the derivative with respect to the redshift.

One can write the energy balance equation (82) as two coupled generalized conservation equations for the dust and the radiation separately as

$$\begin{aligned}&3 \left[ \bar{\alpha } \left( 3 \Omega _m+2 \Omega _r\right) -1\right] \,\Omega _m\nonumber \\&\quad -(1+z) \left[ \bar{\alpha } \left( 2 \Omega _m+\Omega _r\right) -1\right] \Omega _m'=0, \end{aligned}$$
(104)

and

$$\begin{aligned} 4 \left[ \bar{\alpha } \left( 3 \Omega _m+2 \Omega _r\right) -1\right] \,\Omega _r -(1+z) \left( \bar{\alpha } \Omega _m-1\right) \Omega _r' =0, \end{aligned}$$
(105)

respectively.

It should be mentioned that the sum of above equations is equal to the original conservation equation (82), and are written in a way that in the limit \({\bar{\alpha }}=0\), they reduce to the standard conservation equations for dust and radiation.

For the initial (present day) values of the cosmological parameters we adopt the values \(h(0)=1\), \(\Omega _{m0}=0.305\) and \(\Omega _{r0}=0.53\times 10^{-4}\), respectively. Evaluating Eqs. (102) and (103) at the present time \((z=0)\) one can find the numerical values of the constant \(\bar{\beta }\) in terms of \(\bar{\alpha }\) as

$$\begin{aligned} \bar{\beta }=-2+2\left( \Omega _{r0}+\Omega _{m0}\right) \left( 1-\bar{\alpha }\,\Omega _{m0}\right) . \end{aligned}$$
(106)

The redshift dependence of the deceleration parameter is given by

$$\begin{aligned} q=-1+(1+z)\frac{h'}{h}, \end{aligned}$$

Using Eqs. (102) and (103) one can obtain the present value of the deceleration parameter \(q_0\) as

$$\begin{aligned} q_0=-1+\frac{1}{6} \left( 3\Omega _{m0}+4\Omega _{r0}\right) \left( 1-3\bar{\alpha }\Omega _{m0}-2\bar{\alpha }\Omega _{r0}\right) . \end{aligned}$$
(107)

The behaviors of the Hubble function and of the deceleration parameter are shown in Fig. 1 for three different values of \(\bar{\alpha }\). As one can see from the left panel of Fig. 1, the Hubble function is a monotonically increasing function of z, and up to the redshift \(z\approx 2\), its evolution is weakly dependent of the numerical values of the model parameter \(\bar{\alpha }\). For larger values of the redshift, significant differences between the model prediction and the observations do appear for some \(\bar{\alpha }\) values. However, \(\bar{\alpha }=0.0007\) reproduces well the observed behavior of H(z) up to at least a redshift of \(z\approx 4\). In order to compare the present model with the \(\Lambda \)CDM theory, let us see the differences (in %) between the two models at some specific redshifts. For \(\bar{\alpha }=-0.002\), h differs from the \(\Lambda \)CDM model at redshifts \(z=1\) and \(z=3\) by \(0.35\%\), and \(3.8\%\) respectively. Also for \(\bar{\alpha }=0.007\) for the deviations of h from the \(\Lambda \)CDM theory at \(z=1\) and \(z=3\) one obtains \(0.12\%\) and \(1.30\%\), respectively.

Fig. 1
figure 1

The Hubble function (left panel) and the deceleration parameter (right panel) as a function of the redshift z for the multiplicative model of the \(f\left( R,L_m,T\right) \) theory with \(L_m=-\rho \) for three different values of the constant \(\bar{\alpha }\): \(\bar{\alpha }=-0.002\) (dashed curve), \(\bar{\alpha }=-0.001\) (dotted curve) and \(\bar{\alpha }=0.0007\) (dot-dashed curve). For the Hubble parameter, we have also plotted the observational data together with their errors [168,169,170,171,172,173,174,175,176]. The \(\Lambda \)CDM curve is depicted as a red solid curve

The variation of the deceleration parameter of the model, is represented in the right panel of Fig. 1. The Universe enters into an accelerating expansionary phase at \(z\approx 0.5\), and in the range \(z\in (0,1)\) the cosmological evolution is weakly dependent of the numerical values of the model parameters. However, for larger redshifts, the variation of q shows large deviations from the predictions of the \(\Lambda \)CDM model, with \(\bar{\alpha }=0.0007\) giving the closest description to the predictions of standard general relativistic cosmology.

5.3 The multiplicative case: \(f(R,L_m,T)=R+\alpha TL_m\), with \(L_m=p\)

It is well-known that there are two choices for the perfect fluid matter Lagrangian, i.e. \(L_m=-\rho \) and \(L_m=p\). These two choices lead to the same matter energy–momentum tensor in the case of Einstein’s gravity. However, in the case of modified theories of gravity, these two distinct possibilities lead to different dynamical evolutions of the Universe.

5.3.1 The radiation dominated Universe

Now, let us consider the case \(L_m=p\). In the case of radiation with \(p=\frac{1}{3}\rho \), the evolution equations (80)–(82) can be written as

$$\begin{aligned}&3 \dot{H}+\frac{2}{3} (\alpha \rho +24\pi ) \rho =0,\nonumber \\&3 \dot{H}+6 H^2+\beta -\frac{2}{9} \alpha \rho ^2=0, \end{aligned}$$
(108)

and

$$\begin{aligned} \frac{2}{3}\left( 9\pi +\alpha \rho \right) {\dot{\rho }}+(24\pi +\alpha \rho )H \rho =0. \end{aligned}$$
(109)

As in the case of \(L_m=-\rho \), the above set of equations admit the radiation dominated solution with

$$\begin{aligned} H=\sqrt{\frac{\mathcal {D}}{54}}, \end{aligned}$$
(110)

and

$$\begin{aligned}&t-t_0=\sqrt{\frac{-3}{8\beta }}\,\ln \left[ \frac{16}{3\rho }\left( \frac{3(8\pi \rho -\beta )}{\sqrt{-\beta }}+\sqrt{\mathcal {D}}\right) \right] -\sqrt{\frac{25\alpha }{24\mathcal {A}}}\nonumber \\&\quad \times \ln \bigg [\frac{\sqrt{\alpha }\left( 3\alpha \beta +576\pi ^2+40\pi \alpha \rho \right) -\alpha \sqrt{\mathcal {A}\mathcal {D}}}{\sqrt{\mathcal {A}}(\alpha \rho +24\pi )}\bigg ], \end{aligned}$$
(111)

where we have defined \(\mathcal {D}=8\alpha \rho ^2+144\pi \rho -9\beta \).

5.3.2 The dust Universe

In the case of matter dominated Universe with \(p=0\), the cosmological evolution equations can be written as

$$\begin{aligned}&4 \dot{H}+ (16 \pi -\alpha \, \rho )\rho =0, \end{aligned}$$
(112)
$$\begin{aligned}&4 (3 \dot{H} +6 H^2+\beta )+(\alpha \rho -16 \pi ) \rho =0, \end{aligned}$$
(113)

and

$$\begin{aligned} 2 (8 \pi -\alpha \rho ) {\dot{\rho }}+3 (16\pi -3 \alpha \rho ) H \rho =0, \end{aligned}$$
(114)

respectively.

By subtracting Eqs. (112) and (113) we obtain H(t) as

$$\begin{aligned} H(t)=\frac{\sqrt{ (16 \pi -\alpha \rho )\,\rho -\beta }}{\sqrt{6}}. \end{aligned}$$
(115)

Now, by using the expression of the Hubble function in terms of the energy density, and using the field equations, we obtain

$$\begin{aligned} t-t_0=\int \left( \frac{\sqrt{\frac{2}{3}} (16 \pi -2 \alpha \rho )}{\rho (\alpha \rho -16 \pi ) \sqrt{16 \pi \rho -\alpha \rho ^2-\beta }}\right) d\rho . \end{aligned}$$
(116)

5.3.3 Numerical results

To describe the general evolution of the Universe we assume again that \(\rho =\rho _m+\rho _r\). The generalized Friedmann equations in terms of redshift are

$$\begin{aligned}&6 (1+z)h\, h'-9 \Omega _m-12 \Omega _r\nonumber \\&\quad +\bar{\alpha } \left( 6 \Omega _m \Omega _r+9 \Omega _m^2-8 \Omega _r^2\right) =0, \end{aligned}$$
(117)

and

$$\begin{aligned}&18 (1+z)h\, h'-36 h^2-18 \bar{\beta }\nonumber \\&\quad +\bar{\alpha } \left( 6 \Omega _m \Omega _r-9 \Omega _m^2+8 \Omega _r^2\right) +9 \Omega _m, \end{aligned}$$
(118)

respectively. The generalized conservation Eq. (82) for dust and radiation takes the form

$$\begin{aligned}&3 \left[ \bar{\alpha }\left( 3 \Omega _m-2 \Omega _r\right) -3\right] \Omega _m\nonumber \\&\quad -(1+z) \left[ \bar{\alpha } \left( 6 \Omega _m+\Omega _r\right) -3\right] \Omega _m' =0, \end{aligned}$$
(119)

and

$$\begin{aligned}&12 \left[ \bar{\alpha } \left( 2 \Omega _r-3 \Omega _m\right) +3\right] \Omega _r\nonumber \\&\quad +(1+z) \left[ \bar{\alpha } \left( 3 \Omega _m-16 \Omega _r\right) -9\right] \Omega _r'=0, \end{aligned}$$
(120)

respectively. For this case, with the use of Eqs. (117) and (118), the constant parameter \(\bar{\beta }\) can be obtained as

$$\begin{aligned} \bar{\beta }&=\frac{2}{9}\big [-9+3(3-\bar{\alpha }\Omega _{r0}-3\bar{\alpha }\Omega _{m0})\Omega _{m0}\nonumber \\&\quad +(9+8\bar{\alpha }\Omega _{r0})\Omega _{r0}\big ]. \end{aligned}$$
(121)

The current value for the deceleration parameter is given by

$$\begin{aligned} q_0=-1+\frac{1}{6}\left( 3\Omega _{m0}+4\Omega _{r0}\right) \left[ 3-\bar{\alpha }\Omega _{m0}+2\bar{\alpha }\Omega _{r0}\right] . \end{aligned}$$
(122)

The variations of the Hubble function and of the deceleration parameter are shown, as functions of the redshift, in Fig. 2.

Fig. 2
figure 2

The Hubble function (left panel) and the deceleration parameter (right panel) as a function of the redshift z for the multiplicative model of the \(f\left( R,L_m,T\right) \) theory with \(L_m=p\) for three different values of the constant \(\bar{\alpha }\): \(\bar{\alpha }=-0.13\) (dashed curve), \(\bar{\alpha }=-0.32\) (dotted curve), and \(\bar{\alpha }=-0.45\) (dot-dashed curve), respectively. For the Hubble function, we have also plotted the observational data together with their errors [168,169,170,171,172,173,174,175,176]. The \(\Lambda \)CDM curve is depicted as a red solid curve

As one can see from the left panel of Fig. 2, up to a redshift of \(z\approx 1\), the present model gives a good description of the observational data for h(z), and its predictions almost coincide with the \(\Lambda \)CDM model. The dependence on the model parameter \(\bar{\alpha }\) is weak in the low redshift range. However, for \(z>1\), the model behavior is influenced by the numerical values of \(\bar{\alpha }\), but a good description of the observational data for the Hubble function up to \(z\approx 4\) can be obtained for \(\bar{\alpha }=-0.13\).

Now, we can obtain the deviations (in %) of the dimensionless Hubble parameter h from the \(\Lambda \)CDM values. At \(z=1\) for \(\bar{\alpha }=-0.13\) and \(\bar{\alpha }=-0.45\), we have \(-1.34\%\), and \(-1.91\%\), respectively. However, at \(z=3\) the deviations become more significant, and can be obtained as \(-4.57\%\) and \(-6.54\%\) respectively.

A comparable situation can be seen in the description of the deceleration parameter, shown in the right panel of Fig. 2, whose evolution is strongly dependent on the model parameters even at low redshifts. However, \(\bar{\alpha }=-0.13\) gives a very good description of the \(\Lambda \)CDM model values, with the differences slightly increasing in the low redshift region. Hence, for \(\bar{\alpha }=-0.13\), the present model gives a good description of the observational data for the expansion rate, and of the deceleration parameter up to a redshift of \(z\approx 4\).

5.4 The additive case: \(f(R,L_m,T)=R+\alpha k(R)+\beta g(T)+2\gamma h(L_m)+\lambda \)

Let us consider now the case when the Lagrange density of the gravitational field is given by an additive type algebraic structure of the form

$$\begin{aligned} f\left( R,L_m,T\right) =R+\alpha \, k(R)+\beta \,g(T)+2\gamma \, h\left( L_m\right) +\lambda ,\nonumber \\ \end{aligned}$$
(123)

where k(R), g(T) and \(h\left( L_m\right) \) are arbitrary functions of their arguments. With this choice of f the cosmological evolution equations can be written as

$$\begin{aligned}&-2(1+\alpha k^\prime )\dot{H}\nonumber \\&\quad =(8\pi +\beta g^\prime +\gamma h^\prime )(\rho +p)+\alpha \, a\frac{d}{dt}\left( \frac{1}{a}\dot{k}^\prime \right) , \end{aligned}$$
(124)
$$\begin{aligned}&-3(1-\alpha k^\prime )(\dot{H}+2H^2)\nonumber \\&\quad =\alpha k+\beta g+2\gamma h+\lambda -2L_m(\beta g^\prime +\gamma h^\prime )\nonumber \\&\qquad -\frac{1}{2}(\rho -3p)(8\pi +\beta g^\prime +\gamma h^\prime )+\frac{3\alpha }{2a^3}\frac{d}{dt}\left( a^3\dot{k}^\prime \right) , \end{aligned}$$
(125)

and

$$\begin{aligned}&(8\pi +\beta g^\prime +\gamma h^\prime )({\dot{\rho }}+\dot{p}+4H(\rho +p))\nonumber \\&\quad =2(\dot{H}+2H^2)(1+\alpha k^\prime )\frac{d}{dt}\ln \frac{1+\alpha k^\prime }{6(\dot{H}+2H^2)}\nonumber \\&\qquad -(\rho +p)(\beta \dot{g}^\prime +\gamma \dot{h}^\prime )-\alpha \frac{d}{dt}\left( \frac{1}{a^3}\frac{d}{dt}\left( a^3\dot{k}^\prime \right) \right) , \end{aligned}$$
(126)

respectively.

In the following we will adopt for the additive gravitational Lagrange density the simple form corresponding to \(k(R)=0\), \(g(T)=T\), and \(h\left( L_m\right) =L_m\), so that

$$\begin{aligned} f\left( R,L_m,T\right) =R+\beta \, T+2\gamma \, L_m. \end{aligned}$$
(127)

As for the choice of the matter Lagrangian, we will restrict our analysis to the case \(L_m=-\rho \) only.

5.4.1 The radiation dominated Universe

By assuming that the matter content of the Universe is radiation with \(p=\rho /3\), the generalized Friedmann equations take the form

$$\begin{aligned}&3 \dot{H}+2 (\beta +\gamma +8 \pi )\rho =0, \end{aligned}$$
(128)
$$\begin{aligned}&3 \dot{H}+6 H^2+\lambda +2 \beta \rho =0, \end{aligned}$$
(129)

while the evolution of the energy density can be obtained from the energy balance equation as

$$\begin{aligned} (\gamma +8 \pi ) {\dot{\rho }}+4 (\beta +\gamma +8 \pi )H \rho =0. \end{aligned}$$
(130)

One should note that the energy balance equation is not independent of the field equations (128) and (129). From Eqs. (128) and (129) one can obtain the time evolution of the Hubble function and of the energy density as follows

$$\begin{aligned} H=\sqrt{\frac{\lambda }{6} } \tan (g_1(t)), \end{aligned}$$
(131)

and

$$\begin{aligned} \rho =\frac{\lambda }{2 (\gamma +8 \pi )} \sec ^2(g_1(t)), \end{aligned}$$
(132)

where

$$\begin{aligned} g_1(t)=\sqrt{\lambda } \left( \frac{c_1}{2}-\frac{ \sqrt{2} (\beta +\gamma +8 \pi )t}{\sqrt{3}(\gamma +8 \pi ) }\right) , \end{aligned}$$
(133)

and \(c_1\) is a constant of integration. By using Eq. (131) one can obtain the scale factor as

$$\begin{aligned} a(t)= c_2 \left[ \cos (g_1(t))\right] ^{\frac{\gamma +8 \pi }{2 (\beta +\gamma +8 \pi )}}, \end{aligned}$$
(134)

where \(c_2\) is a constant of integration.

5.4.2 The dust Universe

For the additive choice of the Lagrangian of the f(RLmT) theory, with \(L_m=-\rho \), and for the equation of state \(p=0\), the metric equations and the energy balance equations have the from

$$\begin{aligned}&2 \dot{H}+ (\beta +\gamma +8 \pi )\rho =0, \end{aligned}$$
(135)
$$\begin{aligned}&6 \dot{H}+12 H^2+2 \lambda +(\beta -\gamma -8 \pi ) \rho =0,\end{aligned}$$
(136)
$$\begin{aligned}&(\beta +2 \gamma +16 \pi ) {\dot{\rho }}+6 (\beta +\gamma +8 \pi )H \rho =0. \end{aligned}$$
(137)

These equations have the following exact solutions for the Hubble parameter and matter energy density,

$$\begin{aligned} H=\sqrt{\frac{\lambda }{6}} \tan (g_2(t)) , \end{aligned}$$
(138)

and

$$\begin{aligned} \rho =\frac{\lambda }{\beta +2 \gamma +16 \pi } \sec ^2(g_2(t)), \end{aligned}$$
(139)

respectively, where

$$\begin{aligned} g_2(t)= \sqrt{\lambda } \left( \frac{c_1}{2}-\frac{\sqrt{6} (\beta +\gamma +8 \pi )\,t}{2\beta +4 (\gamma +8 \pi )}\right) , \end{aligned}$$
(140)

and \(c_1\) is an integration constant. Now one can obtain the scale factor as

$$\begin{aligned} a=c_2 \left[ \cos (g_2(t))\right] ^{\frac{\beta +2 (\gamma +8 \pi )}{3 (\beta +\gamma +8 \pi )}}, \end{aligned}$$
(141)

where \(c_2\) is an integration constant.

5.4.3 Numerical solutions

In this section we consider the numerical solutions for the additive choice of the Lagrangian in the presence of dust and radiation, as the matter constituents of the Universe. We rescale the parameters that enter in the gravitational Lagrangian and the cosmological equations according to

$$\begin{aligned} \bar{\beta }=\kappa ^2\beta ,\quad \bar{\gamma }=\kappa ^2\gamma ,\quad \lambda =3H_0 \bar{\lambda }. \end{aligned}$$
(142)

In terms of the redshift the generalized cosmological equations are

$$\begin{aligned}&2 (1+z)h\, h'- \left( 6 \bar{\gamma }+6 \bar{\beta }+3\right) \Omega _m\nonumber \\&\quad -\left( 8 \bar{\gamma }+8 \bar{\beta }+4\right) \Omega _r =0, \end{aligned}$$
(143)

and

$$\begin{aligned}&2 (1+z)h\, h'-4 h^2-2\bar{\lambda }-8 \bar{\beta } \Omega _r\nonumber \\&\quad +\left( 2 \bar{\gamma }-2 \bar{\beta }+1\right) \Omega _m =0, \end{aligned}$$
(144)

respectively, while the conservation equations for dust and radiation are

$$\begin{aligned}&(1+z) \left( 1+2 \bar{\gamma }\right) \Omega _r'-4 \Omega _r \left( 1+2 \bar{\gamma }+2 \bar{\beta }\right) =0,\nonumber \\&(1+z) \left( 1+2 \bar{\gamma }+\bar{\beta }\right) \Omega _m'-3 \Omega _m \left( 1+2 \bar{\gamma }+2 \bar{\beta }\right) =0. \end{aligned}$$
(145)

One should note that the value of the parameter \(\bar{\lambda }\) can be obtained by the use of Eqs. (143) and (144) at \(z=0\) in terms of \(\bar{\beta }\) and \(\bar{\gamma }\) as

$$\begin{aligned} \bar{\lambda }=-2+2\left( 1+\bar{\beta }+2\bar{\gamma }\right) \Omega _{m0}+2\left( 1+2\bar{\gamma }\right) \Omega _{r0}. \end{aligned}$$
(146)

Also the current value of the deceleration parameter in this case is

$$\begin{aligned} q_0=-1+\frac{1}{2}\left( 1+2\bar{\beta }+2\bar{\gamma }\right) \left( 3\Omega _{m0}+4\Omega _{r0}\right) . \end{aligned}$$
(147)

The results obtained by the numerical integration of the generalized Friedmann equations for this case are shown, for four different choices of \(\bar{\beta }\) and \(\bar{\gamma }\), in Fig. 3.

Fig. 3
figure 3

The dimensionless Hubble function (left panel) and the deceleration parameter (right panel) as a function of the redshift z for the additive case of the \(f\left( R,L_m,T\right) \) gravity theory, with \(L_m=-\rho \), for four different values of the constants \(\bar{\beta }\) and \(\bar{\gamma }\): \(\bar{\beta }=0.12\) and \(\bar{\gamma }=0.0\) (dashed curve), \(\bar{\beta }=0.0\) and \(\bar{\gamma }=-0.14\) (long-dashed curve), \(\bar{\beta }=-0.12\) and \(\bar{\gamma }=0.15\) (dot-dashed curve), and \(\bar{\beta }=0.11\) and \(\bar{\gamma }=-0.32\) (dotted curve), respectively. For the Hubble parameter, we have also plotted the observational data together with their errors [168,169,170,171,172,173,174,175,176]. The \(\Lambda \)CDM curve is depicted as a red solid curve

As one can see from the left panel of Fig. 3, for some model parameter values the simple additive algebraic structure of the \(f\left( R,L_m,T\right) \) gravity theory provides a good description of the behavior of the Hubble function in the redshift range \(z<1\). For higher redshifts a strong dependence on the model parameters does appear, and the differences with respect to the standard \(\Lambda \)CDM model become important.

For the case with \(\bar{\beta }=-0.12\) and \(\bar{\gamma }=0.15\), the percent deviation of the dimensionless Hubble parameter h with respect to the \(\Lambda \)CDM values at \(z=1\) and \(z=3\) are \(2.66\%\), and \(11.80\%\), respectively. One can also compare these values with the corresponding quantities for the parameters \(\bar{\beta }=0.11\) and \(\bar{\gamma }=-0.32\), which are \(6.80\%\), and \(-11.80\%\), respectively.

An analogues strong dependence on the numerical values of \(\bar{\beta }\) and \(\bar{\gamma }\) can be seen in the behavior of the deceleration parameter, as shown in the left panel of Fig. 3, with some combinations of the parameters providing a good description of the \(\Lambda \)CDM data at low redshifts, and with other combinations describing better the standard cosmological model at higher redshifts.

6 Discussions and final remarks

In the present paper we have considered a generalized gravity model with the gravitational Lagrangian density given by an arbitrary function of the Ricci scalar, of the trace of the energy–momentum tensor T, and of the Lagrange density of the matter \(L_m\), respectively. The proposed action represents a non-trivial extension of the standard Hilbert–Einstein action for the standard general relativistic gravitational field, \( S=\int \left[ R/2+L_{m}\right] \sqrt{-g}\,d^{4}x\), and it unifies two already well-developed modified gravity theories, the \(f\left( R,L_m\right) \) theory, and the f(RT) theory, respectively. It is important to note that the classical Hilbert–Einstein action, as well as most of its generalizations, has an intrinsic additive algebraic structure, and is constructed as the sum of independent geometrical and physical terms, without involving any coupling between matter and geometry.

On the other hand, the \(f\left( R,L_m,T\right) \) modified theory of gravity considered in the present paper offers the possibility of going beyond this simple algebraic structure, and also brings new degrees of freedom into the gravitational theories. Moreover, besides its theoretical interest, such a generalization may cure some of the cosmological pathologies of either f(RT) or \(f\left( R,L_m\right) \) theories, like, for example, those pointed out in [116], by providing a description of the cosmological evolution valid from high to low redshifts. In our study we have restricted our numerical analysis of the cosmological evolution for a redshift range \(0\le z\le 3\), and at higher redshifts some differences between the considered models do appear. To clarify the nature of these deviations it is necessary to perform a fit of the model predictions and observational data. But our preliminary results already indicate that the theory can provide an acceptable description to the observational data, also representing an attractive alternative to the \(\Lambda \)CDM cosmology.

When formulating the \(f\left( R,L_m,T\right) \) gravity theory an interesting analogy with the geometry-matter symmetric Einstein theory is found. It is known that the field equations (16) contain the cosmological constant as a constant of integration [154,155,156,157,158]. This can be shown immediately by taking the divergence of Eq. (16), together with the postulates of the conservation of the matter energy–momentum tensor, \(\nabla _{\mu }T^{\mu \nu }=0\), which gives \(\nabla _{\mu }R=-8\pi \nabla _{\mu }T\), \(\nabla _{\mu }\left( R+8\pi \right) =0\), and \(R+8\pi T=\Lambda \), where \(\Lambda \) is an integration constant. After substitution of \(R=\Lambda -8\pi T\) into Eq. (16) we reobtain the standard Einstein equations in the presence of a cosmological constant, which thus becomes a simple integration constant. This representation of the Einstein field equations is also called unimodular gravity. The trace-free Einstein equations can be obtained from the variational principle [159, 160]

$$\begin{aligned} S\left[ g,W,\Lambda \right] =\frac{1}{\kappa ^2}\int {\left[ -\frac{R}{2}+\Lambda \left( \nabla _{\mu }W^{\mu }-1\right) \right] \sqrt{-g}d^4x}.\nonumber \\ \end{aligned}$$
(148)

The field equations of the traceless representation of the \(f\left( R,L_m,T\right) \) gravity theory represent an extension of the geometry-matter symmetric Einstein theory, with the field equations taking the form

$$\begin{aligned} R_{\mu \nu }-\frac{1}{4}Rg_{\mu \nu }=8\pi \tilde{G}_{eff}\left( T_{\mu \nu }-\frac{1}{4}Tg_{\mu \nu }\right) +U_{\mu \nu }, \end{aligned}$$
(149)

where

$$\begin{aligned} \tilde{G}_{eff}=\frac{1}{f_R}\left( 1+\frac{f_L+2f_T}{16\pi }\right) , \end{aligned}$$
(150)

and

$$\begin{aligned}&U_{\mu \nu }=- \frac{1}{f_{R}}\left( \frac{1}{4}g_{\mu \nu }\Box -\nabla _{\mu }\nabla _{\nu }\right) f_{R}\nonumber \\&+\frac{f_T}{f_R}\left( \tau _{\mu \nu }-\frac{1}{4}\tau g_{\mu \nu }\right) , \end{aligned}$$
(151)

respectively. In the absence of the electromagnetic type interactions, the supplementary term \(U_{\mu \nu }\) generated by the geometry-matter coupling takes the simple form \(U_{\mu \nu }=- \left( 1/f_{R}\right) \left[ \left( g_{\mu \nu }/4\right) \Box -\nabla _{\mu }\nabla _{\nu }\right] f_{R} \).

As one can see from the field equations (149), the matter energy–momentum tensor \(T_{\mu \nu }\) is generally not conserved, and \(\nabla _{\mu }T^{\mu \nu }\ne 0\). Of course one can construct conservative models in which the energy–momentum conservation is imposed a priori, \(\nabla _{\mu }T^{\mu \nu }=0\), but the possible non-conservation of \(T_{\mu \nu }\) has far reaching physical implications. First of all, the motion of free particles is not geodesic anymore, and it takes place in the presence of an extra-force generated by the geometry-matter coupling. The extra-force generates an extra-acceleration, and hence, in the Newtonian limit, the total acceleration \(\vec {a}\) of a massive gravitating objects can be written as \(\vec {a}=\vec {a}_N+\vec {a}_E\). If \(\vec {a}_E=0\), then the acceleration of the object is \(\vec {a}=\vec {a}_N\), with the Newtonian acceleration of an object moving in the gravitational field created by a mass M given by \(\vec {a}_N=-GM\vec {r}/r^3\). From the acceleration equation we obtain

$$\begin{aligned} \vec {a}_E\cdot \vec {a}_N=\frac{1}{2}\left( \vec {a}^2-\vec {a}_N^2-\vec {a}_E^2\right) , \end{aligned}$$
(152)

which allows to express the vector \(\vec {a}_N\) as

$$\begin{aligned} \vec {a}_N=\frac{1}{2}\left( \vec {a}^2-\vec {a}_N^2-\vec {a}_E^2\right) \frac{\vec {a}}{\vec {a}_E\cdot \vec {a}}+\vec {C}\times \vec {a}_E, \end{aligned}$$
(153)

where \(\vec {C}\) is an arbitrary vector, which for simplicity will be taken as zero in the following. From Eq. (153) it follows that in order to obtain a consistent mathematical description \(\vec {a}_E\cdot \vec {a}\ne 0\), that is, the vectors \(\vec {a}_E\) and \(\vec {a}\) cannot be orthogonal. Without any loss of generality we will assume that they are parallel. By denoting

$$\begin{aligned} \frac{1}{\tilde{a}_E}=\frac{1}{2}\frac{\left| \vec {a}\right| }{\left| \vec {a}_E\right| }\left( 1-\frac{\vec {a}_N^2}{\vec {a}^2}-\frac{\vec {a}_E^2}{\vec {a}^2}\right) , \end{aligned}$$
(154)

we obtain

$$\begin{aligned} \vec {a}=\tilde{a}_E\vec {a}_N, \end{aligned}$$
(155)

that is, the total acceleration of an object in the gravitational field of a mass M is proportional to the Newtonian acceleration. Such a relation has been already inferred from the study of the galactic rotation curves of massive test particles gravitating around the galactic center, and it is called the radial acceleration relation (RAR) [159,160,161,162]. The radial acceleration relation is an empirical relation that tries to establish a connection between the centripetal acceleration \(a_{obs} (R)= V_ {rot}^2 (R)/R\) observed in galaxies, and usually attributed to the presence of dark matter, and the Newtonian acceleration \(a_{bar}(R)=V_{bar}^2/R\) of the observed baryonic matter distribution. The relation can be formulated as

$$\begin{aligned} a_{obs}=\nu \left( \frac{a_{bar}}{a_+}\right) a_{bar}, \end{aligned}$$
(156)

where \(\nu (x)\) denotes a fitting function whose mathematical form must be determined observationally, while \(a_+\) denotes an acceleration scale. A similar relation, indicating the proportionality of the total acceleration to the Newtonian one does naturally appear in the low velocity/low density limit of the \(f\left( R,L_m,T\right) \) gravity, as shown by Eq. (155), where such a relation is a direct consequence of the geometry-matter coupling. More interestingly, the extra-acceleration predicted by the theory in the Newtonian limit is dependent on the density of the baryonic matter, \(a_E=a_E(\rho )\), a result that indicates a possible relation with the chameleon field models [163,164,165]. The chameleon scalar field is a light scalar field, with a mass depending on the background baryonic matter density. However, such environmental effects can also be generated by the geometry-matter coupling, indicating a baryonic density dependence of the astrophysical processes on large scales.

We have also obtained the generalized Poisson equation in the Newtonian limit of the theory, by using a series expansion near a fixed point of the theory, and restricting our analysis to the first order terms. The series expansion also generates a constant term, that can be interpreted as the cosmological constant, and which in the present approach is nothing but the difference of the Lagrangian density at a fixed point at its first order approximation, \(\Lambda =\left( 1/2\alpha \right) \left[ f\left( R_0,T_0,L_{m0}\right) - \alpha R_0-\beta T_0-\gamma L_{m0}\right] \). Hence in this approximation the cosmological constant appears as a second order effect in the series expansion of the full Lagrangian density \(f\left( R,L_m,T\right) \), and hence this interpretation may justify its smallness. In the same order of approximation there is a shift of the gravitational constant, determined by the derivatives of f with respect to \(L_m\) and T estimated for some background values of the model parameters. However, the constraints on the numerical value of the gravitational constant [166, 167] could lead to the determination of some limits of the gravitational Lagrangian in modified gravity with geometry-matter coupling.

The Dolgov–Kawasaki instability is a general feature of modified theories of gravity, in which higher order equations of motion do emerge that may exhibit unphysical behaviors. For example, unitarity may be broken, and ghosts or tachyons could develop. Moreover, the breaking of the laws of gravity in the weak field regime and for small curvatures leads to contradiction with basic observational facts. We have investigated in detail the Dolgov–Kawasaki instability for the \(f\left( R,L_m,T\right) \) theory, and we have obtained the criterion for the stability of the theory, \(f_{RR}\left( 0\right) \ge 0\). This is the standard stability condition as obtained in, for example, f(R) gravity, a condition that assures the instability of the perturbations, and the absence of the tachyonic instabilities.

An important field of application of \(f\left( R,L_m,T\right) \) is cosmology. We have obtained the generalized Friedmann equations (80) and (81), which must be usually considered together with the energy–momentum balance equation (82). The condition for the accelerated expansion is given by Eq. (87), and it can be satisfied by a large variety of functional forms of the Lagrange density of the gravitational field in the \(f\left( R,L_m,T\right) \) gravity. We have investigated in detail two distinct classes of cosmological models, corresponding to a multiplicative and an additive structure of the terms involving the geometry-matter coupling. The evolutionary cosmological models have a large variety of behaviors, and different types of accelerating or decelerating models can be constructed. Overall, for some values of the model parameters, the considered model give a good description of the cosmological observational data, and they can reproduce the predictions of the \(\Lambda \)CDM paradigm at both low (\(z<1\)) and higher (\(z\approx 4\)) redshifts.

It should be noted here that in the plots of the Hubble functions H(z), we have normalized them to the current value of the Hubble function \(H_0\). However, for every choice of the model parameters, the current value of the Hubble function is different, and this value should be obtained by fitting the theory with the observational data, thus obtaining some observational constraints on the model parameters. This will be done in future works. As for the Hubble tension problem, we would like to point out that all modified gravity theories that make the Hubble tension better, will make the \(\sigma _8^0\) tension worsen [177,178,179]. However, as a possible solution to these problems, in [180] it was shown that a decaying dark matter model can be considered as a solution to both tensions simultaneously. Such an approach can also be extended to gravitational theories with geometry-matter coupling.

The present gravitational theory still faces the problem of the degeneracy of the matter Lagrangian, leading to two different classes of models corresponding to the choices \(L_m=-\rho \), and \(L_m=p\), respectively.

However, a possible solution of this problem can be obtained as follows. For simplicity we assume that the Lagrangian density \(L_{m}\) of the ordinary matter is a function of the metric tensor components \(g_{\mu \nu }\) only, and not of its derivatives. Then for the energy–momentum tensor we obtain the expression \(T_{\mu \nu }=L_{m}g_{\mu \nu }-2\partial L_{m}/\partial g^{\mu \nu }\). Moreover, we assume that the matter satisfies a barotropic equation of state \(p=p(\rho )\), and thus the matter Lagrangian, that generally can be considered a function of both \(\rho \) and p, \(L_m=L_m(\rho , p)\) becomes a function of the matter density only, \(L_m=L_m(\rho )\). By assuming that the matter current is conserved, \(\nabla _{\nu }\left( \rho u^{\nu }\right) =0\), and by taking into account the relation \(\delta \rho =-\left( 1/2\right) \rho \left( g_{\mu \nu }+u_{\mu }u_{\nu }\right) \delta g^{\mu \nu }\) [93], it follows that the energy–momentum tensor can be written in the form

$$\begin{aligned} T^{\mu \nu }=\rho \frac{dL_{m}}{d\rho }u^{\mu }u^{\nu }+\left( L_{m}-\rho \frac{dL_{m}}{d\rho }\right) g^{\mu \nu }. \end{aligned}$$
(157)

With the use of the mathematical identity \(u^{\nu }\nabla _{\nu }u^{\mu }=d^{2}x^{\mu }/ds^{2}+\Gamma _{\nu \lambda }^{\mu }u^{\nu }u^{\lambda }\), from the condition \(\nabla ^{\mu }T_{\mu \nu }=0\) we obtain the equation of motion of the fluid as

$$\begin{aligned} \frac{d^{2}x^{\mu }}{ds^{2}}+\Gamma _{\nu \lambda }^{\mu }u^{\nu }u^{\lambda }+h^{\mu \nu }\nabla _{\nu }\ln \left| K\frac{dL_m(\rho )}{d\rho }\right| =0, \end{aligned}$$
(158)

where K is a constant of integration. A comparison of Eqs. (158) and (39) gives the relation

$$\begin{aligned} K\frac{dL_m(\rho )}{d\rho }\!=\!\sqrt{Q}\approx 1+U\left( \phi ,\rho ,p,T, L_m,f_m, \nabla _{\nu }T,\ldots \right) ,\nonumber \!\!\!\!\!\!\\ \end{aligned}$$
(159)

where we have also used Eq. (41). The above equation leads use to the general result that in modified gravity theories with geometry-matter coupling the matter energy–momentum tensor must be constructed dynamically for each individual model, by solving the differential equation (159). In the first order of approximation, when \(U(\phi ,\rho ,p,T, L_m,f_m, \nabla _{\nu }T,\ldots )\ll 1\), Eq. (159) gives \(L_m\approx \rho /K\), which is the (approximate) expression we have adopted in our investigations of the cosmological models, and which coincides with the standard general relativistic matter Lagrangian. This limiting procedure also fixes the value of the constant K as \(K=-1\).

To conclude, the current investigation of the unified \(f\left( R,T,L_m\right) \) gravity theory opens new avenues for the study of the theoretical, observational and even experimental aspects of the large class of alternative theories of gravity in th presence of geometry-matter coupling. In addition, the basic results obtained in the present work may also contribute to the better understanding of the physical and mathematical structure of other modified gravity theories.