1 Introduction

The remarkable success of Einstein’s theory of general relativity [1] and of its variational formulation [2] gave a huge impetus not only to gravitational physics, but also to mathematics. From a mathematical point of view, general relativity is based on Riemannian geometry, with the metric of the spacetime describing all the properties of the gravitational interaction. Almost immediately after the birth of general relativity, in an attempt to unify the electromagnetic and gravitational interactions in a fully geometric background, Hermann Weyl proposed a generalization of the Riemann geometry by introducing a supplementary geometric quantity, called nonmetricity [3,4,5,6,7]. The basic idea in Weyl’s geometric approach was to permit the length and orientation of arbitrary vectors to change under parallel transport. In Riemannian geometry, only a change in the orientation of the vectors is allowed. The geometry obtained in this way is called Weyl geometry, and it represents a consistent and systematic generalization of Riemannian geometry. In trying to provide a physical interpretation for his geometry, Weyl identified the vector part of the connection with the potential four-vector of the electromagnetic field. However, this identification is problematic. Immediately after the publication of Weyl’s theory, Einstein [8] pointed out that such an identification would imply that identical atoms moving on closed trajectories in electromagnetic fields would have different physical properties (and sizes), implying that the atoms would also have different electromagnetic spectra. The change in frequency due to the size change is clearly inconsistent with the well-known observational properties of the spectral lines. Einstein’s criticism led to the abandonment of the physical Weyl theory in its initial formulation. However, later on, Weyl proved that a satisfactory theory of the electromagnetic interaction is obtained by replacing the scale factor with a complex phase. This remarkable result is at the origin of U(1) gauge theory [9].

Even though Weyl’s geometric theory failed in its attempt of unifying gravity and electromagnetism, as a geometric theory it has many attractive features. It appears in many physical contexts, for example in foundations of quantum mechanics, elementary particle physics, scalar tensor theories of gravity, fundamental approaches to gravity, and cosmology. Hence, Weyl geometry has an important research potential, yet to be fully explored, which may provide some deeper insights into the fundamental problems of gravitation, cosmology, and elementary particle physics [10,11,12,13,14,15]. Gravitational theories satisfying the requirement of conformal invariance can be obtained using actions built up with the help of the Weyl tensor \(C_{\alpha \beta \gamma \delta }\). The corresponding action is given by \(S=-(1/4)\int {C_{\alpha \beta \gamma \delta }C^{\alpha \beta \gamma \delta }\sqrt{-g}{\textrm{d}}^4x}\) [16,17,18,19,20,21]. Gravitational field theories described by actions of this type are called conformally invariant, or Weyl type gravity theories, and their properties and implications have been extensively investigated in the literature [16,17,18,19,20,21].

A particularly interesting theoretical issue is the possible relation between the Standard Model of elementary particle physics and its extensions, and Weyl geometry. The link between elementary particle physics and geometry is provided by the concept of scale invariance, since this symmetry may also appear at the quantum level [22, 23]. All physical scales, including the new physical scales beyond the Standard Model, can be generated spontaneously by vacuum expectation values of the fields. Moreover, scale symmetry can maintain the classical hierarchy of scales [24, 25]. The new vector part of the connection in Weyl geometry is called, in the modern interpretation, the dilatational gauge vector, or the Weyl vector.

A systematic study of the relation between the Standard Model (SM) of elementary particles and Weyl conformal geometry was initiated and performed in [26,27,28,29,30,31,32] by considering a minimal embedding, with no new fields beyond the SM spectrum and Weyl geometry. The action has the Weyl gauge symmetry D(1), originating from the background geometry. The model is based on Weyl quadratic gravity, which experiences a spontaneous breaking of D(1) symmetry by a geometric Stueckelberg mechanism, with the Weyl gauge field acquiring mass from the spin-zero mode of the \(R^2\) term in the action.

To describe the properties of the gravitational field, as well as physics beyond SM, in [32] the following action was proposed

$$\begin{aligned} S_{0}=\int \Bigg [\frac{1}{4!}\frac{1}{\xi ^{2}}\tilde{R}^{2}-\frac{1}{4}\, \tilde{F}_{\mu \nu }^{2}-\frac{1}{\eta ^{2}}\tilde{C}_{\mu \nu \rho \sigma }^{2}\Bigg ]\sqrt{-g}{\textrm{d}}^{4}x, \end{aligned}$$
(1)

where \(\tilde{R}\) is the Weyl scalar, defined in the Weyl geometry, and \(\tilde{F }_{\mu \nu }\) is the strength of the Weyl vector \(\omega _{\mu }\), while \( \tilde{C}_{\mu \nu \rho \sigma }\) denotes the conformally invariant Weyl tensor.

In obtaining the gravitational field equations from a given action, several approaches can be used. The most common is the metric formalism, in which the action is varied with respect to the metric tensor \(g_{\mu \nu }\). One can also use the Palatini formalism, introduced by Einstein [33,34,35], where the metric and the connection \(\Gamma \) are considered as independent variables. To derive the field equations, the Lagrangian is varied with respect to both g and \(\Gamma \). Finally, in the metric-affine formalism, which generalizes the Palatini approach, the matter part of the action also depends on the connection, and is varied with respect to it [36,37,38,39].

In the case of the Einstein–Hilbert action, the Palatini variation leads to the Einstein gravitational field equations, giving the same result as when varying the metric only. However, this is not generally true for other gravitational type actions. For example, when used for an f(R) type gravitational Lagrangian, originally introduced in [40,41,42,43], its metric version in the Palatini formalism leads to second-order differential equations instead of the fourth-order ones obtained from the metric variation [44,45,46,47,48,49,50,51,52,53,54,55,56]. Moreover, in vacuum, the Palatini formalism f(R) field equations reduce to the field equations of standard general relativity in the presence of a cosmological constant. This result guarantees that the Palatini type f(R) theory automatically passes the solar system tests. Secondly, basic aspects of general relativity, such as the presence of black holes and gravitational waves, are preserved in the Palatini approach. However, to date no real criterion has been found indicating which variational formalism is better to apply. On the other hand, the Palatini variational procedure seems to be more attractive, since, when applied to the Hilbert–Einstein action, one obtains standard general relativity without the need to specify in advance the relation between metric and connection.

Quadratic gravity with Lagrangian \(R^2 + R_{[\mu \nu ]}^2\) was investigated in the Palatini formalism in [30] by considering both the connection and the metric independently. The action has a gauged scale symmetry (or Weyl gauge symmetry) with respect to the Weyl gauge field \(\omega _{\mu }=\tilde{ \Gamma }_{\mu }-\Gamma _{\mu }\), where \(\tilde{\Gamma }_{\mu }\) and \(\Gamma _{\mu }\) are the traces of the Weyl and Levi-Civita connections, respectively. In this approach, the underlying geometry is non-metric due to the presence of the \(R_{[\mu \nu ]}^2\) term acting as a gauge kinetic term for \(\omega _{\mu }\). This theory has a spontaneous breaking of gauged scale symmetry and mass generation in the absence of matter. Interestingly, the necessary scalar field \(\varphi \) is not added ad hoc, but it appears naturally from the \(R^2\) term. By absorbing the derivative term of the Stueckelberg field, the gauge field becomes massive. In the broken phase, the Einstein–Proca action of \(\omega _{\mu }\) of mass proportional to the Planck scale \(M \sim <\varphi>\) and a positive cosmological constant are obtained. Below the Planck scale, \(\omega _{\mu }\) decouples, the connection becomes Levi-Civita, and the metricity condition and Einstein’s general relativity are recovered. These results remain valid in the presence of a non-minimally coupled Higgs-like scalar field.

A comparative study of inflation in two theories of quadratic gravity with gauged scale symmetry was performed in [30]. Specifically, the original Weyl quadratic gravity and a theory defined by a similar action but in the Palatini approach were obtained by replacing the Weyl connection by its Palatini counterpart. These two theories have different vectorial non-metricities, induced by the gauge field \(\omega _{\mu }\). In the absence of matter, these theories have a spontaneous breaking of gauged scale symmetry, where the necessary scalar field is of geometric origin and some of the quadratic action. The Einstein–Proca action, the Planck scale, and the metricity appear in the broken phase after the Weyl vector field acquires mass through the Stueckelberg mechanism and then decouples. In the presence of nonminimally coupled matter, the scalar potential is similar in both theories. For small field values, the potential is Higgs-like, while for large field values inflation is possible. Both theories have a small tensor-to-scalar ratio \(r\sim 10^{-3}\), slightly larger in the Palatini case. For a sufficiently small coupling parameter \(\xi _1\le 10^{-3}\), Weyl’s theory gives a dependence \(r\left( n_s\right) \) similar to that in Starobinsky inflation [57,58,59].

It was pointed out in [60] that the model of the cosmic inflation with an asymptotically flat potential could be obtained from the Palatini quadratic gravity, formulated in Weyl geometry, by adding the matter field in such a way that the local gauged conformal symmetry is broken in both kinetic and potential terms.

A possible way to explain the recent cosmological data indicating the presence of an accelerated expansion of the universe and of dark matter (for a review of the observational evidence for acceleration, see [61]) is to postulate that at galactic and extragalactic scales, Einstein’s general theory of relativity must be replaced by a more general action that describes the gravitational phenomenology beyond the solar system [62, 63]. Hence, observational evidence seems to strongly point towards the necessity of going outside the strict limits of general relativity, and for looking to new gravitational theories that may solve (or account) for the dark energy and dark matter problems. Therefore, the Einstein gravitational field equations that provide a very good explanation of the gravitational processes in the solar system must be replaced by a new set of field equations.

A possible generalization of the standard Einstein theory is represented by gravitational theories implying a curvature-matter coupling [64,65,66,67,68,69,70]. In this type of model, the Hilbert–Einstein action of standard general relativity \(S=\int {\left( R/2\kappa ^2+L_m\right) \sqrt{-g}{\textrm{d}}^4x}\), where R is the Ricci scalar and \(L_m\) is the matter Lagrangian, is replaced by more general actions of the form \(S=\int {f\left( R,L_m\right) \sqrt{-g}{\textrm{d}}^4x}\) [66], or \(S=\int {f\left( R,T\right) \sqrt{-g}{\textrm{d}}^4x}\) [67], where T is the trace of the matter energy–momentum tensor. Similar couplings between matter and geometry are also possible in the presence of non-metricity and torsion [68,69,70]. For in-depth reviews and discussions of theories with curvature-matter coupling, see [71,72,73,74,75]. The curvature-matter coupling approach leads to gravitational theories having a much richer physical and mathematical structure as compared with standard general relativity. They also provide interesting explanations for the accelerating expansion of the universe and possible solutions for the dark energy and dark matter problems, respectively. But these types of theories also face a number of very difficult mathematical and physical problems. For the Palatini formulation of the \(f\left( R,L_m\right) \) theory, see [76].

For the f(RT) gravity theory [67], in which a nonminimal coupling between the Ricci scalar and the trace of the energy–momentum tensor is introduced, its Palatini formulation was investigated in detail in [77] by considering the metric and the affine connection as independent field variables. For this type of theory, the independent connection can be expressed as the Levi-Civita connection of an auxiliary metric, depending on the trace of the energy–momentum tensor and related to the physical metric by a conformal transformation. The field equations also led to the non-conservation of the energy–momentum tensor. The thermodynamic interpretation of the Palatini formulation of the theory was also discussed. The cosmological implications of the theory were also explored for several functional forms of the function f, and it was shown that the models could give an acceptable description of the observational cosmological data.

An investigation of the coupling between matter and geometry in conformal quadratic Weyl gravity was performed in [78]. To construct the physical model and the gravitational action, a coupling term of the form \(L_m\tilde{R}^2\) was assumed in the Lagrangian, where \(\tilde{R}\) is the Weyl scalar. It is important to note that this coupling explicitly satisfies the conformal invariance of the theory under the assumption that the matter Lagrangian is conformally invariant. By expressing \(\tilde{R}^ 2\) using an auxiliary scalar field and of the Riemannian Ricci scalar, the gravitational action can be linearized, leading in the Riemann space to a conformally invariant \(f \left( R,L_m\right) \) type theory, with the matter Lagrangian non-minimally coupled to the Ricci scalar.

The gravitational field equations of the theory can be obtained in the metric formalism, together with the energy–momentum balance equations. Similarly to other theories with geometry-matter coupling, the divergence of the matter energy–momentum tensor does not vanish, and an extra force, depending on the Weyl vector and the matter Lagrangian, does appear in the geodesic equations of motion. The theory can be interpreted thermodynamically as describing irreversible matter creation from the gravitational field. The generalized Poisson equation and the Newtonian limit of the equations of motion were also considered in detail. Constraints on the magnitude of the Weyl vector can be obtained from the study of the perihelion precession of a planet in the presence of an extra force, and an explicit estimation of the numerical value of a constant Weyl vector in the solar system is obtained from the observational data of Mercury. The cosmological implications of the theory have been considered for the case of a flat, homogeneous and isotropic Friedmann–Lemaitre–Robertson–Walker geometry. It turns out that the conformally invariant \(f\left( R,L_m\right) \) model gives a good description of the cosmological observational data for the Hubble function up to a redshift of the order of \(z \approx 3\).

It is the goal of the present paper to consider the Palatini formulation of the conformally invariant \(f\left( R,L_m\right) \) gravity theory proposed in [78], which intrinsically contains a curvature-matter coupling. The gravitational action is constructed directly in the framework of Weyl geometry, with the Lagrangian density given by the sum of the square of the Weyl scalar \(\tilde{R}\) (the analogue of the Ricci scalar in Weyl geometry), the strength \(F_{\mu \nu }\) of the geometric field associated with the Weyl vector \(\omega _{\mu }\), and a conformally invariant geometry-matter coupling term \(L_m\tilde{R}^2\), constructed from the matter Lagrangian and the Weyl scalar. After substituting the Weyl scalar \(\tilde{R}\) in terms of its Riemannian counterpart R, one obtains a quadratic action defined in Riemann geometry, which contains a nonminimal coupling between the Ricci scalar and the matter Lagrangian. For the sake of generality, we consider in our analysis a more general Lagrangian in which the Weyl vector is nonminimally coupled to an arbitrary function of the Ricci scalar. By varying the action independently with respect to the metric and the connection, it turns out that the independent connection can be expressed as the Levi-Civita connection of an auxiliary Ricci scalar- and Weyl vector-dependent metric. This metric is related to the physical metric by means of a conformal transformation. We obtain the field equations in both the metric and the Palatini formulations. The cosmological implications of the Palatini field equations are investigated for three distinct theoretical models corresponding to different (simple) forms of the coupling functions. The conformally invariant quadratic Weyl model is investigated in detail. A comparison with the standard \(\Lambda \)CDM model is also performed. Our main findings indicate that the Palatini type cosmological models can give an acceptable description of the cosmological observations, at least up to a redshift of the order of \(z\approx 2\).

The present paper is organized as follows. In Sect. 2, after a brief review of the fundamentals of Weyl geometry, the gravitational action in the presence of conformally invariant and an arbitrary geometry-matter coupling are written down, and the field equations are obtained by varying the action with respect to both metric and connection. The Palatini formulation of the conformally invariant \(f\left( R,L_m\right) \) gravity theory is presented in detail in Sect. 3. The cosmological implications of the Palatini formulation of the \(f\left( R,L_m\right) \) gravity theory are presented in Sect. 4. We discuss and conclude our results in Sect. 5.

2 Gravitational field equations in quadratic Weyl geometric gravity

In this section, after briefly reviewing the fundamentals of Weyl geometry, we introduce the simplest conformally invariant gravitational action in Weyl geometry in the presence of matter, constructed from the square of the Weyl scalar \(\tilde{R}\) and the strengths of the Weyl vector \(F_{\mu \nu }\). Moreover, we add to the gravitational action a geometry-matter coupling term of the form \(L_m\tilde{R}^2\). This action can be reformulated in the ordinary Riemann geometry by taking into account the straightforward relation between the Weyl and Ricci scalars. Moreover, the gauge condition on the Weyl vector is also imposed, and thus we obtain a gravitational action, defined in the ordinary Riemann geometry, which contains the square of the Ricci scalar, the coupling between the Ricci scalar and the square of the Weyl vector, some other contributions from the Weyl geometry, and the geometry-matter coupling term. The field equations for this model are derived by using both metric and Palatini formalisms.

2.1 Basics of Weyl geometry

We begin our investigation of the Palatini formulation of the quadratic Weyl gravity in the presence of geometry-matter coupling by presenting first some basic elements of Weyl geometry. In the (pseudo)-Riemannian space in which Einstein’s gravitational field equations are formulated, the metric tensor \(g_{\mu \nu }\) satisfies the metricity condition \(\nabla _{\mu } g_{\alpha \beta }=0\). From this condition one can immediately obtain the Levi-Civita connection, as given by

$$\begin{aligned} \Gamma _{\mu \nu }^\rho (g)= \frac{1}{2} g^{\rho \beta }\,(\partial _\nu g_{\beta \mu }+\partial _\mu g_{\beta \nu }-\partial _\beta g_{\mu \nu }). \end{aligned}$$
(2)

By taking \(\nu =\rho \) and summing over, we obtain \(\Gamma _\mu \equiv \Gamma _{\mu \nu }^\nu =\partial _\mu \ln \sqrt{-g}\), where \(-g\) is the square root of the determinant of the metric tensor g. Weyl conformal geometry, as well as the corresponding gravity theory, is characterized by the presence of a vectorial non-metricity, which implies that the covariant divergence of the metric tensor does not vanish, as in the Riemann geometry. Hence, the basic properties of the Weyl geometry follow from the non-metricity condition

$$\begin{aligned} \tilde{\nabla }_{\lambda } g_{\mu \nu }=-\omega _{\lambda } g_{\mu \nu }, \end{aligned}$$
(3)

where \(\omega _{\lambda }\) is the Weyl vector field. From this definition we immediately obtain \(\omega _{\lambda }=(-1/4) g^{\mu \nu }\tilde{\nabla } _{\lambda } g_{\mu \nu }\). By using the definition of \(\tilde{\nabla }_\mu \) in the Weyl connection \(\tilde{\Gamma }_{\mu \nu }^\rho \), we obtain

$$\begin{aligned} \tilde{\nabla }_{\lambda } g_{\mu \nu }= \partial _{\lambda } g_{\mu \nu } - \tilde{ \Gamma }_{\mu \lambda }^\rho g_{\rho \nu }-\tilde{\Gamma }_{\nu \lambda }^\rho g_{\mu \rho }. \end{aligned}$$
(4)

After performing a cyclic permutation of the indices, we find

$$\begin{aligned} \tilde{\Gamma }_{\mu \nu }^\rho =\Gamma _{\mu \nu }^\rho (g)+ \frac{1}{2}\, g^{\rho \lambda }\,(\tilde{\nabla }_\lambda g_{\mu \nu }-\tilde{\nabla }_\mu g_{\nu \lambda } - \tilde{\nabla }_\nu g_{\lambda \mu }). \end{aligned}$$
(5)

By taking into account Eq. (3), we obtain the Weyl connection

$$\begin{aligned} \tilde{\Gamma }_{\mu \nu }^\rho = \Gamma _{\mu \nu }^\rho (g)+\frac{1}{2}\Big [ \omega _{\nu }\delta _\mu ^\rho +\omega _{\mu }\delta _\nu ^\rho -g_{\mu \nu }\omega ^\rho \Big ]. \end{aligned}$$
(6)

The Weyl connection \(\tilde{\Gamma }_{\mu \nu }^\rho \) is symmetric, with the property \(\tilde{\Gamma }_{\mu \nu }^\rho =\tilde{\Gamma }_{\nu \mu }^\rho \). Hence, it follows that the standard Weyl geometry is torsionless. Additionally, \(\tilde{\Gamma }\) is invariant with respect to the Weyl local gauge transformation \(\Omega (x)\) of the metric \(g_{\mu \nu }\)

$$\begin{aligned} \hat{g}_{\mu \nu }=\Omega ^2(x) g_{\mu \nu },\quad \sqrt{-\hat{g}}=\Omega ^4\sqrt{-g}. \end{aligned}$$
(7)

With respect to these geometric transformations, the Weyl gauge field \( \omega _\mu \) transforms according to the rule

$$\begin{aligned} \hat{\omega }_\mu =\omega _\mu -\partial _\mu \ln \Omega ^2. \end{aligned}$$
(8)

Equations (7) and (8) define a local gauged scale transformation. Using the relation \(g^{\alpha \beta }\tilde{\nabla }_\lambda g_{\alpha \beta }=2\tilde{ \nabla }_\lambda \ln \sqrt{-g}\), for the Weyl vector field we obtain the simple expression

$$\begin{aligned} \omega _{\lambda }=-\frac{1}{2}\,\,\tilde{\nabla }_\lambda \ln \sqrt{-g}. \end{aligned}$$
(9)

We now take \(\nu =\rho \) in Eq. (6), and after summing over, we find

$$\begin{aligned} \tilde{\Gamma }_\mu =\Gamma _\mu (g)+2 \omega _{\mu }. \end{aligned}$$
(10)

The Riemann and Ricci tensors in Weyl geometry, as well as the Weyl scalar, are defined similarly to their definition in Riemannian geometry, but with the replacement of the Levi-Civita connection \(\Gamma _{\mu \nu }^\rho (g)\) by the Weyl connection \( \tilde{\Gamma }_{\mu \nu }^\rho \). Thus, we obtain

$$\begin{aligned} \tilde{R}^\lambda _{\,\mu \nu \sigma }(\tilde{\Gamma },g)= \partial _\nu \tilde{\Gamma } ^\lambda _{\mu \sigma } -\partial _\sigma \tilde{\Gamma }^\lambda _{\mu \nu } + \tilde{\Gamma }^\lambda _{\nu \rho }\,\tilde{\Gamma }^\rho _{\mu \sigma } -\tilde{\Gamma }^\lambda _{\sigma \rho }\,\tilde{\Gamma }^\rho _{\mu \nu }, \end{aligned}$$
(11)

and

$$\begin{aligned} \tilde{R}_{\mu \sigma }(\tilde{\Gamma },g)=\tilde{R}^\lambda _{\,\,\mu \lambda \sigma }(\tilde{ \Gamma },g), \tilde{R}(\tilde{\Gamma },g)=g^{\mu \sigma }\tilde{R}_{\mu \sigma }(\tilde{ \Gamma },g). \end{aligned}$$
(12)

Since \(\tilde{\Gamma }\) is invariant under the gauge transformations (7) and (8), it follows that the Riemann and Ricci tensors of the Weyl geometry are also scale-invariant. Due to the presence of \(g^{\mu \nu }\) in the Weyl scalar curvature \(\tilde{R}(\tilde{\Gamma },g)\), the Weyl scalar also transforms covariantly according to

$$\begin{aligned} \hat{R}(\tilde{\Gamma },g)=\frac{1}{\Omega ^2}\tilde{R}(\tilde{\Gamma },g). \end{aligned}$$
(13)

Using the expression of \(\tilde{\Gamma }\), we finally obtain

$$\begin{aligned} \tilde{R}(\tilde{\Gamma },g) =R(\Gamma ,g) - 3 \nabla _{\mu } \omega ^{\mu } - \frac{3}{2} g^{\mu \nu }\omega _{\mu } \omega _{\nu }, \end{aligned}$$
(14)

where \(R(\Gamma ,g)\) is the Riemann scalar curvature, while \( \nabla _{\mu }\omega ^\mu \) is defined by the Levi-Civita connection.

2.2 Conformally invariant Weyl gravity

Before beginning the in-depth investigation of the Palatini formulation of the conformally invariant Weyl gravity, we first need to mention that the Ricci tensor \(\tilde{R}_{[\mu \nu }]\) has an antisymmetric component \(\tilde{R}_{[\mu \nu ]} \equiv (1/2)\left( R_{\mu \nu }-R_{\nu \mu }\right) \), given explicitly by

$$\begin{aligned} \tilde{R}_{[\mu \nu ]}=\frac{1}{2}\left( \partial _{\mu }\tilde{\Gamma }_{\rho \nu }^{\rho }-\partial _{\nu }\tilde{\Gamma }_{\rho \mu }^{\rho }\right) . \end{aligned}$$
(15)

If one introduces the Weyl gauge field \(\omega _{\mu }=(1/2)\left( \tilde{\Gamma }_{\mu }-\Gamma _{\mu }\right) \), then one can easily show that \(\tilde{R}_{[\mu \nu ]}\) takes the form of the strength tensor of a Maxwell type field,

$$\begin{aligned} \tilde{R}_{[\mu \nu ]} =\partial _{\mu }\omega _{\nu }-\partial _{\nu }\omega _{\mu }\equiv \tilde{F}_{\mu \nu }(\omega ). \end{aligned}$$
(16)

In the following we will consider the simplest version of the Weyl conformal gravity in the presence of matter, with action given by

$$\begin{aligned} S_{W}\left( \tilde{\Gamma },g,L_m\right)&=\int \Big [\frac{1}{4!}\frac{1}{\xi ^{2}} \tilde{R}^{2}\left( \tilde{\Gamma },g\right) -\frac{1}{4}\,\tilde{R}_{[\mu \nu ]}^{2}\nonumber \\&\quad -\frac{1}{4!\gamma ^2}L_m\tilde{R}^{2}\left( \tilde{\Gamma },g\right) \Big ]\sqrt{-g}{\textrm{d}}^{4}x, \end{aligned}$$
(17)

where \(\xi \) and \(\gamma \) are two coupling constants. By taking into account Eq. (16) for \(R_{[\mu \nu ]}\), we obtain the following action for the conformally invariant Weyl type gravitational theory in the presence of matter

$$\begin{aligned} S_{W}\left( \tilde{\Gamma },g,L_m,\omega \right)&=\int \Bigg [\frac{1}{4!}\frac{1}{\xi ^{2}}\left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) \tilde{R}^{2}\left( \tilde{\Gamma },g\right) \nonumber \\&\quad -\frac{1}{4}\,\tilde{F}_{\mu \nu }^{2}(\omega )\Bigg ]\sqrt{-g}{\textrm{d}}^{4}x. \end{aligned}$$
(18)

The action (18) is defined in Weyl geometry, with the field strength tensor \(\tilde{F}_{\mu \nu }\) given by \(\tilde{F}_{\mu \nu }= \tilde{\nabla }_{\mu }\omega _{\nu }-\tilde{\nabla }_{\nu }\omega _{\mu }=\nabla _{\mu }\omega _{\nu }-\nabla _{\nu }\omega _{\mu }\).

After substituting \(\tilde{R}\left( \tilde{\Gamma },g\right) \) with its Riemannian counterpart obtained from Eq. (14), we find the corresponding action in Riemann geometry as given by

$$\begin{aligned}{} & {} S_{R}\left( \Gamma ,g,L_m,\omega \right) \nonumber \\ {}{} & {} \quad =\frac{1}{4!}\frac{1}{\xi ^{2}}\int \Bigg \{\left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) \Bigg [ R^{2}\left( \Gamma ,g\right) \nonumber \\{} & {} \qquad -3R\left( \Gamma ,g\right) \left( \omega ^{2}+2\nabla _{\mu }\omega ^{\mu }\right) +9\left( \nabla _{\mu }\omega ^{\mu }\right) ^{2}\nonumber \\{} & {} \qquad +9\omega ^{2}\nabla _{\mu }\omega ^{\mu }+\frac{9}{4}\omega ^{4}\Bigg ] -6\xi ^{2}\,\tilde{F}_{\mu \nu }^{2}\Bigg \} \sqrt{-g}{\textrm{d}}^{4}x, \end{aligned}$$
(19)

where we have denoted \(\omega ^{2}=g_{\mu \nu }\omega ^{\mu }\omega ^{\nu }\).

By performing a gauge transformation of the Weyl vector field, we can always find a gauge in which \(\nabla _{\mu }\omega ^{\mu }=0\). Hence, by imposing the gauge condition on the Weyl vector, the action in the Riemann geometry becomes

$$\begin{aligned}{} & {} S_{R}\left( \Gamma ,g,L_m,\omega \right) \nonumber \\{} & {} \quad =\frac{1}{4!}\frac{1}{\xi ^{2}}\int \Bigg \{\left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) \Bigg [ R^{2}\left( \Gamma ,g\right) \nonumber \\{} & {} \qquad -3R\left( \Gamma ,g\right) \omega ^{2} +\frac{9}{4}\omega ^{4}\Bigg ]-6\xi ^2\,\tilde{F}_{\mu \nu }^{2}\Bigg \} \sqrt{-g} {\textrm{d}}^{4}x. \end{aligned}$$
(20)

For the sake of generality, and with the main goal of considering the Palatini versions of the Weyl gravitational theories constructed generally from Weyl geometry, in the following we consider a general action, not necessarily conformally invariant, which in the equivalent Riemann geometry can be formulated as

$$\begin{aligned} S= & {} \int \Bigg \{ \frac{1}{2}f_{1}\left[ R(g,\Gamma )\right] G\left( L_m\right) +f_{2} \left[ R(g,\Gamma )\right] G\left( L_m\right) \omega ^{2} \nonumber \\{} & {} +\frac{9}{4}G\left( L_m\right) \omega ^{4}-\frac{1}{4}\,\tilde{F}_{\mu \nu }^{2}\Bigg \} \sqrt{-g}{\textrm{d}}^{4}x, \end{aligned}$$
(21)

where \(f_{i}(R)\), \(i=1,2\), and \(G\left( L_m\right) \) are arbitrary functions of the Ricci scalar \( R=g^{\mu \nu }\bar{R}_{\mu \nu }\) and of the matter Lagrangian. The only condition for the functions \( f_{i}(R)\), \(i=1,2\), and \(G\left( L_m\right) \) is the requirement that they are analytical functions of the Ricci scalar R and the matter Lagrangian \(L_m\); that is, they must possess a Taylor series expansion about any point R and \(L_m\). The conformally invariant Weyl geometric gravity is a particular case of the action (21).

From its mathematical definition it turns out that the Riemann tensor \(\bar{R}_{\mu \nu \lambda }^{\rho }\) is constructed entirely in terms of the Riemannian connection \(\bar{\Gamma }\) . The Ricci tensor is defined according to [79, 80]

$$\begin{aligned} \bar{R}_{\mu \nu }=\partial _{\lambda }\bar{\Gamma }_{\mu \nu }^{\lambda }-\partial _{\nu }\bar{\Gamma }_{\mu \lambda }^{\lambda }+\bar{\Gamma }_{\mu \nu }^{\lambda }\bar{\Gamma }_{\lambda \alpha }^{\alpha }-\bar{\Gamma }_{\mu \lambda }^{\alpha }\bar{\Gamma }_{\nu \alpha }^{\lambda }. \end{aligned}$$
(22)

In the Palatini approach, the gravitational action is formally the same as in the standard general relativistic case, but the Riemann tensor and the Ricci tensor are constructed with the independent connection \(\bar{\Gamma }\). The variational procedure consists in varying the action independently with respect to both the metric and the connection. Thus, the connection \(\bar{\Gamma }_{\mu \nu }^{\lambda }\) is obtained by varying the gravitational field action, and it is not directly constructed from the metric by using the Levi-Civita formalism.

2.3 Gravitational field equations

In the following we will consider the field equations obtained from the action (21) in the Palatini formalism. In order to do so we need to vary the gravitational action independently with respect to the metric and the connection.

In the following we define the Ricci scalar in terms of the two independent variables \(\left( g,\bar{\Gamma }\right) \) as

$$\begin{aligned} R=g^{\mu \nu }\bar{R}_{\mu \nu }, \end{aligned}$$
(23)

with \(\bar{R}_{\mu \nu }\) defined in Eq. (22).

We also introduce the matter energy–momentum tensor of the matter according to the definition

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

thus obtaining

$$\begin{aligned} \frac{\delta L_{m}}{\delta g^{\mu \nu }}=-\frac{1}{2}T_{\mu \nu }+\frac{1}{ 2}L_{m}g_{\mu \nu }. \end{aligned}$$
(25)

2.3.1 The metric field equations

By taking the variation of the action (21) with respect to the metric only, and taking into account that g and \(\bar{\Gamma }\) are independent variables, thus keeping the connection constant, we immediately obtain

$$\begin{aligned}{} & {} \left[ \frac{1}{2}f_{1}^{\prime }(R)+f_{2}^{\prime }(R)\omega ^{2}\right] \bar{R}_{\mu \nu }+f_{2}(R)\omega _{\mu }\omega _{\nu }+\frac{9}{2}\omega ^{2}\omega _{\mu }\omega _{\nu }\nonumber \\{} & {} \quad -\frac{1}{2}\left[ \frac{1}{2}f_{1}(R)+f_{2}(R)\omega ^{2}+\frac{9}{4}\omega ^{4}\right] g_{\mu \nu }\nonumber \\{} & {} \quad +\frac{1}{2}\left[ \frac{1}{2}f_1(R)+f_2(R)\omega ^2+\frac{9}{4}\omega ^4\right] \nonumber \\ {}{} & {} \quad \times \frac{G'\left( L_m\right) }{G\left( L_m\right) }\left( L_mg_{\mu \nu }-T_{\mu \nu }\right) \nonumber \\{} & {} \quad - \frac{1}{2G\left( L_m\right) }\tilde{T}_{\mu \nu }^{(\omega )}=0, \end{aligned}$$
(26)

where by a prime we have denoted a derivative with respect to the argument \(f_{i}^{\prime }(R)={\textrm{d}}f_{i}(R)/{\textrm{d}}R\), \(i=1,2\), \(G'\left( L_m\right) ={\textrm{d}}G\left( L_m\right) /{\textrm{d}}L_m\), and we have denoted

$$\begin{aligned} \tilde{T}_{\mu \nu }^{(\omega )}=\frac{1}{2\sqrt{-g}}\frac{\delta }{\delta g^{\mu \nu }}\left( \sqrt{-g}\tilde{F}_{\mu \nu }^2\right) . \end{aligned}$$
(27)

Alternatively, the metric field equations can be written as

$$\begin{aligned}{} & {} \bar{R}_{\mu \nu }+\frac{G\left( L_{m}\right) }{F}\Big [2f_{2}(R)+9\omega ^{2}\Big ]\omega _{\mu }\omega _{\nu }\nonumber \\{} & {} \quad -\frac{K}{2F}\left[ \left( 1-\frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }L_{m}\right) g_{\mu \nu }+ T_{\mu \nu }\right] -\frac{1}{F}\tilde{T}_{\mu \nu }^{(\omega )}=0,\nonumber \\ \end{aligned}$$
(28)

where we have denoted

$$\begin{aligned} F\left( R,\omega ^2,L_m\right) =\left[ f_{1}^{\prime }(R)+2f_{2}^{\prime }(R)\omega ^{2}\right] G\left( L_{m}\right) , \end{aligned}$$
(29)

and

$$\begin{aligned} K\left( R,\omega ^2,L_m\right) =\left[ f_{1}(R)+2f_{2}(R)\omega ^{2}+\frac{9}{2}\omega ^{4}\right] G\left( L_{m}\right) , \end{aligned}$$
(30)

respectively.

2.3.2 Variation with respect to the Weyl vector

By taking the variation of the action (21) with respect to the Weyl vector \(\omega \), we obtain the evolution equation

$$\begin{aligned} \nabla _{\mu }\tilde{F}^{\mu \nu }+2f_2(R)G\left( L_m\right) \omega ^\nu +9G\left( L_m\right) \omega ^2\omega ^\nu =0. \end{aligned}$$
(31)

In Riemann geometry, the Weyl field strength tensor \(\tilde{F}^{\mu \nu }\), due to its antisymmetry properties, automatically satisfies the equations

$$\begin{aligned} \nabla _{\sigma }\tilde{F}_{\mu \nu }+\nabla _{\mu }\tilde{F}_{\nu \sigma }+\nabla _{\nu }\tilde{F}_{\sigma \mu }=0. \end{aligned}$$
(32)

By using the mathematical relations \(\tilde{F}^{\mu \nu }=g^{\alpha \mu }g^{\beta \nu }\tilde{F}_{\alpha \beta }=g^{\alpha \mu }g^{\beta \nu }\left( \nabla _{\alpha }\omega _{\beta }-\nabla _{\beta }\omega _{\alpha }\right) =\nabla ^{\mu }\omega ^{\nu }-\nabla ^{\nu }\omega ^{\mu }\), we immediately find

$$\begin{aligned} \nabla _{\mu }\tilde{F}^{\mu \nu }= & {} \nabla _{\mu }\nabla ^{\mu }\omega ^{\nu }-\nabla _{\mu }\nabla ^{\nu }\omega ^{\mu }\nonumber \\= & {} \nabla _{\mu }\nabla ^{\mu }\omega ^{\nu }-R_{\beta }^{\nu }\omega ^{\beta }-\nabla ^{\nu }\left( \nabla _{\mu }\omega ^{\mu }\right) , \end{aligned}$$
(33)

where the definitions of the Riemann tensor [79],

$$\begin{aligned} \left( \nabla _{\mu }\nabla _{\nu }-\nabla _{\nu }\nabla _{\mu }\right) A^{\alpha }=-A^{\beta }R_{~\beta \nu \mu }^{\alpha }, \end{aligned}$$
(34)

and its contraction,

$$\begin{aligned} \left( \nabla _{\mu }\nabla _{\nu }-\nabla _{\nu }\nabla _{\mu }\right) A^{\mu }=A^{\beta }R_{\beta \nu }, \end{aligned}$$
(35)

where used. Therefore, it follows that the Weyl vector satisfies the generalized wave equation

$$\begin{aligned} \Box \omega ^{\nu }-R_{\beta }^{\nu }\omega ^{\beta }+2f_2(R)G\left( L_m\right) \omega ^\nu +9G\left( L_m\right) \omega ^2\omega ^\nu =0, \end{aligned}$$
(36)

where the gauge condition for \(\omega _{\mu }\), \(\nabla _{\mu }\omega ^{\mu }=0\), has also been used.

2.3.3 Variation with respect to the connection

In the Palatini formalism, the next step in obtaining the field equations requires the variation of the action with respect to the independent connection \(\bar{\Gamma }\). The variation can be done by using the Palatini identity

$$\begin{aligned} \delta \bar{R}_{\mu \nu }=\bar{\nabla } _{\lambda }\left( \delta \bar{ \Gamma }_{\mu \nu }^{\lambda }\right) -\bar{\nabla }_{\mu }\left( \delta \bar{\Gamma }_{\nu \lambda }^{\lambda }\right) , \end{aligned}$$
(37)

where \(\bar{\nabla }_{\lambda }\) is the covariant derivative associated with the connection \(\bar{\Gamma }\). In the following, we assume that the Weyl vector \(\omega \), as well as the Weyl field strength \(\tilde{F}_{\mu \nu }\) and the matter Lagrangian \(L_m\), are independent on the connection \(\bar{\Gamma }\).

By taking the variation of the action (21) with respect to the connection \(\bar{\Gamma }\), we obtain

$$\begin{aligned} \frac{\delta S}{\delta \bar{\Gamma }}=\frac{1}{2}\int B^{\mu \nu }\left[ \bar{\nabla } _{\lambda }\left( \delta \bar{\Gamma }_{\mu \nu }^{\lambda }\right) -\bar{\nabla }_{\mu }\left( \delta \bar{\Gamma }_{\nu \lambda }^{\lambda }\right) \right] \sqrt{-g}{\textrm{d}}^{4}x, \end{aligned}$$
(38)

where we have denoted

$$\begin{aligned} B^{\mu \nu }=\left[ \frac{1}{2}f_{1}^{\prime }(R)+f_{2}^{\prime }(R)\omega ^2 \right] G\left( L_m\right) g^{\mu \nu }. \end{aligned}$$
(39)

Integrating by parts, we immediately find

$$\begin{aligned} \frac{\delta S}{\delta \bar{\Gamma }}= & {} \frac{1}{2}\int \bar{\nabla } _{\lambda }\left[ \sqrt{-g}\left( B^{\mu \nu }\delta \bar{\Gamma }_{\mu \nu }^{\lambda }-B^{\lambda \nu }\delta \bar{\Gamma }_{\nu \alpha }^{\alpha }\right) \right] {\textrm{d}}^{4}x \nonumber \\{} & {} +\frac{1}{2}\int \bar{\nabla }_{\mu }\left[ \sqrt{-g}\left( B^{\mu \nu }\delta _{\alpha }^{\lambda }-B^{\lambda \nu }\delta _{\alpha }^{\mu }\right) \right] \delta \bar{\Gamma }_{\lambda \nu }^{\alpha }{\textrm{d}}^{4}x. \end{aligned}$$
(40)

In \(\delta S/\delta \tilde{\Gamma }\), the first term is a total derivative, and thus it can be removed. Hence, the variation of the action (21) with respect to the connection becomes

$$\begin{aligned} \bar{\nabla }_{\mu }\left[ \sqrt{-g}\left( B^{\mu \lambda }\delta _{\alpha }^{\nu }-B^{\lambda \nu }\delta _{\alpha }^{\mu }\right) \right] =0. \end{aligned}$$
(41)

One can further simplify Eq. (41) by taking into account that when \(\alpha =\nu \), \(\bar{\nabla }_\mu (\sqrt{-g}B^{\mu \lambda })=0\). Substituting back to Eq. (41), one obtains

$$\begin{aligned} \bar{\nabla }_{\alpha }\left\{ \sqrt{-g}\left[ f_{1}^{\prime }(R)+2f_{2}^{\prime }(R)\omega ^2 \right] G\left( L_m\right) g^{\mu \nu }\right\} =0, \end{aligned}$$
(42)

or equivalently,

$$\begin{aligned} \bar{\nabla }_{\alpha }\left\{ \sqrt{-g}F\left( R, \omega ^2,L_m\right) g^{\mu \nu }\right\} =0, \end{aligned}$$
(43)

where F is defined in Eq. (29).

Equation (42) shows that the connection \(\bar{\Gamma }\) is compatible with a conformal metric. We now introduce a new metric \(h_{\mu \nu }\), conformal to \(g_{\mu \nu }\), and defined according to

$$\begin{aligned} h_{\mu \nu }\equiv & {} \left[ f_{1}^{\prime }(R)+2f_{2}^{\prime }(R)\omega ^2 \right] G\left( L_m\right) g_{\mu \nu }\nonumber \\\equiv & {} F\left( R, \omega ^2,L_m\right) g_{\mu \nu }. \end{aligned}$$
(44)

Hence, we obtain

$$\begin{aligned} \sqrt{-h}h^{\mu \nu }= & {} \sqrt{-g}\left[ f_{1}^{\prime }(R)+2f_{2}^{\prime }(R)\omega ^2 \right] G\left( L_m\right) g^{\mu \nu }\nonumber \\= & {} \sqrt{-g}F\left( R, \omega ^2,L_m\right) g^{\mu \nu }, \end{aligned}$$
(45)

where h is the determinant of the metric \(h_{\mu \nu }\). Thus, Eq. (42) becomes the definition of the Levi-Civita connection \(\bar{\Gamma } \) of \(h_{\mu \nu }\), giving

$$\begin{aligned} \bar{\Gamma }_{\mu \nu }^{\lambda }=\frac{1}{2}h^{\lambda \rho }\left( \partial _{\nu }h_{\mu \rho }+\partial _{\mu }h_{\nu \rho }-\partial _{\rho }h_{\mu \nu }\right) . \end{aligned}$$
(46)

By taking into account the explicit form of \(h_{\mu \nu }\) we obtain

$$\begin{aligned} \bar{\Gamma }_{\mu \nu }^{\lambda }=\frac{1}{2}\frac{g^{\lambda \rho }}{F} \left[ \partial _{\nu }\left( Fg_{\mu \rho }\right) +\partial _{\mu }\left( Fg_{\nu \rho }\right) -\partial _{\rho }\left( Fg_{\mu \nu }\right) \right] , \end{aligned}$$
(47)

where we have denoted \(F=F\left( R,\omega ^2,L_m\right) =\left[ f_{1}^{\prime }(R)+2f_{2}^{\prime }(R)\omega ^2\right] G\left( L_m\right) \).

In terms of the Levi-Civita connection \(\Gamma _{\mu \nu }^{\lambda }\) associated to the metric g,

$$\begin{aligned} \Gamma _{\mu \nu }^{\lambda }=\frac{1}{2}g^{\lambda \rho }\left( \partial _{\nu }g_{\mu \rho }+\partial _{\mu }g_{\nu \rho }-\partial _{\rho }g_{\mu \nu }\right) , \end{aligned}$$
(48)

\(\bar{\Gamma }_{\mu \nu }^{\lambda }\) can be expressed as

$$\begin{aligned} \bar{\Gamma }_{\mu \nu }^{\lambda }=\Gamma _{\mu \nu }^{\lambda }+\partial _{\nu }\ln \sqrt{F}\delta _{\mu }^{\lambda }+\partial _{\mu }\ln \sqrt{F} \delta _{\nu }^{\lambda }-g_{\mu \nu }g^{\lambda \rho }\partial _{\rho }\ln \sqrt{F}. \end{aligned}$$
(49)

The tensor \(\bar{R}_{\mu \nu }\), constructed from the metric by using the Levi-Civita connection as defined in Eq. (49), is given in terms of the Ricci tensor \(R_{\mu \nu }\) by [38, 39]

$$\begin{aligned} \bar{R}_{\mu \nu }= & {} R_{\mu \nu }(g)+\frac{3}{2}\frac{1}{F^{2}}\left( \nabla _{\mu }F\right) \left( \nabla _{\nu }F\right) \nonumber \\{} & {} -\frac{1}{F}\left( \nabla _{\mu }\nabla _{\nu }+\frac{1}{2}g_{\mu \nu } \Box \right) F . \end{aligned}$$
(50)

The Ricci scalar and the Einstein tensor can be immediately obtained as

$$\begin{aligned} \bar{R}=R\left( g\right) -3\frac{1}{F}\square F+\frac{3}{2}\frac{1}{F^{2}} \left( \nabla _{\mu }F\right) \left( \nabla ^{\mu }F\right) , \end{aligned}$$
(51)

and

$$\begin{aligned} \bar{G}_{\mu \nu }= & {} \bar{R}_{\mu \nu }-\frac{1}{2}g_{\mu \nu }\tilde{R} =G_{\mu \nu }(g)+\frac{3}{2}\frac{1}{F^{2}}\left( \nabla _{\mu }F\right) \left( \nabla _{\nu }F\right) \nonumber \\{} & {} -\frac{1}{F}\left( \nabla _{\mu }\nabla _{\nu }-g_{\mu \nu }\square \right) F -\frac{3}{4}\frac{1}{F^{2}}g_{\mu \nu }\left( \nabla _{\lambda }F\right) \left( \nabla ^{\lambda }F\right) ,\nonumber \\ \end{aligned}$$
(52)

respectively, with all covariant derivatives taken with respect to the metric \(g_{\mu \nu }\).

2.3.4 Gravitational field equations in the Palatini formalism

By using the expression of the Ricci tensor given by Eq. (51), the gravitational field equation Eq. (28) can be written as

$$\begin{aligned}{} & {} \bar{G}_{\mu \nu }+\frac{1}{2}\left[ R-3\frac{1}{F}\square F+\frac{3}{2} \frac{1}{F^{2}}\left( \nabla _{\mu }F\right) \left( \nabla ^{\mu }F\right) \right] g_{\mu \nu } \nonumber \\{} & {} \quad +\frac{G\left( L_{m}\right) }{F}\Big (2f_{2}(R)+9\omega ^{2}\Big )\omega _{\mu }\omega _{\nu }\nonumber \\{} & {} \quad -\frac{K}{2F}\left[ \left( 1-\frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }L_{m}\right) g_{\mu \nu }+ T_{\mu \nu }\right] -\frac{1}{F}\tilde{T}_{\mu \nu }^{(\omega )}=0.\nonumber \\ \end{aligned}$$
(53)

By substituting the expression of the Einstein tensor as given by Eq. (52) into the field equation Eq. (53), we obtain the gravitational field equation of the Weyl geometric gravity theory in the presence of a nonminimal coupling between matter and geometry in the Palatini formalism as

$$\begin{aligned}{} & {} G_{\mu \nu }+\frac{3}{2}\frac{1}{F^{2}}\left( \nabla _{\mu }F\right) \left( \nabla _{\nu }F\right) -\frac{1}{F}\left( \nabla _{\mu }\nabla _{\nu }\right) F-\frac{1}{2F}g_{\mu \nu }\square F\nonumber \\{} & {} \quad +\frac{1}{2}Rg_{\mu \nu }+\frac{G\left( L_{m}\right) }{F}\Big [2f_{2}(R)+9\omega ^{2}\Big ]\omega _{\mu }\omega _{\nu }\nonumber \\{} & {} \quad -\frac{K}{2F}\left[ \left( 1-\frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }L_{m}\right) g_{\mu \nu }+ \frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }T_{\mu \nu }\right] \nonumber \\{} & {} \quad -\frac{1}{F}\tilde{T}_{\mu \nu }^{(\omega )}=0. \end{aligned}$$
(54)

Taking the trace of the metric field equation Eq. (28), we obtain

$$\begin{aligned}{} & {} \bar{R}+\frac{G\left( L_{m}\right) }{F}\Big (2f_{2}(R)+9\omega ^{2}\Big )\omega ^2\nonumber \\{} & {} \quad -\frac{K}{2F}\left[ 4 \left( 1-\frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }L_{m}\right) + \frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }T\right] =0, \end{aligned}$$
(55)

where the trace \(T_{\mu }^{(\omega )\;\mu }\) of the energy–momentum tensor of the Weyl field identically vanishes, \(T_{\mu }^{(\omega )\;\mu }=0\).

By using Eq. (51), we find the equation determining R as a function of \(\omega \) as

$$\begin{aligned}&R\left( g\right) -3\frac{1}{F}\square F+\frac{3}{2}\frac{1}{F^{2}} \left( \nabla _{\mu }F\right) \left( \nabla ^{\mu }F\right) \nonumber \\&\quad +\frac{G\left( L_{m}\right) }{F}\Big (2f_{2}(R)+9\omega ^{2}\Big )\omega ^2\nonumber \\&\quad -\frac{K}{2F}\left[ 4 \left( 1-\frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }L_{m}\right) + \frac{G^{\prime }\left( L_{m}\right) }{G\left( L_{m}\right) }T\right] =0. \end{aligned}$$
(56)

Also, the covariant divergence of the energy–momentum tensor becomes

$$\begin{aligned}&\nabla ^\alpha T_{\alpha \nu }\nonumber \\ {}&\quad =\frac{4G^2}{G^\prime K}\left( f_2+\frac{9}{2}\omega ^2\right) \left( \omega ^\alpha \nabla _\nu \omega _\alpha +\omega _\nu \nabla _\alpha \omega ^\alpha \right. \nonumber \\ {}&\qquad \left. -\omega _\nu \nabla ^\alpha \ln F+\omega ^\alpha \omega _\nu \frac{\nabla _\alpha L_m}{G}\right) \nonumber \\&\qquad +(T_{\alpha \nu }-g_{\alpha \nu }L_m)\nabla ^\alpha \ln \left( \frac{FG}{G^\prime K}\right) \nonumber \\&\qquad -\frac{2G}{G^\prime K}\left[ (FR_{\alpha \nu }-T_{\alpha \nu })-\frac{1}{2}g_{\mu \nu }\right. \nonumber \\ {}&\qquad \left. \times \left( K+\frac{4F\Box F-6\nabla ^\alpha F\nabla _\alpha F}{F}\right) \right] \nabla ^\alpha \ln F\nonumber \\&\qquad +\frac{4G^2\omega ^\alpha \omega _\nu }{G^\prime K}\nabla _\alpha f_2+\nabla _\nu L_m\nonumber \\&\qquad +\frac{G}{FG^\prime K}(5\nabla ^\alpha F\nabla _\nu \nabla _\alpha F-3F\nabla _\nu \Box F\nonumber \\ {}&\qquad +F^2\nabla _\nu R-F\nabla _\nu K)\nonumber \\&\qquad +\frac{36G^2\omega ^\alpha \omega ^\mu }{G^\prime K}(\omega _\nu \nabla _\mu \omega _\alpha +\omega _\alpha F_{\mu \nu }). \end{aligned}$$
(57)

As one can see from Eq. (57), the covariant divergence of the matter energy–momentum tensor is not conserved in the Weyl geometric formulation of \(f\left( R,L_m\right) \) theory. This result is similar to the one obtained in the metric case [78], and it is essentially a direct consequence of the presence of the geometry-matter coupling. From a physical point of view, this result can be interpreted as describing irreversible particle production, and an energy transfer from gravity (geometry) to matter [73]. This creation process may play an important role in cosmology and may also provide a mechanism to explain the late acceleration of the universe [77].

3 Palatini formulation of quadratic Weyl gravity with matter-curvature coupling

The general formalism developed in the previous sections can be immediately applied to the case of conformally invariant actions. In the particular case of the simplest conformally invariant Weyl action (20), with

$$\begin{aligned} f_1(R)= & {} \frac{1}{12\xi ^2}R^2\left( g,\bar{\Gamma }\right) , \end{aligned}$$
(58)
$$\begin{aligned} f_2(R)= & {} -\frac{1}{8\xi ^2}R\left( g,\bar{\Gamma }\right) , \end{aligned}$$
(59)

and

$$\begin{aligned} G\left( L_m\right) =1-\frac{\xi ^2}{\gamma ^2}L_m, \end{aligned}$$
(60)

respectively. Then we obtain immediately

$$\begin{aligned} F\left( R,\omega ^2,L_m\right) =\frac{1}{2\xi ^2}\left( \frac{R}{3}-\frac{\omega ^2}{2}\right) \left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) , \end{aligned}$$
(61)

and

$$\begin{aligned} K\left( R,\omega ^2,L_m\right)= & {} \left( \frac{1}{12\xi ^2}R^2-\frac{1}{4\xi ^2}R\omega ^2+\frac{9}{2}\omega ^4\right) \nonumber \\{} & {} \times \left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) , \end{aligned}$$
(62)

respectively. The conformally related metric \(h_{\mu \nu }\) is given by

$$\begin{aligned} h_{\mu \nu }=\frac{1}{2\xi ^2}\left( \frac{R}{3}-\frac{\omega ^2}{2}\right) \left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) g_{\mu \nu }. \end{aligned}$$
(63)

3.1 Palatini formulation of quadratic Weyl gravity in vacuum

If we neglect the effect of the matter by taking \(L_m=0\), then \(G\left( L_m\right) =1\), and

$$\begin{aligned} F\left( R,\omega ^2\right) =\frac{1}{6\xi ^2}\left( R-\frac{3}{2}\omega ^2\right) , \end{aligned}$$
(64)

and

$$\begin{aligned} K\left( R,\omega ^2\right) =\frac{1}{4\xi ^2}\left( \frac{R^2}{3}-R\omega ^2\right) +\frac{9}{2}\omega ^4, \end{aligned}$$
(65)

respectively. The metric field equations of the Palatini formalism of the quadratic Weyl geometric gravity take the form

$$\begin{aligned}{} & {} \left( R-\frac{3}{2}\omega ^2\right) \bar{R}_{\mu \nu }-\frac{3}{2}(R-36\omega ^2)\omega _{\mu }\omega _{\nu }\nonumber \\{} & {} \quad -\frac{1}{4}\left( R^2-3\omega ^2R+54\omega ^4\right) g_{\mu \nu }-6\xi ^2 \tilde{T}_{\mu \nu }^{(\omega )}=0. \end{aligned}$$
(66)

The metric \(h_{\mu \nu }\) conformal to \(g_{\mu \nu }\) is obtained as

$$\begin{aligned} h_{\mu \nu }=\frac{1}{6\xi ^2}\left( R-\frac{3}{2}\omega ^2\right) g_{\mu \nu }, \end{aligned}$$
(67)

and it depends on the Ricci scalar as well as the Weyl vector. The Palatini field equation (54) can be written down straightforwardly, as well as the scalar equation (66) relating R and \(\omega \), and they are given by

$$\begin{aligned}{} & {} G_{\mu \nu }+\frac{3}{2}\frac{1}{F^{2}}\left( \nabla _{\mu }F\right) \left( \nabla _{\nu }F\right) -\frac{1}{F}\left( \nabla _{\mu }\nabla _{\nu }\right) F-\frac{1}{2F}g_{\mu \nu }\square F \nonumber \nonumber \\{} & {} \quad +\frac{1}{2}Rg_{\mu \nu }+\frac{1}{F}\Big [9\omega ^{2}-\frac{1}{4\xi ^{2}}R \Big ]\omega _{\mu }\omega _{\nu } -\frac{K}{2F}g_{\mu \nu }\nonumber \\ {}{} & {} \quad -\frac{1}{F}\tilde{T}_{\mu \nu }^{(\omega )}=0, \end{aligned}$$
(68)

and

$$\begin{aligned}{} & {} R-3\frac{1}{F}\square F+\frac{3}{2}\frac{1}{F^{2}}\left( \nabla _{\mu }F\right) \left( \nabla ^{\mu }F\right) +\frac{1}{F}\Big (9\omega ^{2}\nonumber \\{} & {} \quad -\frac{1}{4\xi ^{2}}R\Big )\omega ^{2}-\frac{2K}{F}=0, \end{aligned}$$
(69)

respectively.

3.2 Palatini formulation of the linear/scalar representation of Weyl geometric gravity

An alternative and equivalent description of the dynamical properties of gravitational theories based on the action (18) was considered in [32] (see also references therein), and it is based on the introduction of an auxiliary scalar field \(\phi _{0}\), according to the definition

$$\begin{aligned} \tilde{R}^{2}+2\phi _{0}^{2}\tilde{R}+\phi _{0}^{4}=0. \end{aligned}$$
(70)

After substituting \(\tilde{R}^{2}\rightarrow -2\phi _{0}^{2}\tilde{R}-\phi _{0}^{4}\) into the action 18 and performing its variation with respect to \(\phi _{0}\), we obtain the equation

$$\begin{aligned} \phi _{0}\left( \tilde{R}+\phi _{0}^{2}\right) =0, \end{aligned}$$
(71)

which gives for \(\phi _{0}^{2}\) the expression

$$\begin{aligned} \phi _{0}^{2}=-\tilde{R}. \end{aligned}$$
(72)

Therefore, through this substitution, we re-obtain the original form of the Lagrangian as introduced in the initial Weyl geometry. By substituting Eq. (70) into the action (18), using Eq. (14) we obtain

$$\begin{aligned} S_R\left( g,\bar{\Gamma }\right)= & {} -\int \Bigg \{\frac{1}{2\xi ^{2}} \Bigg [\frac{\phi _{0}^{2}}{6}R\left( g,\bar{\Gamma }\right) -\frac{1}{2} \phi _{0}^{2}\nabla _{\mu }\omega ^{\mu }\nonumber \\{} & {} -\frac{1}{4}\phi _{0}^{2}\omega _{\mu }\omega ^{\mu }+\frac{\phi _{0}^{4}}{12}\Bigg ]+\frac{1}{4}\,\tilde{F}_{\mu \nu }^{2}\Bigg \}\sqrt{-g} {\textrm{d}}^{4}x. \end{aligned}$$
(73)

The action (73) is a particular case of the general action (21), corresponding to \(f_1(R)=0\) and \(f_2(R)=R\), respectively. Hence, all the previous results obtained for the Palatini version of the field equations derived for (21) can now be applied to the linear/scalar version of quadratic Weyl gravity by taking into account the particular forms of the functions \(f_1\) and \(f_2\). The Palatini formulation of the theory for this case was investigated extensively in [30, 60], where it was shown that the basic results obtained in the metric case also remain valid in the Palatini formulation of the theory. Moreover, in the presence of the non-minimally coupled scalar field (Higgs-like) with Palatini connection, the theory gives successful inflation, and a specific prediction for the tensor-to-scalar ratio \(0.007 \le r \le 0.01\) for the current spectral index \(n_s\) (at 95% CL) and \(N =60\) e-folds. The obtained value of r is slightly larger than the value corresponding to inflation in Weyl quadratic gravity of similar symmetry, due to the presence of different forms of the non-metricity. Hence, one can establish a relation between non-metricity and inflationary predictions that enables the testing of the theory by using future CMB observations.

4 Cosmological applications

We will now investigate the cosmological applications of the Palatini formulation of the conformally invariant \(f\left( R,L_m\right) \) theory. In the following we consider a homogeneous and isotropic universe, described by a flat FLRW spacetime, with a line element given by

$$\begin{aligned} {\textrm{d}}s^2=-{\textrm{d}}t^2+a(t)^2({\textrm{d}}x^2+{\textrm{d}}y^2+{\textrm{d}}z^2), \end{aligned}$$
(74)

where a(t) is the scalar factor. Moreover, at this time we introduce the Hubble function, defined according to \(H=\dot{a}/a\). We assume that the matter content of the universe can be described as a perfect fluid, with Lagrangian \(L_m=-\rho \), where \(\rho \) is the matter energy-density, with the corresponding energy–momentum tensor, defined in a comoving frame given by

$$\begin{aligned} T^\mu _{\nu }={\textrm{diag}}(-\rho ,p,p,p). \end{aligned}$$
(75)

We also assume that the Weyl vector in the FLRW universe has only a temporal component \(A_0\), and therefore it is given by

$$\begin{aligned} A_\mu =(A_0,0,0,0). \end{aligned}$$
(76)

This choice is suitable for cosmological applications, since it maintains the isotropy and homogeneity of the spacetime. The Friedmann and Raychaudhuri equations of the Palatini formulation of the Weyl geometric \(f\left( R,L_m\right) \) gravity theory can be obtained straightforwardly from Eq. (68), and they are given by

$$\begin{aligned} 3H^2&=\frac{1}{2}A_0^2(9A_0^2-2f_2)\frac{G}{F}+\frac{1}{2}\frac{K}{F}\nonumber \\&\quad -3H\frac{\dot{F}}{F}-\frac{3}{4}\left( \frac{\dot{F}}{F}\right) ^2 +\frac{3}{4}\frac{K}{F}\frac{G^\prime }{G}(\rho +p), \end{aligned}$$
(77)

and

$$\begin{aligned} \dot{H}&=-\frac{1}{2}A_0^2(9A_0^2-2f_2)\frac{G}{F}+\frac{1}{2}H\frac{\dot{F}}{F}\nonumber \\&\quad +\frac{3}{4}\left( \frac{\dot{F}}{F}\right) ^2-\frac{1}{2}\frac{\ddot{F}}{F} -\frac{1}{4}\frac{K}{F}\frac{G^\prime }{G}(\rho +p), \end{aligned}$$
(78)

respectively. Also, the equation of motion of the Weyl vector can be written as

$$\begin{aligned} \ddot{A}_0+3\dot{H}A_0+3H\dot{A}_0+G(9A_0^2-2f_2)=0. \end{aligned}$$
(79)

In the following, instead of the time variable t, we use the redshift coordinate z, defined as

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

and define the dimensionless Hubble function according to

$$\begin{aligned} h=\frac{H}{H_0}, \end{aligned}$$
(81)

where \(H_0\) is the current value of the Hubble parameter \(H=\dot{a}/a\).

To describe the decelerating/accelerating nature of the cosmological evolution, we use the deceleration parameter q, defined in the redshift space as

$$\begin{aligned} q=-1+\frac{(1+z)}{h(z)}\frac{{\textrm{d}} h(z)}{{\textrm{d}}z}. \end{aligned}$$
(82)

4.1 Simple cosmological toy models

We will consider first some simple solutions of the cosmological system of evolution equations Eqs. (77)–(79).

Fig. 1
figure 1

The Hubble function h(z) and the deceleration parameters q(z) of the model (83), corresponding to the best-fit values of \(\epsilon \) (dashed), \(\epsilon =3.2\) (dot-dashed), and \(\epsilon =4.6\) (dotted). The solid line corresponds to the \(\Lambda \)CDM model, and the error bars indicate the observational data with their errors

As a first example, we adopt for the functions \(f_1\), \(f_2\) and G the following simple forms

$$\begin{aligned} f_1=\alpha ,\quad f_2=\beta R,\quad G=\gamma , \end{aligned}$$
(83)

where \(\alpha \), \(\beta \) and \(\gamma \) are constants.

4.1.1 de Sitter solution

The cosmological model described by the functions (83) has an exact solution, corresponding to constant Weyl vector, given by

$$\begin{aligned} A_0=\sqrt{\frac{2}{3}}\alpha ^{\frac{1}{4}},\quad H_0=\frac{1}{2\sqrt{\beta }}\alpha ^{\frac{1}{4}}. \end{aligned}$$
(84)

As one can see from the above solution, \(\alpha \) and \(\beta \) should be constant, but \(\gamma \) remains arbitrary.

4.1.2 Models with constant \(A_0\)

By assuming that the temporal component of the Weyl vector is a constant, the model (83) has a nontrivial solution, corresponding to

$$\begin{aligned} A_0=\sqrt{\frac{2}{3}}\alpha ^{\frac{1}{4}},\quad \gamma =-\frac{3}{4\beta }, \end{aligned}$$
(85)

and with the dimensionless Hubble function given by

$$\begin{aligned} h(z)=\sqrt{\frac{1}{6}\left[ (6-\epsilon )(1+z)^3+\epsilon \right] }, \end{aligned}$$
(86)

where we have denoted

$$\begin{aligned} \epsilon =\frac{3\sqrt{\alpha }}{3\beta H_0^2}. \end{aligned}$$
(87)

In order to find the best-fit value of the parameter \(\epsilon \), we use the likelihood analysis using the observational data on the Hubble parameter in the redshift range \(z\in (0,2)\). In the case of independent data points, the likelihood function can be defined as

$$\begin{aligned} L=L_0e^{-\chi ^2/2}, \end{aligned}$$
(88)

where \(L_0\) is the normalization constant, and the quantity \(\chi ^2\) is defined as

$$\begin{aligned} \chi ^2=\sum _i\left( \frac{O_i-T_i}{\sigma _i}\right) ^2. \end{aligned}$$
(89)

Here, i is the number of data points, \(O_i\) is the observational value, \(T_i\) represents the theoretical values, and \(\sigma _i\) represents the errors associated with the ith data point obtained from observations. By maximizing the likelihood function, the best-fit values of the parameters \(\epsilon \) and \(H_0\) at \(1\sigma \) confidence level can be obtained as

$$\begin{aligned} \epsilon&=3.883^{+0.345}_{-0.417},\nonumber \\ H_0&=67.05^{+2.945}_{-3.021}. \end{aligned}$$
(90)

The redshift evolution of the Hubble function and of the deceleration parameter q for this model are represented in Fig. 1. As one can see from the figure, despite its simplicity, the present model can give an acceptable description of the observational data, and at low redshifts it also reproduces the predictions of the standard \(\Lambda \)CDM model for the behavior of the Hubble function. However, some differences do appear in the evolution of the deceleration parameter which, once the quality of the observational data improves, may be able to provide further cosmological tests of the Palatini formulation of the \(f\left( R,L_m\right) \) theory. In Fig. 2 we have shown the corner plot corresponding to the above estimation of \(\epsilon \) and \(H_0\) which shows the best-fit values of the model parameter together with their \(1\sigma \) and \(2\sigma \) confidence intervals.

Fig. 2
figure 2

The corner plot for the toy model (83)

4.2 Conformally invariant models

Let us now consider a quadratic conformally invariant Weyl geometric cosmological model, obtained by assuming for the functions \(f_1\), \(f_2\), and G the forms

$$\begin{aligned} f_1=\alpha R^2,\quad f_2=\beta ,\quad G=1-\gamma L_m. \end{aligned}$$
(91)
Table 1 The best-fit values of the parameters \(\alpha \), \(\bar{\beta }\), and \(H_0\) for the conformally invariant quadratic Weyl geometric model (91)
Fig. 3
figure 3

The Hubble function h(z) and the deceleration parameter q(z) for the conformally invariant quadratic Weyl cosmological model (91), for lower \(2\sigma \) limit (dashed), best fit (dot-dashed), and upper \(2\sigma \) limit (dotted) of the parameters \(\alpha \) and \(\bar{\beta }\) as given in Table 1. The solid line corresponds to the \(\Lambda \)CDM model, and the error bars are the observational data with their errors

For the sake of simplicity, we will assume that the matter Lagrangian has the form \(L_m=p\). For a dust-dominated universe, the Raychaudhuri and the Weyl vector field equations can be simplified to

$$\begin{aligned} 8\beta A_0^2-9A_0^4+48\alpha \left[ 3\dot{H}(6H^2+\dot{H}+9H\ddot{H}+\dddot{H})\right] =0, \end{aligned}$$
(92)

and

$$\begin{aligned} \ddot{A}_0+3(H\dot{A}_0+A_0\dot{H})+9A_0^3-2\beta A_0=0, \end{aligned}$$
(93)

respectively. The Friedmann equation is algebraic with respect to the energy density, and it can be used to obtain \(\rho \) in terms of the Hubble function H, and \(A_0\). Now, let us define the set of dimensionless variables

$$\begin{aligned} t&=H_0\tau ,\quad H=H_0 h,\quad A_0=H_0\bar{A}_0\nonumber \\ \bar{\rho }_m&=\frac{\rho _m}{6\kappa ^2H_0^2},\quad \bar{\gamma }=6\kappa ^2H_0^2\gamma ,\quad \bar{\beta }=\frac{\beta }{H_0^2}, \end{aligned}$$
(94)

where \(H_0\) is the current value of the Hubble parameter, and \(\kappa ^2=1/16\pi G\). Transforming to the redshift coordinate z, one can solve numerically the Eqs. (96) and (97) to obtain the evolution of h and \(\bar{A}_0\).

To find the best-fit value of the parameter \(\epsilon \), we employ likelihood analysis using the observational data on the Hubble parameter in the redshift \(z\in (0,2)\) [81]. The best-fit values of the model parameters \(\alpha \) and \(\bar{\beta }\) and of the Hubble parameter \(H_0\) are summarized in Table 1.

Fig. 4
figure 4

The redshift evolution of the dust density abundance \(\Omega _m(z)\) and of the Weyl vector \(A_0(z)\) for the conformally invariant quadratic Weyl cosmological model (91), for lower \(2\sigma \) limit (dashed), best fit (dot-dashed), and upper \(2\sigma \) limit (dotted) of the parameters \(\alpha \) and \(\bar{\beta }\) in Table 1. The solid line corresponds to the \(\Lambda \)CDM theory

In Figs. 3 and 4 we have plotted the evolution of the Hubble function h and of the deceleration parameter q, together with the dust abundance \(\Omega _m=\bar{\rho }/h^2\) and the re-scaled temporal component of the Weyl vector \(\bar{A}_0/h^2\), as functions of the redshift coordinate z.

We have assumed the lower \(2\sigma \) limit (dashed), best fit (dot-dashed), and upper \(2\sigma \) limit (dotted) of the parameters \(\alpha \) and \(\bar{\beta }\) as given in Table 1. Also, the initial conditions we have chosen are \(h^\prime (0)=0.45\), \(h^{\prime \prime }(0)=0.75\), \(\bar{A}_0(0)=0.3\), and \(\bar{A}_0^\prime (0)=0.2\), respectively. It should be noted that the value of the parameter \(\bar{\gamma }\) is chosen in such a way that the current value of the dust density abundance becomes equal to its \(\Lambda CDM\) value \(\Omega _{m0}=0.305\).

As one can see from Fig. 3, the conformally invariant geometric Weyl model can give an acceptable description of the observational data, and it reproduces the predictions of the \(\Lambda \)CDM model at low redshifts. However, very important differences do appear in the matter behavior, on both a quantitative and qualitative level, which may indicate the presence of very serious discrepancies between the present model and \(\Lambda \)CDM. The temporal component of the Weyl vector is a monotonically decreasing function of the redshift, and its evolution does not depend significantly on the variation in the numerical values of the model parameters.

4.3 Cosmology of the conformally invariant quadratic Weyl geometric model

We now consider the general conformally invariant Weyl geometric cosmological model, with for which the functions \(f_1\), \(f_2\) and \(f_3\) are given by

$$\begin{aligned} f_1=\frac{1}{12\xi ^2}R^2, f_2=-\frac{1}{8\xi ^2}R, G=1-\frac{\xi ^2}{\gamma ^2}L_m. \end{aligned}$$
(95)

In the following, we will assume that the matter Lagrangian has the form \(L_m=p\). For a dust-dominated universe, one can obtain the Raychaudhuri and Weyl equations as

$$\begin{aligned} 4\dddot{H}&+36H\ddot{H}+8\dot{H}(3H^2+\dot{H})+4\dot{H}^2+48H^2\dot{H}\nonumber \\&-4A_0^2\dot{H}+10HA_0\dot{A}_0-6H^2A_0^2\nonumber \\&+2A_0\ddot{A}_0+2\dot{A}_0^2-9\xi ^2A_0^4=0, \end{aligned}$$
(96)

and

$$\begin{aligned} \ddot{A}_0+3(H\dot{A}_0+A_0\dot{H})+\frac{3}{2\xi ^2}(2\dot{H}+H^2)A_0+9A_0^3=0, \end{aligned}$$
(97)

respectively. Similarly to the previous case, the Friedmann equation is algebraic with respect to the matter-energy density, and it can be used to obtain \(\rho \) in terms of the Hubble function, and \(A_0\). Now, let us define the set of dimensionless variables,

$$\begin{aligned}&t=H_0\tau ,\quad H=H_0 h,\quad A_0=H_0\bar{A}_0\nonumber \\&\bar{\rho }_m=\frac{\rho _m}{6\kappa ^2H_0^2},\quad \bar{\gamma }=\frac{\gamma }{3H_0\kappa \xi ^2}, \end{aligned}$$
(98)

where \(H_0\) is the current value of the Hubble parameter and \(\kappa ^2=1/16\pi G\). As we have already pointed out in the previous section, the coupling constant \(\xi \) is dimensionless. Transforming to the redshift coordinate z, one can solve numerically the system of Eqs. (96) and (97), respectively, to obtain the evolution of h and \(\bar{A}_0\).

To find the best-fit value of the parameter \(\epsilon \), we use again the likelihood analysis, using the observational data on the Hubble parameter in the redshift range \(z\in (0,2)\) [81]. The best-fit values of the model parameter \(\xi \) and the Hubble parameter \(H_0\) are summarized in Table 2.

Table 2 The best-fit values of the parameter \(\xi \) and of the present day value of the Hubble function \(H_0\) for the general conformally invariant quadratic Weyl model (95)
Fig. 5
figure 5

The Hubble function h(z) and the deceleration parameter q(z) for the general quadratic conformally invariant Weyl geometric model (95), for lower \(2\sigma \) limit (dashed), best fit (dot-dashed), and upper \(2\sigma \) limit (dotted) of the parameter \(\xi \) in the Table 2. The solid line corresponds to the \(\Lambda \)CDM model, and the error bars are the observational data with their errors

In Figs. 5 and 6 we have plotted the evolution of the Hubble function h(z) and of the deceleration parameter q(z), together with the dust abundance \(\Omega _m=\bar{\rho }/h^2\), and the re-scaled temporal component of the Weyl vector \(\bar{A}_0/h^2\), as a function of the redshift coordinate.

Fig. 6
figure 6

The dust density abundance \(\Omega _m(z)\) (left panel) and the re-scaled temporal component of the Weyl vector \(A_0(z)\) (right panel) for the general conformally invariant Weyl geometric case (95), for lower \(2\sigma \) limit (dashed curve), best fit (dot-dashed curve), and upper \(2\sigma \) limit (dotted curve) of the parameter \(\xi \) as given in Table 2. The solid line corresponds to the \(\Lambda \)CDM model

In the Figs. 5 and 6 we have presented the lower \(2\sigma \) limit (dashed curve), the best fit (dot-dashed curve), and the upper \(2\sigma \) limit (dotted curve) of the parameter \(\xi \), as given in Table 2. The initial conditions we have chosen are \(h^\prime (0)=0.47\), \(h^{\prime \prime }(0)=0.71\), \(\bar{A}_0(0)=0.21\) and \(\bar{A}_0^\prime (0)=-0.3\), respectively.

It should be noted that the value of the parameter \(\bar{\gamma }\) is chosen in such a way that the current value of the dust density abundance becomes equal to its \(\Lambda CDM\) value \(\Omega _{m0}=0.305\).

Similarly to the previous cases, the model gives a good description of the behavior of the Hubble function and of the observational data with respect to both observations, and the \(\Lambda \)CDM model. Significant differences do appear at higher redshifts on the order of \(z\approx 3\). The evolution of the matter-density parameter \(\Omega _m\) is significantly different from its behavior in the \(\Lambda \)CDM model, on both quantitative and qualitative levels. The matter density reaches a maximum value at a redshift of \(z\approx 0.9\), and during the different phases of the evolution the matter density can be both a time increasing or a time decreasing function.

Thus, further precise observations of the matter density behavior at higher redshifts may provide a powerful test of the validity of the conformally invariant Weyl type cosmological models with curvature-matter coupling.

5 Discussion and final remarks

In the present paper we have investigated the Palatini version of a generalized \(f\left( R,L_m\right) \) type gravity model, originating in the conformally invariant gravity theory proposed by Weyl more than 100 years ago, based on his generalization of the Riemann geometry. The present theory, constructed ab initio from Weyl geometry, contains a supplementary curvature matter term as compared with the original Weyl theory and most of its extensions. This term can be added in a conformally invariant way to the gravitational action so that the conformal invariance of the theory is not broken.

The requirement of the conformal invariance of the physical laws is a fundamental concept in theoretical physics, as initially suggested by Weyl [3,4,5,6]. A highly attractive idea, conformal invariance is analogous to the gauge principle in the physics of elementary particles, where it played a fundamental role in the advancement of modern physics. There are strong similarities between the global transformations of units and the global gauge transformations. The laws governing the realm of the elementary particle physics are conformally invariant, which is not the case for Einstein’s gravity. This aspect represents another important difference between microphysics and the gravitational interaction. A bridge between elementary particle physics and gravitation can be constructed via the Weyl geometry, which naturally contains the principle of conformal invariance. The simplest fully conformally invariant theory of gravity contains in its action a quadratic term in the Weyl scalar, as well as the contribution coming from the strength of the Weyl field. Once a conformally invariant matter Lagrangian term is added, the resulting theory is fully conformally invariant. However, generally, the matter Lagrangian is not conformally invariant, and to ensure the conformal invariance of the theory in the presence of matter, a coupling of the matter Lagrangian to curvature is also necessary. The metric version of this theory was constructed and investigated in [78], where its cosmological implications were also considered. In the present paper we have extended the Weyl geometric \(f\left( R,L_m\right) \) theory by assuming arbitrary couplings between matter and Weyl geometric terms, couplings that may not guarantee the conformal invariance of the considered models. However, even in the presence of a broken conformal invariance, theoretical gravity models based on Weyl geometry may prove relevant for the interpretation of the present day observations.

To construct a \(f\left( R,L_m\right) \) type Weyl geometric model we begin with the simplest possible conformally invariant action containing the square of the Weyl scalar, the strength of the Weyl vector, and a matter-curvature coupling term. Because of the straightforward relation existing between the geometric terms in Weyl and Riemann geometries, Weyl models can be equivalently reformulated in Riemann geometry. In the case of the quadratic Weyl action, the equivalent gravitational action in the Riemann geometry contains a term proportional to \(R^2\), coupled with matter, a term containing the Ricci scalar, multiplied by \(\omega ^2\), and also coupled with matter, plus some other terms originating in Weyl geometry. In our analysis we have generalized this model by considering arbitrary functional couplings instead of the \(R^2\) and R terms in the action.

To obtain the field equations, we have considered the independent variation of the action with respect to the metric and the independent connection. As a first result of these variations it follows that the independent connection \(\bar{\Gamma }\) is compatible with a conformal metric \(h_{\mu \nu }\), given by \(h_{\mu \nu }=F\left( R,\omega ^2,L_m\right) g_{\mu \nu }\), with the conformal factor F a function of the Ricci scalar, the matter Lagrangian, and the square of the Weyl vector. The metric \(h_{\mu \nu }\) is now assumed to be the physical metric, and the associated Levi-Civita type connection can be represented in Riemann geometry as the sum of the Levi-Civita connection of the metric g plus corrections terms coming from the conformal factor F. Once the form of the connection is known, the geometric quantities and the Einstein field equations can be easily obtained, thus leading to the Palatini formulation of the generalized Weyl geometric gravity in the presence of curvature-matter coupling.

As a possible test of the Palatini formulation of the Weyl geometric type \(f\left( R,L_m\right) \) theories, we have investigated their cosmological implications. The cosmological evolution equation (generalized Friedmann equations) can be obtained in their general We have considered three specific models, based on particular choices of the functions \(f_1\), \(f_2\) and G that determine the mathematical structure of the theory. The first (toy) model corresponds to an action of the form

$$\begin{aligned} S=\int {\left[ \frac{1}{2}\alpha \gamma +\beta \gamma R\omega ^2+\frac{9}{4}\gamma \omega ^4-\frac{1}{4}\tilde{F}_{\mu \nu }^2\right] \sqrt{-g}{\textrm{d}}^4x}, \end{aligned}$$
(99)

in which the matter Lagrangian has been approximated by a constant. The corresponding cosmological model admits a de Sitter solution, corresponding to a constant temporal component of the Weyl vector. A second class of solutions obtained from the action (99) correspond to models with varying Hubble function, having fixed values of \(A_0\) and \(\gamma \). Despite their simplicity, these models can give an acceptable description of the observational data for the Hubble function, and can reproduce rather well the behavior of the Hubble function up to redshifts of \(z\approx 1\).

The second (toy) cosmological model we have considered is derived from the action

$$\begin{aligned} S= & {} \int \Bigg [\frac{1}{2}\alpha \left( 1-\gamma L_m\right) R^2+\beta \omega ^2+\frac{9}{4}\left( 1-\gamma L_m\right) \omega ^4\nonumber \\{} & {} -\frac{1}{4}\tilde{F}_{\mu \nu }^2\Bigg ]\sqrt{-g}{\textrm{d}}^4x, \end{aligned}$$
(100)

with \(\alpha \), \(\beta \) and \(\gamma \) constants. The Palatini version of this model leads to third-order differential equations for the evolution of the Hubble function. However, the model can describe well the low redshift observations, but the differences between the predictions of this model and those of the \(\Lambda \)CDM model increase significantly with the redshift. The behavior of the matter density parameter is very different as compared with the \(\Lambda \)CDM model, suggesting the existence of periods in which the matter density increases and decreases, respectively.

Finally, the third cosmological model we have considered is based on the Palatini variation of the Weyl geometric action

$$\begin{aligned} S= & {} \int \Bigg [\frac{1}{24\xi ^2}\left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) R^2- \frac{1}{8\xi ^2}\left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) \omega ^2R\nonumber \\{} & {} +\frac{9}{4}\left( 1-\frac{\xi ^2}{\gamma ^2}L_m\right) \omega ^4-\frac{1}{4}\tilde{F}^2_{\mu \nu }\Bigg ]\sqrt{-g}{\textrm{d}}^4x, \end{aligned}$$
(101)

with \(\xi \) and \(\gamma \) constants. This model also gives third-order ordinary differential evolution equations for the Hubble function. The fitting with the observational data enables the determination of the model parameters. There is good concordance with observational data for the Hubble function up to a redshift of around \(z\approx 2\). The differences between models increase with increasing redshift. For low redshifts (\(z<0.5\)), the matter density parameter of the model can reproduce the \(\Lambda \)CDM behavior.

The temporal component \(A_0\) of the Weyl vector has similar behavior in all three considered models, since it is a monotonically decreasing function of redshift (a monotonically increasing function of time), indicating that it had much higher values in the early universe. For the third considered model, the Weyl vector takes negative values for redshifts larger than 0.5.

To conclude, the results of our investigations performed in the present work suggest that the Palatini formulation of the Weyl geometric \(f\left( R,L_m\right) \) type theories of gravity may play a relevant role in the description of gravitational processes both at high matter densities, corresponding to the very early universe, and at the low densities, specific to the present-day universe. Other astrophysical and cosmological implications of the Palatini formulation of Weyl geometric type theories will be considered in a future study.