1 Introduction

Our current theoretical understanding in cosmology is essentially based on two crucial pillars: (1) General Relativity (GR) is the underlying gravitational theory; (2) the cosmological principle states that the spatial distribution of matter in the Universe is revealed as homogeneous and isotropic on scales sufficiently large. This paper aims to investigate the robustness of these two pillars, examining also possible deviations.

Presently, the cosmological concordance model is generally referred to as the well-known \(\Lambda \)CDM model [1,2,3,4], which involves a cold dark matter (CDM) component and a cosmological constant \(\Lambda \). This cosmological paradigm is consistent with most of the data, providing a reliable picture of the present-day observed Universe. For instance, maps of the cosmic microwave background radiation (CMB) [5] have corroborated the idea of a homogeneous and isotropic Universe on large scales.Footnote 1 The geometry of a purely homogeneous and isotropic Universe is properly described within the framework of the \(\Lambda \)CDM model through the Friedmann–Lemaître–Robertson–Walker (FLRW) metric [3].

Concerning the first pillar of the \(\Lambda \)CDM model, despite all the remarkable predictions and successes to explain theoretically many observational facts in the Universe, it is believed that GR is not the ultimate theory of gravity. Indeed, some open problems in cosmology, such as the need for dark components such as CDM and dark energy, the exact nature of which is still unknown, the cosmological constant problem [7, 8], and the Hubble constant tension,Footnote 2 may be regarded as a possible signal of the breakdown of GR on galactic and cosmological scales and have motivated people to discuss some modifications of the theory.

Among all the possible proposals of modified gravity with respect to the Einsteinian formulation, the so-called \(f\left( R\right) \) gravity theories [25,26,27,28,29,30,31,32,33] stand for their simple morphology since de facto only an extra scalar degree of freedom is added to the gravitational field dynamics. These theories represent an extension of GR, a particular class of modified gravity, in which the scalar curvature R in the gravitational Lagrangian density is replaced by a function \(f\left( R\right) \), i.e., an extra geometrical degree of freedom with respect to GR. Moreover, scalar–tensor gravity provides an equivalent representation of \(f\left( R\right) \) theories: adopting a formulation in the so-called Jordan frame [26, 28,29,30,31, 33], the additional mode is explicitly translated into a non-minimally coupled scalar field to standard gravity.Footnote 3

The interest in the \(f\left( R\right) \) modified gravity is because extra degrees of freedom may allow us to find alternative explanations for the abovementioned unresolved problems in cosmology. For instance, some successful proposals in the \(f\left( R\right) \) gravity [40,41,42,43] describe the present accelerating Universe, avoiding to introduce ad hoc extra components, such as dark energy. Other examples of \(f\left( R\right) \) models have been developed to try to alleviate or solve the Hubble constant tension [12, 44,45,46,47,48,49,50]. Moreover, the presence of extra degrees of freedom within the \(f\left( R\right) \) metric formalism is also discussed in gravitational-wave physics, regarding the nature of their polarizations [51].

Therefore, an increasing interest has risen in recent years to develop new methods to discriminate between the standard \(\Lambda \)CDM model and modified gravity cosmological scenarios for the present Universe. Extended \(f\left( R\right) \) theories of gravity admit a larger number of solutions than Einstein field equations in GR, but extra degrees of freedom and non-linearity imply non-trivial cosmological dynamics. Some cosmological exact solutions in the \(f\left( R\right) \) gravity have been found for simple scenarios, especially in a homogeneous and isotropic cosmology [29, 52,53,54,55].

Concerning the second pillar of the \(\Lambda \)CDM model, that is the homogeneity and isotropy of the Universe on large scales, it should be emphasized that the cosmological principle is not invariant for any spatial scale: our present Universe seems to reach the conditions to be homogeneous on a scale of about \(100\,\text {Mpc}\), as suggested by galaxy surveys and the large-scale structure of the Universe [56, 57]. Thus, when considering physical phenomena that occur on smaller spatial scales, local features of the Universe lead inevitably to deviations from the FLRW geometry, which could affect cosmological parameters [58,59,60,61,62] and the luminosity distance distribution [63]. See also [64,65,66] for the development of the averaging formalism in cosmology to average scalar quantities in a limited region of space-time.

Furthermore, observational evidence of a local void (an underdense region) have emerged on scales of several hundreds of \(\text {Mpc}\) [67,68,69,70]. In this regard, the Lemaître–Tolman–Bondi (LTB) model [4, 8, 71,72,73] is widely employed to describe spherically symmetric non-stationary inhomogeneities in the local Universe, while it approaches a homogeneous Universe far enough from the center of symmetry. The LTB solution with the presence of a cosmological constant \(\Lambda \) is commonly referred to as the \(\Lambda \)LTB model, which has been studied for many decades as a possible (simplified) framework to consider local deviations of the Universe today from the homogeneity [74,75,76,77,78,79,80] or to alleviate the Hubble constant tension [81,82,83,84,85].

Since \(f\left( R\right) \) theories and the \(\Lambda \)LTB model separately can only alleviate the Hubble constant tension, the combination of more than one non-standard physical effect, i.e., modified gravity and inhomogeneous cosmology, may be needed to accommodate these data inconsistencies into a cosmological model.

However, in this work, we do not focus on the Hubble tension, but we consider a prodromic question, i.e., the formulation of the LTB cosmology in modified gravity. Other papers were carried out to find inhomogeneous LTB solutions in extended gravity scenarios [86,87,88,89,90,91,92]; here we consider the \(f\left( R\right) \) metric formalism to highlight possible peculiarities of local inhomogeneities compared to the GR solutions. Our aim is to search for some specific markers of the matter distribution, which could allow us to distinguish a standard paradigm from an alternative cosmology. Indeed, local inhomogeneities incorporated in a modified gravitational scenario might become a predictive tool.

In this paper, in the spirit of describing small deviations from the homogeneity of the Universe today, we treat the inhomogeneous LTB metric as the flat FLRW background solution with the addition of small spherically symmetric perturbations, following a linear perturbation approach.Footnote 4 We extend the work carried out in [96, 97]. The present analysis aims to discriminate between the \(\Lambda \)LTB cosmological paradigm and the LTB solution as emerging in the Jordan frame of the \(f\left( R\right) \) gravity, comparing the different evolution of inhomogeneous perturbations within these two schemes to describe the local behavior of the actual Universe. In this regard, we evaluate the role of a cosmological constant with respect to the presence of a non-minimally coupled scalar field in the Jordan frame, examining separately the cosmological dynamics. In particular, regarding the background cosmology in the Jordan frame, we adopt the \(f\left( R\right) \) model developed by Hu and Sawicki [40], which provides an interesting alternative to the dark energy component for the current cosmic acceleration within the \(f\left( R\right) \) gravity.

Therefore, we investigate the first-order perturbation field equations for local inhomogeneities both in the \(\Lambda \)LTB and \(f\left( R\right) \) inhomogeneous cosmological models. More specifically, the analysis of the 0-1 component of the gravitational field equations points out discrepancies between the two formalisms considered, due to the presence of the non-minimally coupled scalar field. In our analysis of the first-order perturbation equations, we adopt the separable variables method as a mathematical technique to address the solution of the partial differential equations system. Then, we separately obtain the time evolutions and radial profiles of perturbations within both two cosmological models. Actually, we get an analytic expression only for the radial part, while we need to numerically evaluate the time evolution of perturbations.

The main result of our work is the different radial patterns of inhomogeneous perturbations in GR and the \(f\left( R\right) \) cosmology. Indeed, in the former case, we deal with a radial solution that is basically a power law; in the latter case, a peculiar Yukawa-like dependence emerges in the Jordan frame gravity whatever the \(f\left( R\right) \) model considered. Both these radial solutions suggest that inhomogeneities decay rapidly on large scales according to the cosmological principle, but furthermore, from a theoretical point of view, we have a specific trace of how a modified gravity model can be distinguished from a standard gravity scenario in the presence of a cosmological constant. In other words, the Yukawa-like radial solution is a peculiar feature of the \(f\left( R\right) \) gravity.

Regarding our numerical analysis of the time dependence of the obtained solutions, we show that local inhomogeneities are governed by a dynamics preserving the stability of the isotropic Universe both in the \(\Lambda \)LTB and modified gravity theories. Therefore, these stable-time solutions are physically acceptable and can be thought of as large-scale corrections to the FLRW geometry.

This work provides an interesting arena to investigate different scenarios of the clumpy inhomogeneous cosmology; at the same time, the method developed in this paper supplies a useful criterion to distinguish between GR and \(f\left( R\right) \) modified gravity models on cosmological scales.

This paper is structured as follows: in Sect. 2 we introduce the \(f\left( R\right) \) modified theories of gravity in the Jordan frame and the Hu–Sawicki model; in Sect. 3 and Sect. 4 we implement the cosmological dynamics to the \(\Lambda \)LTB model in GR and the LTB spherically symmetric solution as emerging in the Jordan frame of the \(f\left( R\right) \) gravity, respectively; in Sect. 5 we show our perturbation approach to study local inhomogeneities in the \(\Lambda \)LTB model, obtaining background and first-order perturbation solutions, while in Sect. 6 we proceed similarly for the \(f\left( R\right) \) theories in the Jordan frame; lastly, we summarize our results and conclusions in Sect. 7.

We adopt the metric signature \(\left( -,+,+,+\right) \) throughout the paper, and we use natural units for the speed of light \(c=1\). We denote with \(\chi \equiv 8\,\pi \,G\) the Einstein constant, being G the gravitational Newton constant. The components of the gravitational field equations are sometimes denoted with a pair of indices \(\mu -\nu \), in which the indices \(\mu ,\nu =0,1,2,3\) move along the set of coordinates.

2 \(f\left( R\right) \) modified gravity in the Jordan frame

We investigate the equivalence between \(f\left( R\right) \) theories of gravity and the scalar–tensor representation in the Jordan frame [25,26,27,28,29,30,31,32,33]. There is no a priori motivation to consider a linear gravitational Lagrangian density with respect to the Ricci scalar R, apart from obtaining a second-order partial differential system for the field equations.

The gravitational Lagrangian density, which is given by R in GR in the Einstein–Hilbert action, is generalized in the context of \(f\left( R\right) \) theories as a function f of R, i.e., an extra degree of freedom. In addition, considering a matter term \(S_{M}\), the total action of \(f\left( R\right) \) gravity is given by

$$\begin{aligned} S=\frac{1}{2\,\chi }\,\int d^{4}x\,\sqrt{-g}\,f\left( R\right) +S_{M}\left( g_{\mu \nu },\psi \right) , \end{aligned}$$
(1)

where g is the determinant of the metric tensor with components \(g_{\mu \nu }\), and \(\psi \) refers to the matter fields.

It can be shown that the extended gravitational field equations within the \(f\left( R\right) \) metric formalism are fourth-order partial differential equations in the metric. If \(f\left( R\right) =R\), specifically, the fourth-order terms vanish, and field equations reproduce exactly the Einstein field equations in GR.

To bring field equations to a form that is easier to handle, the \(f\left( R\right) \) gravity can be restated in the scalar–tensor formalism. In particular, in the so-called Jordan frame,Footnote 5 it can be checked that the following action

$$\begin{aligned} S_{J}=\frac{1}{2\,\chi }\,\int _{\Omega }d^{4}x\,\sqrt{-g}\,\left[ \phi \,R-V\left( \phi \right) \right] +S_{M} \end{aligned}$$
(2)

is dynamically equivalent to the \(f\left( R\right) \) action given by Eq. (1) if \(f^{\prime \prime }\left( R\right) \ne 0\), where the scalar field

$$\begin{aligned} \phi \equiv f^{\prime }\left( R\right) \end{aligned}$$
(3)

is governed by the scalar field potential defined as

$$\begin{aligned} V\left( \phi \right) \equiv \phi \,R\left( \phi \right) -f\left[ R\left( \phi \right) \right] . \end{aligned}$$
(4)

It should be noted that the extra degree of freedom given by the \(f\left( R\right) \) function turns into a scalar fieldFootnote 6\(\phi \), which is non-minimally coupled to the metric. Conversely, there is only a minimal coupling for the matter.

Variations of the action (2) with respect to the metric and scalar field lead to field equations in the Jordan frame

$$\begin{aligned} G_{\mu \nu }&= \frac{\chi }{\phi }\,T_{\mu \nu }-\frac{1}{2\,\phi }\,g_{\mu \nu }\,V\left( \phi \right) \nonumber \\&\quad +\frac{1}{\phi }\,\left( \nabla _{\mu }\nabla _{\nu }\phi -g_{\mu \nu }\,\Box \phi \right) \end{aligned}$$
(5a)
$$\begin{aligned} R&= \frac{dV}{d\phi }, \end{aligned}$$
(5b)

respectively, where \(G_{\mu \nu }\) is the Einstein tensor, \(T_{\mu \nu }\) is the stress–energy tensor of matter, \(\nabla _{\mu }\) is the covariant derivative associated with the Levi-Civita connection of the metric, and \(\Box =g^{\rho \sigma }\,\nabla _{\rho }\nabla _{\sigma }\).

Furthermore, by taking the trace of Eq. (5a) and using Eq. (5b), a dynamical equation for the scalar field is obtained

$$\begin{aligned} 3\,\Box \phi +2\,V\left( \phi \right) -\phi \,\frac{dV}{d\phi }=\chi \,T \end{aligned}$$
(6)

for a given matter source, where T is the trace of the matter stress–energy tensor.

Although the presence of a non-minimally coupled scalar field implies non-trivial dynamics in the Jordan frame, it is often convenient to adopt the Jordan frame of the \(f\left( R\right) \) gravity, since the field equations (5a), (5b), and (6) are now second-order differential equations.

Looking at the action given in Eq. (2), the extra degree of freedom provided by \(f\left( R\right) \) does not affect the matter action even in the Jordan frame. Therefore, the stress–energy tensor of ordinary matter must be divergence-free as in GR: \(\nabla _{\nu }T^{\mu \nu }=0\). Since Bianchi identities are kept in modified gravity, the Einstein tensor is also covariant divergence-free: \(\nabla _{\nu }G^{\mu \nu }=0\). Here, we define an effective stress–energy tensor related to the scalar field

$$\begin{aligned} T_{\mu \nu }^{[\phi ]}=-\frac{1}{2\,\phi }\,g_{\mu \nu }\,V\left( \phi \right) + \frac{1}{\phi }\,\left( \nabla _{\mu }\nabla _{\nu }\phi -g_{\mu \nu }\,\Box \phi \right) \end{aligned}$$
(7)

to rewrite the field equations (5a) in the Jordan frame as

$$\begin{aligned} G_{\mu \nu }=\frac{\chi }{\phi }\,T_{\mu \nu }+T_{\mu \nu }^{[\phi ]}. \end{aligned}$$
(8)

Finally, considering the divergence-free relations above, it is trivial to show that

$$\begin{aligned} \nabla _{\nu }T^{[\phi ]\,\mu \nu }=\frac{\chi }{\phi ^{2}}\,T^{\mu \nu }\,\nabla _{\nu }\phi . \end{aligned}$$
(9)

The effective stress–energy tensor \(T_{\mu \nu }^{[\phi ]}\) does not satisfy the usual law of the ordinary matter [102,103,104,105], unless in vacuum \((T_{\mu \nu }=0).\) The extra scalar degree of freedom in the Jordan frame is quite different from a matter field; actually, \(\phi \) is an effective scalar field originating from a scalar mode intrinsically due to a modification in the gravitational action. Note that the laws (9) describing the dynamics of \(T_{\mu \nu }^{\left[ \phi \right] }\), as well as the continuity equation related to \(T_{\mu \nu }\), are not independent of the field Eqs. (5a) and (6). However, Eq. (9) can be employed as auxiliary equations to rewrite field equations in a different equivalent form.

2.1 The Hu–Sawicki model

Among several proposals for the functional form of the \(f\left( R\right) \), one of the most studied dark energy models is provided by Hu and Sawicki [40, 41]. It is useful to refer to the deviation \(F\left( R\right) \) from the gravitational Lagrangian density in GR, i.e.

$$\begin{aligned} f\left( R\right) =R+F\left( R\right) . \end{aligned}$$
(10)

The functional form of the deviation \(F\left( R\right) \) for the Hu–Sawicki (HS) model is

$$\begin{aligned} F\left( R\right) =-m^{2}\,\frac{c_{1}\,\left( {R}/{m^{2}}\right) ^{n}}{c_{2}\,\left( {R}/{m^{2}}\right) ^{n}+1}, \end{aligned}$$
(11)

where n is a positive integer, \(c_{1}\) and \(c_{2}\) are the HS dimensionless parameters, and \(m^{2}\equiv \chi \,\rho _{m0}/3\) with \(\rho _{m0}\) matter density today.

Note that for \(R\gg m^{2}\) the limiting case with an effective cosmological constant \(\Lambda _{\text {eff}}=c_{1}\,m^{2}/2\,c_{2}\) is recovered. Approximating the cosmic accelerated phase of a flat \(\Lambda \)CDM model with an effective cosmological constant, we obtain the first constraint on the parameters \(c_{1}\) and \(c_{2}\):

$$\begin{aligned} \frac{c_{1}}{c_{2}}\approx 6\,\frac{\Omega _{\Lambda 0}}{\Omega _{m0}}, \end{aligned}$$
(12)

in which we have used the definitions of cosmological density parameters \(\Omega _{m0}\equiv \rho _{m0}/\rho _{c0}\) and \(\Omega _{\Lambda 0}\equiv \rho _{\Lambda 0}/\rho _{c0}\) for the matter component and the cosmological constant, respectively, being \(\rho _{c0}\equiv 3H_{0}^{2}/\chi \) the critical energy density of the Universe today, \(\rho _{\Lambda 0}\equiv \Lambda /\chi \) the energy density associated with \(\Lambda \), and \(H_0\) is the Hubble constant. The subscript 0 denotes the present cosmic time \(t_{0}\) at the redshift \(z=0\).

Furthermore, Hu and Sawicki [40] have shown that today \(R_{0}\gg m^{2}\), and also the approximation \(R\gg m^{2}\) is viable for the entire past cosmic expansion.

Hereinafter, we set \(n=1\) for simplicity, focusing on the most extensively studied scenario in the HS gravity. In that case, the derivative \(F_{R}\equiv dF/dR\) for \(R\gg m^{2}\) is approximately

$$\begin{aligned} F_{R}\approx -\frac{c_{1}}{c_{2}^{2}}\,\left( \frac{m^{2}}{R}\right) ^{2}. \end{aligned}$$
(13)

In particular, for a flat \(\Lambda \)CDM model

$$\begin{aligned} \frac{R}{m^{2}}=3\,\left( \frac{1}{a^{3}}+4\,\frac{\Omega _{\Lambda 0}}{\Omega _{m0}}\right) , \end{aligned}$$
(14)

where \(a=a\left( t\right) \) is the scale factor in terms of the cosmic time. We have used the well-known Friedmann equations and the definition of the Ricci scalar R in a flat FLRW metric [3].

We can rewrite Eq. (13) evaluated today in the limiting case for \(R\gg m^{2}\):

$$\begin{aligned} F_{R0}\approx -\frac{c_{1}}{c_{2}^{2}}\,\left[ 3\,\left( 1+4\,\frac{\Omega _{\Lambda 0}}{\Omega _{m0}}\right) \right] ^{-2}, \end{aligned}$$
(15)

in which we have implicitly assumed that the value of \(\Lambda _{\text {eff}}\) to be the same as \(\Lambda \) in the \(\Lambda \)CDM limit. We have also set the conventional notation for the scale factor today \({a}_{0}=1\). Hence, by setting a reference value for \(F_{R0}\), we can obtain the second constraint on \(c_{1}\) and \(c_{2}\). Note that, according to Eqs. (3) and (10), we have in the Jordan frame:

$$\begin{aligned} \phi =1-F_{R}. \end{aligned}$$
(16)

It should be noted that \(F_{R}\) quantifies the deviation from the GR scenario, where \(\phi =1\).

The scalar field potential \(V\left( \phi \right) \) in the Jordan frame for the HS model assumes the following form:

$$\begin{aligned} V\left( \phi \right) =\frac{m^{2}}{c_{2}}\,\left[ c_{1}+1-\phi -2\sqrt{c_{1}\, \left( 1-\phi \right) }\right] , \end{aligned}$$
(17)

where we used the definitions given in Eqs. (3) and (4) referred to the \(F\left( R\right) \) function in Eq. (11). Moreover, we have selected the branch for the potential related to a minus sign just before the square root in Eq. (17) to converge to an asymptotically stable de Sitter Universe [106, 107].

Finally, we show two reasonable values for the HS dimensionless parameters \(c_{1}\) and \(c_{2}\). More precisely, we fix \(\Omega _{m0}=0.3111\), and \(\Omega _{\Lambda 0}=0.6889\) from the Planck measurements [5]; we set the value of the derivative of the field at the present cosmic time \(\left| F_{R0}\right| =1.0\times 10^{-7}\), considering the strongest bound between solar system [40] and cosmological constraints [108,109,110]. Then, using the conditions (12) and (15) for the \(\Lambda \)CDM limit, we obtain \(c_{1}=2.0\times 10^{6}\) and \(c_{2}=1.5\times 10^{5}\). Considering these values for \(c_{1}\) and \(c_{2}\), in Fig. 1 we show the profile of the HS scalar field potential in the Jordan frame, noting a slow evolution of \(V\left( \phi \right) \).

Fig. 1
figure 1

Behavior of the HS scalar field potential in the Jordan frame, defined in Eq. (17). It should be noted that \(V\left( \phi \right) /m^{2}\) is dimensionless

3 The LTB model in General Relativity

The LTB spherical solution [4, 8, 71,72,73] describes the geometry of an inhomogeneous but isotropic Universe, generalizing the FLRW line element [3]. In the LTB model, the space is isotropic only observing the Universe from a specific preferred point, i.e., the center that is singled out by adopting a spherical symmetry, where an observer is supposed to be located. Hereinafter, we consider the evolution of a dust cosmological model resulting in a spherical mass overdensity (or underdensity) with vanishing pressure \((p=0),\) which can be formulated in the LTB formalism. Furthermore, we focus on the late Universe, hence we neglect relativistic species, since they are subdominant today, i.e., \(\Omega _{r0}\sim 10^{-5}\).

The LTB spherically symmetric line element in the synchronous gauge is written as

$$\begin{aligned} ds^{2}=-dt^{2}+e^{2\alpha }dr^{2}+e^{2\beta }\,d\Omega ^{2}, \end{aligned}$$
(18)

in which t is the cosmic time, r is the radial coordinate indicating the spatial distance from the preferred point, and \(d\Omega \) is the solid angle element. Note that there are two metric functions: \(\alpha =\alpha \left( t,\,r\right) \) and \(\beta =\beta \left( t,\,r\right) \).

The three independent Einstein field equations in the \(\Lambda \)LTB model with a pressure-less dust are provided by the 0-1, 0-0, and 1-1 components, which rewrite as

$$\begin{aligned}&\frac{\dot{\beta }^{\prime }}{\beta ^{\prime }}-\dot{\alpha }+\dot{\beta }=0,\end{aligned}$$
(19a)
$$\begin{aligned}&\dot{\beta }^{2}+2\dot{\alpha }\dot{\beta }+e^{-2\beta } -e^{-2\alpha }\left[ 2\beta ^{\prime \prime }+3\beta ^{\prime }{}^{2} -2\alpha ^{\prime }\beta ^{\prime }\right] \nonumber \\&\quad = \chi \rho +\Lambda ,\end{aligned}$$
(19b)
$$\begin{aligned}&2\,\ddot{\beta }+3\,\dot{\beta }^{2}+e^{-2\beta }-\beta ^{\prime } {}^{2}\,e^{-2\alpha }=\Lambda , \end{aligned}$$
(19c)

respectively, where \(\dot{\left( \right) }=d/dt\) and \(\left( \right) {}^{\prime }=d/dr\). We have separated explicitly the cosmological constant and matter term, and \(\rho \) is simply the energy density of the matter component (we neglected the subscript m in \(\rho \) for brevity). The other non-null field equations in the LTB metric are related to the previous equations system due to the spherical symmetry. More precisely, it is straightforward to show the following relations between the Einstein tensor components in the LTB metric:

$$\begin{aligned} G_{\,2}^{2} =G_{\,1}^{1}+\frac{\left( G_{\,1}^{1}\right) ^{\prime }}{2\,\beta ^{\prime }}, \end{aligned}$$
(20)

and also \(G_{\,3}^{3}=G_{\,2}^{2}\).

It should be noted that the two metric functions \(\alpha \) and \(\beta \) can be related in GR, by exploiting the 0-1 component (19a) of the Einstein field equations, in order to rewrite the LTB line element (18) in a simpler form [111]. Indeed, Eq. (19a) admits the solution

$$\begin{aligned} \beta ^{\prime }=g\left( r\right) \,e^{\alpha -\beta }, \end{aligned}$$
(21)

where \(g\left( r\right) \) is an arbitrary function of the radial coordinate r. Then, the LTB line element (18) can be rewritten as

$$\begin{aligned} ds^{2}=-dt^{2}+\frac{\left[ \left( a\,r\right) {}^{\prime }\right] {}^{2}}{1-r^{2}\,K^{2}}dr^{2}+\left( a\,r\right) {}^{2}\,d\Omega ^{2}, \end{aligned}$$
(22)

in which the following parametrization has been adopted

$$\begin{aligned} g\left( r\right) \equiv \left( 1-r^{2}\,K^{2}\right) {}^{1/2} \end{aligned}$$
(23)

with \(K=K\left( r\right) \), and \(a\left( t,r\right) \equiv e^{\beta } r^{-1}\) has been defined as the generalization of the scale factor in an inhomogeneous Universe.

By using the LTB metric, the remaining Einstein field equations (19b) and (19c) become

$$\begin{aligned}&3\,\left[ \dot{a}^{2}\,a\,r^{3}+a\,r^{3}\,K^{2}\right] {}^{\prime }=\left( \chi \,\rho +\Lambda \right) \,\left[ \left( a\,r\right) {}^{3}\right] {}^{\prime },\end{aligned}$$
(24a)
$$\begin{aligned}&\frac{2\,\ddot{a}}{a}+\frac{\dot{a}^{2}}{a^{2}}+\frac{K^{2}}{a^{2}}=\Lambda , \end{aligned}$$
(24b)

respectively.

It may be observed that the form of the LTB metric given by Eq. (22) reminds the FLRW line element. More specifically, if \(a\left( t,r\right) \) and the LTB curvature function \(K\left( r\right) \) do not depend on the radial coordinate r, the FLRW geometry is exactly recovered to describe a homogeneous and isotropic Universe. Furthermore, it is straightforward to show in that limit that Eqs. (24a) and (24b) turn into the Friedmann equations in the FLRW metric.

Finally, the continuity equation for a pressure-less perfect fluid in the LTB metric (18) can be written as

$$\begin{aligned} \dot{\rho }+\left( \dot{\alpha }+2\,\dot{\beta }\right) \,\rho =0, \end{aligned}$$
(25)

or equivalently

$$\begin{aligned} \dot{\rho }+\left( \frac{\dot{a}+r\,\dot{a}^{\prime }}{a+r\,a^{\prime }}+2\,\frac{\dot{a}}{a}\right) \,\rho =0, \end{aligned}$$
(26)

if the LTB metric in the form given by Eq. (22) is considered. We recall that the energy conservation law results from the divergenceless law of the stress–energy tensor \(\nabla _{\mu }T^{\mu \nu }=0\) for \(\nu =0\).

4 The LTB model in the Jordan frame of \(f\left( R\right) \) gravity

We study the cosmological dynamics in the LTB metric (18) within the framework of the \(f\left( R\right) \) gravity in the Jordan frame. The 0-1, 0-0, 1-1 components of the gravitational field equations (5a) are written as

$$\begin{aligned}&\frac{\dot{\beta }^{\prime }}{\beta ^{\prime }}-\dot{\alpha }+\dot{\beta } =-\frac{1}{2\,\phi \,\beta ^{\prime }}\,\left( \dot{\phi }^{\prime }- \dot{\alpha }\,\phi ^{\prime }\right) ,\end{aligned}$$
(27a)
$$\begin{aligned}&\dot{\beta }^{2}+2\dot{\alpha }\,\dot{\beta }+e^{-2\beta }-e^{-2\alpha } \left[ 2\beta ^{\prime \prime }+3\left( \beta ^{\prime }\right) ^{2} -2\alpha ^{\prime }\beta ^{\prime }\right] \nonumber \\&\quad =-\frac{1}{\phi }\left\{ \left( \dot{\alpha }+2\dot{\beta }\right) \dot{\phi }-e^{-2\alpha }\left[ \phi ^{\prime \prime }-\phi ^{\prime }\left( \alpha ^{\prime }-2\beta ^{\prime }\right) \right] \right\} \nonumber \\&\qquad +\frac{\chi \,\rho }{\phi }+\frac{V\left( \phi \right) }{2\,\phi },\end{aligned}$$
(27b)
$$\begin{aligned}&2\,\ddot{\beta }+3\,\dot{\beta }^{2}+e^{-2\,\beta }-e^{-2\,\alpha }\, \left( \beta ^{\prime }\right) ^{2}=\frac{V\left( \phi \right) }{2\,\phi }\nonumber \\&\qquad -\frac{1}{\phi }\,\left[ \ddot{\phi }+2\,\dot{\beta }\,\dot{\phi } -2\,e^{-2\,\alpha }\,\beta ^{\prime }\,\phi ^{\prime }\right] , \end{aligned}$$
(27c)

respectively, where we have put a cosmological pressure-less dust as a source. In the Appendix A, it is shown that the other non-vanishing gravitational field equations, i.e., 2-2 and 3-3 components, depend on the previous set of equations, as it must be, basically due to the spherical symmetry in the LTB geometry.

Moreover, the scalar field equation (6) rewrites as

$$\begin{aligned}&\ddot{\phi }+\left( \dot{\alpha }+2\,\dot{\beta }\right) \,\dot{\phi } -e^{-2\,\alpha }\,\left[ \phi ^{\prime \prime }-\phi ^{\prime }\, \left( \alpha ^{\prime }-2\,\beta ^{\prime }\right) \right] \nonumber \\&\quad -\frac{2}{3}\,V\left( \phi \right) +\frac{\phi }{3}\,\frac{dV}{d\phi }= \frac{\chi \,\rho }{3}. \end{aligned}$$
(28)

Note that in an inhomogeneous cosmology all the quantities \(\phi \), \(\rho \), \(\alpha \), and \(\beta \) depend on both t and r.

It should be emphasized the occurrence of extra contributions in field equations (27) and (28) with respect to the \(\Lambda \)LTB model, due to the coupling between the scalar field \(\phi \) and the metric functions \(\alpha \), \(\beta \), as well as the presence of the scalar field potential. For instance, it is quite clear to recognize an extra coupling term by comparing the 0-1 field Eq. (27a) with the respective Eq. (19a) in GR. As a consequence, this coupling in the Jordan frame does not allow us to find a relation between \(\alpha \) and \(\beta \), and then rewrite the LTB metric in a simpler form, unlike the \(\Lambda \)LTB model in GR (Sect. 3). For all these reasons, the cosmological dynamics in the Jordan frame is really different from the GR scenario.

On the opposite, the continuity equation related to the ordinary stress–energy tensor \(T_{\mu \nu }\) for a dust in the LTB metric exactly exhibits the same form provided in Eq. (25) both in GR and \(f\left( R\right) \) gravity. In the latter theory, other additional equations are those related to the effective stress–energy tensor \(T_{\mu \nu }^{\left[ \phi \right] }\), defined in Eq. (7), for the scalar field in the Jordan frame. More specifically, Eqs. (9) in the LTB metric become

$$\begin{aligned}&\frac{1}{2}\,\frac{dV}{d\phi }-\frac{V\left( \phi \right) }{2\,\phi }- \ddot{\alpha }-2\,\ddot{\beta }-\dot{\alpha }^{2}-2\,\dot{\beta }^{2}= \frac{\chi }{\phi }\,\rho \nonumber \\&\quad -\frac{1}{\phi }\left\{ \left( \dot{\alpha }+2\dot{\beta }\right) \dot{\phi }-e^{-2\alpha }\left[ \phi ^{\prime \prime }-\phi ^{\prime } \left( \alpha ^{\prime }-2\beta ^{\prime }\right) \right] \right\} ,\end{aligned}$$
(29a)
$$\begin{aligned}&\ddot{\alpha }+\dot{\alpha }\,\left( \dot{\alpha }+2\,\dot{\beta }\right) +2\,e^{-2\,\alpha }\,\left[ \beta ^{\prime }\,\left( \alpha ^{\prime } -\beta ^{\prime }\right) -\beta ^{\prime \prime }\right] \nonumber \\&\quad -\frac{1}{\phi }\,\left[ \ddot{\phi }\,+2\,\dot{\beta }\, \dot{\phi }-2\,e^{-2\,\alpha }\,\beta ^{\prime }\,\phi ^{\prime } \right] +\frac{V\left( \phi \right) }{2\,\phi }=\frac{1}{2}\,\frac{dV}{d\phi } \end{aligned}$$
(29b)

for \(\mu =0,\,1\), respectively.

It should be recalled that these laws for \(T_{\mu \nu }^{\left[ \phi \right] }\) are not independent of the field equations (27) and (28), because these laws basically come from field equations using Bianchi identities. Nevertheless, these additional equations (29) can be useful to rewrite field equations in a different form. For instance, Eq. (29b) has been employed to find the dependence between the 1-1 and 2-2 components of the gravitational field equations (27c) and (A2), which implies spatial isotropy in the LTB geometry, as it has been shown in the Appendix A.

To sum up, within the Jordan frame of \(f\left( R\right) \) gravity in the LTB metric, we have obtained a system of four partial differential equations (27) and (28) with four unknown functions: \(\alpha \left( t,r\right) \), \(\beta \left( t,r\right) \), \(\rho \left( t,r\right) \), and \(\phi \left( t,r\right) \). Note that the scalar field potential \(V\left( \phi \right) \) provides a degree of freedom in the theory. Furthermore, other supplementary equations are provided by Eqs. (25) and (29).

5 Perturbation approach for the LTB model in General Relativity

In this section, we consider local inhomogeneities of the Universe as small spherically symmetric perturbations over a flat background FLRW geometry. We follow a linear perturbation approach, so that we have the FLRW geometry at the zeroth-order perturbation theory, while we build a lumpy Universe described by the LTB metric at the first-order perturbation [96]. Thus, we can write the LTB metric tensor components as

$$\begin{aligned} g_{\mu \nu }^{\text {LTB}}=\bar{g}_{\mu \nu }^{\text {FLRW}}+\delta g_{\mu \nu }. \end{aligned}$$
(30)

Hereinafter, we use an overbar to denote quantities referred to the background homogeneous and isotropic Universe, and the symbol \(\delta \) is related to linear perturbation terms. We emphasize that, choosing this decomposition in Eq. (30), we require spherically symmetric perturbations.

Moreover, we adopt the synchronous gauge for the LTB metric, which intrinsically includes two degrees of freedom in the perturbed metric. Indeed, two independent metric functions, i.e., \(\alpha \left( t,r\right) \) and \(\beta \left( t,r\right) \), are contained in the original LTB line element (18) or, equivalently, \(a\left( t,r\right) \) and \(K^{2}\left( r\right) \) in GR, according to Eq. (22). Actually, \(K^{2}\left( r\right) \) is not exactly a dynamical degree of freedom but an arbitrary parametric function, as a result of the LTB cosmological dynamics. To be more specific, we recall that, in Sect. 3, the 0-1 component (19a) of the Einstein field equations has allowed us to find a relation between the metric functions \(\alpha \left( t,r\right) \) and \(\beta \left( t,r\right) \) in GR, hence to reduce one degree of freedom, and the LTB metric in GR assumes the form given in Eq. (22) in terms of \(a\left( t,r\right) \) and \(K^{2}\left( r\right) \).

Since the background FLRW and the perturbed LTB metrics are both locally rotationally symmetric and are given in the same normal geodesic frame, we only need to focus on scalar functions, as shown in [112, 113]. Hence, the scale factor \(a\left( t,r\right) \) and the energy density of the matter component \(\rho \left( t,r\right) \), contained in the field equations (24a) and (24b), are defined as:

$$\begin{aligned} a\left( t,r\right)&=\bar{a}\left( t\right) +\delta a\left( t,r\right) ,\end{aligned}$$
(31a)
$$\begin{aligned} \rho \left( t,r\right)&=\bar{\rho }\left( t\right) +\delta \rho \left( t,r\right) . \end{aligned}$$
(31b)

Note that the curvature function \(K^{2}\left( r\right) \) in the LTB metric (22) involves radial inhomogeneities, so it can be regarded as a perturbative contribution. In other words, even if hereinafter we set the curvature parameter in the FLRW metric as \(\bar{k}=0\), it is possible to define a linear curvature perturbation, which is exactly given by the curvature function \(K^{2}\left( r\right) \) in the LTB metric, according to the metric decomposition in Eq. (30). Thus, in addition to the metric perturbation \(\delta a\), we have another perturbed quantity with respect to the background FLRW metric, which is \(K^{2}\left( r\right) \).

We also require that background terms dominate over the linear perturbations

$$\begin{aligned} \delta a\left( t,r\right) \ll \bar{a}\left( t\right) \!, \quad \delta \rho \left( t,r\right) \ll \bar{\rho }\left( t\right) \end{aligned}$$
(32)

at any time t, or redshift z, in the late Universe. This condition is dictated by the cosmological principle.

Once the decomposition has been defined in Eqs. (31a), (31b), the evolution in time and space of the physical quantities can be obtained by studying the gravitational field equations (24a) and (24b) at background and linear levels.

In particular, we define a dimensionless time variable

$$\begin{aligned} \tau =\frac{t}{t_{0}}, \end{aligned}$$
(33)

in which \(t_{0}\) is the present cosmic time (today \(\tau =1\)). Note that \(\tau \) is the cosmic time in units of the present Hubble time since \(t_{0}\) can be approximately written in terms of the Hubble constant as \(t_{0}\approx 1/H_{0}\) [3].

5.1 Background solution

If we consider only background terms, it is straightforward to show that Eq. (24a) turns into the first Friedmann equation in a flat FLRW geometry:

$$\begin{aligned} H^{2}\left( t\right) \equiv \left[ \frac{\dot{\overline{a}}\left( t\right) }{\overline{a}\left( t\right) }\right] ^{2}=\frac{\chi \,\overline{\rho } \left( t\right) }{3}+\frac{\Lambda }{3}, \end{aligned}$$
(34)

being H(t) the Hubble parameter. Furthermore, the other Eq. (24b) can be rewritten at the background level, and combined with Eq. (34), provides the second Friedmann equation, also commonly named the cosmic acceleration equation:

$$\begin{aligned} \frac{\ddot{\overline{a}}\left( t\right) }{\overline{a}\left( t\right) } =-\frac{\chi \,\overline{\rho }}{6}+\frac{\Lambda }{3}. \end{aligned}$$
(35)

Then, we rewrite the first Friedmann equation (34) in terms of \(\tau \), defined in Eq. (33), as

$$\begin{aligned} \left[ \frac{1}{\bar{a}\left( \tau \right) }\,\frac{d\bar{a} \left( \tau \right) }{d\tau }\right] ^{2}=\frac{\Omega _{m0}}{\bar{a}^{3}\left( \tau \right) }+\Omega _{\Lambda 0}. \end{aligned}$$
(36)

We have used the well-known relation \(\bar{\rho }\sim \bar{a}^{-3}\) for the matter component, the chain rule \(\frac{d}{dt}=\frac{1}{t_{0}}\,\frac{d}{d\tau }\approx H_{0}\,\frac{d}{d\tau }\), and the usual definitions of the cosmological density parameters \(\Omega _{m0}\) and \(\Omega _{\Lambda 0}\).

The Friedmann equation (36) admits an analytical solution in the late Universe, that is the background scale factor in terms of \(\tau \):

$$\begin{aligned}&\bar{a}\left( \tau \right) =\left( \frac{\Omega _{m0}}{\Omega _{\Lambda 0}} \right) ^{1/3}\left\{ \sinh \left[ \frac{3}{2}\sqrt{\Omega _{\Lambda 0}} \left( \tau -1\right) \right. \right. \nonumber \\&\quad \left. \left. +\text {arcsinh}\left( \sqrt{\frac{\Omega _{\Lambda 0}}{\Omega _{m0}}}\right) \right] \right\} ^{2/3}. \end{aligned}$$
(37)

Note also from Eq. (37) that the deceleration parameter \(\bar{q}\left( \tau \right) \equiv -\ddot{\bar{a}}\,\bar{a}^{-1}\,H^{-2}\rightarrow -1\) for \(\tau \rightarrow +\infty \), as it should be in a dark-energy-fully-dominated Universe. We here stress that the solution (37) applies only in the late Universe, otherwise we need to solve numerically the field equations, if we also consider the radiation contribution. Nevertheless, we are interested in the evolution of local inhomogeneities at late times.

It should be noted that in the limit

$$\begin{aligned} \underset{\Omega _{\Lambda }\rightarrow 0}{lim}\quad \bar{a}\left( \tau \right) \sim \left( \tau -1\right) ^{2/3}, \end{aligned}$$
(38)

we recover the well-known relation for the background scale factor \(\bar{a}\) satisfied in the matter-dominated Universe [3].

Concerning the evolution of the background energy density \(\bar{\rho }\), we start from the continuity equation (26) in the LTB metric. We verify that this equation at the zeroth order becomes simply the respective continuity equation for the matter component in the FLRW metric, i.e.

$$\begin{aligned} \dot{\bar{\rho }}+3\,H\,\bar{\rho }=0, \end{aligned}$$
(39)

which provides \(\bar{\rho }\sim \bar{a}^{-3}\). Actually, we recall that Eq. (39) is not independent of the two Friedmann equations (34) and (35), since it can be derived by combining them.

Finally, we focus on the relation between the redshift z and the dimensionless parameter \(\tau \), defined in Eq. (33), to understand to what extent of \(\tau \) values the background solution (37) can be applied in the late Universe. To be more accurate in this computation, we also include the radiation contribution to write \(\tau \) as

$$\begin{aligned} \tau \left( z\right) =1+\int _{1}^{{1}/{1+z}}\frac{dx}{x\sqrt{\Omega _{m0}x^{-3}+ \Omega _{r0}x^{-4}+\Omega _{\Lambda 0}}}, \end{aligned}$$
(40)

where we have used the Friedmann equation (36), the definition of \(\tau \) in Eq. (33), and we recall that \(\bar{a}_{0}/\bar{a}=1+z\). The quantity \(\tau \left( z\right) \) can be computed numerically for a given redshift z, after specifying the cosmological parameters: \(\Omega _{m0}=0.3111\), \(\Omega _{\Lambda 0}=0.6889\), and \(\Omega _{r0}=9.138\times 10^{-5}\) from Table 2 in [5]. For instance, we can compute: \(\tau \left( z_{\text {eq}}\right) =0.046\) at the redshift of the matter-radiation equality \(z_{\text {eq}}=3403.5\); \(\tau \left( z_{\text {DE}}\right) =0.75\) at the matter-dark energy equality \(z_{\text {DE}}=0.303;\) \(\tau \left( z_{\text {100eq}}\right) =0.052\) when the energy density of the matter component was one hundred times more than the radiation contribution at \(z_{100\text {eq}}=33.045\). In particular, considering this latter value of \(\tau \), you can see in Fig. 2 the behavior of the background scale factor \(\bar{a}\left( \tau \right) \) and the deceleration parameter \(\bar{q}\left( \tau \right) \) in the range \(\tau _{100\text {eq}}<\tau <5\), when relativistic species are negligible.

Fig. 2
figure 2

Evolution of the background scale factor \(\bar{a}\left( \tau \right) \) (top panel) and the respective deceleration parameter \(\bar{q}\left( \tau \right) \) (bottom panel) in terms of the time dimensionless parameter \(\tau \), defined in Eq. (33), for a flat \(\Lambda \)CDM model within the range \(\tau _{100\text {eq}}<\tau <5\), according to the solution given in Eq. (37)

5.2 Linearly perturbed solutions in an inhomogeneous Universe

We analyze the impact of local inhomogeneities in the cosmological dynamics. The linearized field equations allow us to investigate the evolution of spherically symmetric perturbations.

If we include local inhomogeneities in the first-order perturbation theory, the Eqs. (24a) and (24b) become

$$\begin{aligned}&\left[ \bar{a}^{2}\,\left( \chi \,\bar{\rho }+\Lambda \right) - \dot{\bar{a}}^{2}\right] \,\left( 3\,\delta a+r\,\delta a^{\prime }\right) + \chi \,\delta \rho \,\bar{a}^{3}\nonumber \\&\quad =2\,\bar{a}\,\dot{\bar{a}}\,\left( 3\,\delta \dot{a}+r\,\delta \dot{a}^{\prime }\right) +3\,\bar{a}\,K^{2}+2\,\bar{a}\,r\,K\,K^{\prime },\end{aligned}$$
(41a)
$$\begin{aligned}&\delta \ddot{a}+\frac{\dot{\bar{a}}}{\bar{a}}\,\delta \dot{a}- \left( \frac{\ddot{\bar{a}}}{\bar{a}}+\frac{\dot{\bar{a}}^{2}}{\bar{a}^{2}}\right) \,\delta a+\frac{K^{2}}{2\,\bar{a}}=0, \end{aligned}$$
(41b)

respectively.

Furthermore, we rewrite the continuity equation (26) at linear order:

$$\begin{aligned} \delta \dot{\rho }+3\frac{\dot{\bar{a}}}{\bar{a}}\delta \rho = \frac{\bar{\rho }}{\bar{a}^{2}}\left[ \dot{\bar{a}}\left( 3\delta a+r\delta a^{\prime }\right) -\bar{a}\left( 3\delta \dot{a} +r\delta \dot{a}^{\prime }\right) \right] . \end{aligned}$$
(42)

To study separately the evolution of local inhomogeneities in time and space, we adopt the separation of variables method to solve analytically the first-order perturbation equations. Hence, we define time and radial functions for all linear perturbations:

$$\begin{aligned} \delta a\left( t,r\right) \equiv \text {a}_{p}\left( t\right) \varvec{\mathfrak {a}}_{p}\left( r\right) ,\quad \delta \rho \left( t,r\right) \equiv R_{p}\left( t\right) \varrho _{p}\left( r\right) . \end{aligned}$$
(43)

The quantities \(\text {a}_{p}\left( t\right) \) and \(\varvec{\mathfrak {a}}_{p}\left( r\right) \) are both dimensionless. We assume, without loss of generality, that \(R_{p}\left( t\right) \) has the physical dimensions of an energy density as \(\bar{\rho }\) and \(\delta \rho \), while we treat \(\varrho _{p}\left( r\right) \) like a dimensionless quantity. We also recall that the curvature perturbation \(K^{2}\left( r\right) \) in the LTB metric depends only on the radial coordinate.

We stress that if we would also include non-linear terms, then the separation of variables could not lead to a general solution. However, the linearization procedure adopted for the dynamics allows us to use a separation of variables characterized by the factorization (43) of the time and space dependences in the linear perturbation theory.

Using the factorization (43), Eq. (41b) can be split into two parts. By setting the radial dependence as

$$\begin{aligned} K^{2}\left( r\right) =\varvec{\mathfrak {a}}_{p}\left( r\right) , \end{aligned}$$
(44)

we obtain an ordinary differential equation for the time evolution:

$$\begin{aligned} \ddot{\text {a}}_{p}+\frac{\dot{\bar{a}}}{\bar{a}}\,\dot{\text {a}}_{p}-\left[ \frac{\ddot{\bar{a}}}{\bar{a}}+\left( \frac{\dot{\bar{a}}}{\bar{a}}\right) ^{2}\right] \,\text {a}_{p}=0, \end{aligned}$$
(45)

in which we have also considered that \(\bar{a}\gg \text {a}_{p}\). We would emphasize that the assumption given in Eq. (44) is suggested by the form of Eq. (41b), once we used the separation of variables from Eq. (43). Nevertheless, we have still two metric perturbations given by the quantities \(\text {a}_{p}\left( t\right) \) and \(\varvec{\mathfrak {a}}_{p}\left( r\right) \).

We proceed similarly for the first-order perturbation continuity equation (42). After straightforward calculations, by using again the factorization (43) in Eq. (42), we separate terms that depend only on t from those related to r. In particular, the time evolution is provided by

$$\begin{aligned} \dot{R}_{p}+3\,\frac{\dot{\bar{a}}}{\bar{a}}\,R_{p}=X\,\frac{\bar{\rho }}{\bar{a}}\,\left( \frac{\dot{\bar{a}}}{\bar{a}}\,\text {a}_{p}-\dot{\text {a}}_{p}\right) , \end{aligned}$$
(46)

while we obtain the following radial dependence

$$\begin{aligned} \varrho _{p}=\frac{1}{X}\,\left( 3\,\varvec{\mathfrak {a}}_{p}+r\,\varvec{\mathfrak {a}}_{p}^{\prime }\right) . \end{aligned}$$
(47)

The constant X is introduced by the separation of variables method. We recall that the background solution for \(\bar{a}\) is written in Eq. (37) and also \(\bar{\rho }\sim \bar{a}^{-3}\).

We rewrite the first-order perturbation Eq. (41a), by employing Eq. (43) and dividing both sides of the equation by \(\bar{a}^{2}\,\text {a}_{p}\,\varvec{\mathfrak {a}}_{p}\), as

$$\begin{aligned}&\left[ \chi \,\bar{\rho }+\Lambda -\left( \frac{\dot{\bar{a}}}{\bar{a}}\right) ^{2} -2\,\frac{\dot{\bar{a}}}{\bar{a}}\,\frac{\dot{\text {a}}_{p}}{\text {a}}_{p}\right] \, \left( 3+r\,\frac{\varvec{\mathfrak {a}}_{p}^{\prime }}{\varvec{\mathfrak {a}}_{p}}\right) \nonumber \\&\quad =\frac{3}{\bar{a}\,\text {a}_{p}}\,\frac{K^{2}}{\varvec{\mathfrak {a}}_{p}}+ \frac{2}{\bar{a}\,\text {a}_{p}}\,\frac{r\,K\,K^{\prime }}{\varvec{\mathfrak {a}}_{p}}-\chi \,\bar{a}\,\frac{R_{p}}{\text {a}}_{p}\, \frac{\varrho _{p}}{\varvec{\mathfrak {a}}_{p}}. \end{aligned}$$
(48)

We observe the presence of several mixed terms depending both on t and r. However, we can reduce the number of these mixed terms, by using Eqs. (34), (44), and (47) to rewrite Eq. (48) as

$$\begin{aligned} \left[ 2\,\frac{\dot{\bar{a}}}{\bar{a}}\,\left( \frac{\dot{\bar{a}}}{\bar{a}} \,\text {a}_{p}-\dot{\text {a}}_{p}\right) +\frac{\chi }{X}\,\bar{a}\,R_{p} \right] \,\frac{\varrho _{p}}{\varvec{\mathfrak {a}}_{p}}=0. \end{aligned}$$
(49)

Since we want to avoid trivial solutions, we should have \(\varrho _{p}\ne 0\) and \(\varvec{\mathfrak {a}}_{p}\ne 0\). Then, we obtain a single ordinary differential equation in the time domain:

$$\begin{aligned} 2\,\frac{\dot{\bar{a}}}{\bar{a}}\,\left( \frac{\dot{\bar{a}}}{\bar{a}} \,\text {a}_{p}-\dot{\text {a}}_{p}\right) +\frac{\chi }{X}\,\bar{a}\,R_{p}=0. \end{aligned}$$
(50)

It is straightforward to check the compatibility between Eqs. (45), (46), and (50). Indeed, by combining the time derivative of Eq. (50) with Eq. (46), the background field equations (34), and (35), it is easy to build exactly Eq. (45).

Then, we rewrite the term in the brackets on the right-hand side of Eq. (46) by using Eq. (50), and we get an ordinary differential equation with a single variable \(R_{p}\left( t\right) \), that is

$$\begin{aligned} \dot{R}_{p}+\left( 3\,\frac{\dot{\bar{a}}}{\bar{a}}+\frac{\chi \, \bar{\rho }}{2}\,\frac{\bar{a}}{\dot{\bar{a}}}\right) \,R_{p}=0. \end{aligned}$$
(51)

Therefore, focusing on the time domain, we can obtain numerical solutions for the unknown quantities \(\text {a}_{p}\) and \(R_{p}\) from the linearized equations (45) and (51). In particular, Eq. (45) shows exactly the same behavior in terms of t and \(\tau \), as it can be checked by using the definition of \(\tau \) (33). Recalling the expression (37) of the background scale factor in GR, Eq. (45) can be solved numerically. We set the initial conditions at \(\tau =1\) today: \(\text {a}_{p}\left( 1\right) =10^{-5}\) and \(\dot{\text {a}}_{p}\left( 1\right) =0\). Moreover, we fixed the same values for \(\Omega _{m0}\) and \(\Omega _{\Lambda 0}\) adopted in Sect. 5.1. In the upper panel of Fig. 3, you can see the numerical results for \(1\le \tau \le 5\). Note that the perturbed scale factor \(\text {a}_{p}\) increases as \(\tau \) grows, and this fact may be a problem if perturbations become unstable. However, the evolution of \(\text {a}_{p}\) is dominated by the background term \(\bar{a}\) at any time \(\tau \). Indeed, the ratio between the perturbation and background terms with \(\eta \left( \tau \right) \equiv \left| \text {a}_{p}/\bar{a}\right| \ll 1\) for any \(\tau \), as it is shown in the middle panel of Fig. 3. In other words, perturbations of the scale factor due to local inhomogeneities will remain small over time.

Concerning the time evolution of the perturbed energy density of the matter component \(R_{p}\), we rewrite Eq. (51) in terms of \(\tau \) as

$$\begin{aligned} \frac{dO_{p}}{d\tau }+3\,\left[ \frac{1}{\bar{a}}\,\frac{d\bar{a}}{d\tau }+ \frac{\Omega _{m0}}{2\,\bar{a}^{2}}\,\left( \frac{d\bar{a}}{d\tau } \right) ^{-1}\right] \,O_{p}=0, \end{aligned}$$
(52)

in which we have defined the dimensionless quantity \(O_{p}\equiv R_{p}/\bar{\rho }_{c0}\). We solve numerically Eq. (52) with the initial condition \(O_{p}\left( 1\right) =10^{-5}\) for \(\tau =1\). The results are shown in the bottom panel of Fig. 3. Note that \(O_{p}\left( \tau \right) \ll 1\) for \(1\le \tau \le 5\).

Fig. 3
figure 3

Top panel: Evolution of the linearly perturbed scale factor \(\text {a}_{p}\left( \tau \right) \) in units of \(10^{-4}\) and in terms of the parameter \(\tau \), provided by the numerical solution of Eq. (45). Middle panel: The ratio between the first-order perturbation term and background scale factor \(\eta \left( \tau \right) \equiv \left| \text {a}_{p}/\bar{a}\right| \) versus \(\tau \) in units of \(10^{-5}\). Bottom panel: Evolution of the dimensionless perturbed energy density \(O_{p}\left( \tau \right) \equiv R_{p}/\bar{\rho }_{c0}\) in units of \(10^{-6}\). Note that all perturbed contributions are smaller than respective background terms for \(1\le \tau \le 5\)

Finally, after obtaining numerical solutions for the time domain, we focus on the radial part of perturbations. We recall that \(K^{2}\left( r\right) =\varvec{\mathfrak {a}}_{p}\left( r\right) \) from Eq. (44). Moreover, we assume for simplicity a proportionality between radial perturbations, i.e., \(\varrho _{p}=C\,\varvec{\mathfrak {a}}_{p}\) with a constant C.

Then, we solve the ordinary differential equation (47) in r, and we obtain a power-law behavior for the radial correction of the perturbed scale factor in GR:

$$\begin{aligned} \varvec{\mathfrak {a}}_{p}\left( r\right) \propto r^{-y}, \end{aligned}$$
(53)

for which \(y\equiv 3-C\,X\). More in detail, we need to impose the condition \(y>0\) to ensure that inhomogeneities decay on large scales, according to the cosmological principle.

6 Perturbation approach for the LTB model in the Jordan Frame of \(f\left( R\right) \) gravity

In this section, we compare and discuss the evolution of inhomogeneous perturbations in GR and in the Jordan frame of \(f\left( R\right) \) gravity, considering again a cosmological dust \((p=0)\) in the LTB geometry. A complete general solution in linear perturbation theory within the metric \(f\left( R\right) \) gravity was developed in [40, 41, 114]. Instead of proceeding with a fourth-order cosmological dynamics, here we work in the equivalent Jordan frame \(f\left( R\right) \) gravity. Furthermore, as a particular case, we focus on spherically symmetric perturbations, following the same perturbation approach developed in Sect. 5 by using the metric decomposition in Eq. (30). Hence, we split the metric functions \(\alpha \) and \(\beta \), the energy density \(\rho \), and the scalar field \(\phi \) into background terms plus linear corrections as

$$\begin{aligned} \alpha \left( t,r\right)&=\bar{\alpha }\left( t\right) +\delta \alpha \left( t,r\right) \nonumber \\ \beta \left( t,r\right)&=\bar{\beta }\left( t,r\right) +\delta \beta \left( t,r\right) \nonumber \\ \rho \left( t,r\right)&=\bar{\rho }\left( t\right) +\delta \rho \left( t,r\right) \nonumber \\ \phi \left( t,r\right)&=\bar{\phi }\left( t\right) +\delta \phi \left( t,r\right) . \end{aligned}$$
(54)

We also require again that inhomogeneities are much smaller than respective background terms.

It should be stressed that, in the Jordan frame, we can not use the LTB metric in the simpler form (22), but we refer to the original LTB line element (18). Thus, the two degrees of freedom of the perturbed metric are given by \(\alpha \left( t,r\right) \) and \(\beta \left( t,r\right) \); we no longer refer to \(a\left( t,r\right) \) and \(K^{2}\left( r\right) \), as in the GR scenario.

Note that the background quantities \(\bar{\alpha }\) and \(\bar{\beta }\) are related to the scale factor \(\bar{a}\), since we want to reproduce a flat FLRW geometry at the zeroth-order perturbation. Then, comparing a flat FLRW metric with the LTB line element in the form given by Eq. (18), it is straightforward to show that

$$\begin{aligned} \bar{\alpha }\left( t\right) =\ln \left( \bar{a}\left( t\right) \right) , \quad \bar{\beta }\left( t,r\right) =\ln \left( \bar{a}\left( t\right) \,r\right) . \end{aligned}$$
(55)

As a consequence, the metric tensor component \(g_{rr}\) in the LTB metric can be approximated for \(\delta \alpha \ll 1/2\) as

$$\begin{aligned} g_{rr}=e^{2\alpha }=e^{2\left( \bar{\alpha }+\delta \alpha \right) } \approx \bar{a}^{2}\left( t\right) \,\left( 1+2\,\delta \alpha \right) , \end{aligned}$$
(56)

in which it is possible to recognize the respective metric tensor component \(g_{rr}\) in a flat FLRW metric as background term. We can follow the same reasoning for the other metric tensor components involving \(\beta \) with the assumption \(\delta \beta \ll 1/2\).

Also, we need to expand the scalar field potential \(V\left( \phi \right) \), defined in Eq. (4), which appears in the field equations (27b), (27c), (28). Therefore, including local inhomogeneities, we obtain

$$\begin{aligned}&V\left[ \phi \left( t,r\right) \right] =V\left[ \bar{\phi }\left( t\right) + \delta \phi \left( t,r\right) \right] \nonumber \\&\quad \approx V\left[ \bar{\phi }\left( t\right) \right] +\left. \frac{dV}{d\phi }\right| _{\phi =\bar{\phi }}\,\delta \phi \left( t,r\right) +O\left( \delta \phi ^{2}\right) \end{aligned}$$
(57)

for the first-order perturbation theory. Similarly, we can rewrite the derivative of \(V\left( \phi \right) \).

As we have proceeded to study the gravitational field equations in GR in Sect. 5 to find background and linear solutions, now we analyze the dynamics of \(f\left( R\right) \) gravity in the Jordan frame, provided by the field equations (27), and (28) in the LTB metric.

6.1 Background solution

If we consider all background quantities, we do not include spherically symmetric perturbations and Eqs. (27b), (27c), and (28) turn into field equations in the Jordan frame of \(f\left( R\right) \) gravity in a flat FLRW geometry:

$$\begin{aligned}&H^{2}=\frac{\chi \bar{\,\rho }}{3\,\bar{\phi }}-H\,\frac{\dot{\bar{\phi }}}{\bar{\phi }}+\frac{V\left( \bar{\phi }\right) }{6\,\bar{\phi }}, \end{aligned}$$
(58a)
$$\begin{aligned}&\frac{\ddot{\bar{a}}}{\bar{a}}=-\frac{\chi \,\bar{\rho }}{6\,\bar{\phi }}- \frac{H}{2}\,\frac{\dot{\bar{\phi }}}{\bar{\phi }}-\frac{1}{2}\, \frac{\ddot{\bar{\phi }}}{\bar{\phi }}+\frac{V\left( \bar{\phi } \right) }{6\,\bar{\phi }},\end{aligned}$$
(58b)
$$\begin{aligned}&3\ddot{\bar{\phi }}-2\,V\left( \bar{\phi }\right) +\bar{\phi }\, \frac{dV}{d\bar{\phi }}+9\,H\,\dot{\bar{\phi }}=\chi \,\bar{\rho }. \end{aligned}$$
(58c)

Equation (58a) is the modified Friedmann equation, Eq. (58b) is the modified acceleration equation, and Eq. (58c) concerns the scalar field evolution in the Jordan frame. In particular, Eq. (58b) is obtained by combining the zeroth-order perturbation Eqs. (27b) and (27c). Furthermore, Eq. (27a) vanishes at the background level in the synchronous gauge, and it becomes a trivial identity.

Then, we focus on the \(f\left( R\right) \) HS model in the Jordan frame, which has been introduced in Sect. 2.1. Recalling the form of the scalar field potential \(V\left( \bar{\phi }\right) \) in Eq. (17), we observe that the field equations (58) do not admit any analytical solutions, and we have to solve it numerically.

In this regard, we rewrite the full set of equations (58) in terms of the dimensionless parameter \(\tau \), defined in Eq. (33), and we obtain, respectively:

$$\begin{aligned}&\left[ \frac{1}{\bar{a}\left( \tau \right) }\,\frac{d\bar{a}\left( \tau \right) }{d\tau } \right] ^{2}=\frac{\Omega _{m0}}{\bar{\phi }\left( \tau \right) } \left( \frac{1}{\bar{a}^{3}\left( \tau \right) }+\frac{V\left( \bar{\phi } \right) }{6\,m^{2}}\right) \nonumber \\&\quad -\frac{1}{\bar{a}\left( \tau \right) \,\bar{\phi }\left( \tau \right) }\, \frac{d\bar{a}\left( \tau \right) }{d\tau }\,\frac{d\bar{\phi }\left( \tau \right) }{d\tau },\end{aligned}$$
(59a)
$$\begin{aligned}&\frac{1}{\bar{a}\left( \tau \right) }\,\frac{d^{2}\bar{a} \left( \tau \right) }{d\tau ^{2}}=-\frac{\Omega _{m0}}{\bar{\phi } \left( \tau \right) }\left( \frac{1}{\bar{a}^{3}\left( \tau \right) } +\frac{V\left( \bar{\phi }\right) }{6\,m^{2}}\right) \nonumber \\&\quad +\frac{\Omega _{m0}}{6m^{2}}\frac{dV\left( \bar{\phi } \right) }{d\bar{\phi }}+\frac{1}{\bar{a}\left( \tau \right) \, \bar{\phi }\left( \tau \right) }\,\frac{d\bar{a}\left( \tau \right) }{d\tau } \,\frac{d\bar{\phi }\left( \tau \right) }{d\tau },\end{aligned}$$
(59b)
$$\begin{aligned}&\frac{3}{\bar{\phi }\left( \tau \right) }\,\frac{d^{2}\bar{\phi } \left( \tau \right) }{d\tau ^{2}}-2\,\frac{\Omega _{m0}}{\bar{\phi } \left( \tau \right) }\,\frac{V\left( \bar{\phi }\right) }{m^{2}}+ \frac{\Omega _{m0}}{m^{2}}\,\frac{dV\left( \bar{\phi }\right) }{d\bar{\phi }}\nonumber \\&\quad +\frac{9}{\bar{a}\left( \tau \right) \,\bar{\phi }\left( \tau \right) }\, \frac{d\bar{a}\left( \tau \right) }{d\tau }\,\frac{d\bar{\phi }\left( \tau \right) }{d\tau }=\frac{3\,\Omega _{m0}}{\bar{\phi }\left( \tau \right) \,\bar{a}^{3}\left( \tau \right) }. \end{aligned}$$
(59c)

We used the usual relation for \(\Omega _{m0}\), and we recall that \(m^{2}=\chi \,\bar{\rho }/3\). In particular, Eqs. (59a) and (59c) allow us to obtain numerical solutions for \(\bar{a}\left( \tau \right) \) and \(\bar{\phi }\left( \tau \right) \), while Eq. (59b) is useful to estimate numerically the deceleration parameter \(\bar{q}\left( \tau \right) \).

Fig. 4
figure 4

Numerical background solutions, considering a flat FLRW geometry, for the \(f\left( R\right) \) HS model in the Jordan frame. Top panel: Evolution of the scale factor \(\bar{a}\) in terms of the parameter \(\tau \). Middle panel: Behavior of the deceleration parameter \(\bar{q}\left( \tau \right) \). Bottom panel: The deviation from the GR scenario \((\bar{\phi }=1)\) with units of \(10^{-7}\) for the vertical axis

We choose the parameters of the model in such a way that the background modified gravity scenario is almost equivalent to the \(\Lambda \)CDM cosmological model with the aim of focusing later on the differences between the linear perturbation solutions in the two models. More precisely, we fix \(\Omega _{m0}=0.3111,\) the same value adopted in Sect. 5.1, and we set the value \(\left| F_{R0}\right| =1.0\times 10^{-7}\) at the present cosmic time (redshift \(z=0\) or \(\tau =1\)), which provides information about the deviation from the GR scenario, according to Eq. (16). As a consequence, we constrain the HS dimensionless parameters: \(c_{1}=2.0\times 10^{6}\) and \(c_{2}=1.5\times 10^{5}\), as developed in Sect. 2.1. We recall that the profile of the background quantity \(V\left( \bar{\phi }\right) /m^{2}\) is plotted in Fig. 1.

To guarantee a nearly frozen evolution of the scalar field \(\bar{\phi }\) for increasing \(\tau \), we impose the following condition: \(\frac{d\bar{\phi }}{d\tau }\left( \tau =1\right) =0\). Finally, we solve numerically Eqs. (59a) and (59c) for \(0.2<\tau <5\), when the relativistic components remain negligible as compared with the matter, to obtain the evolution of \(\bar{a}\left( \tau \right) \) and \(\bar{\phi }\left( \tau \right) \). The numerical results are shown in Fig. 4. By comparing it with Fig. 2, it should be emphasized that \(\bar{a}\left( \tau \right) \) and \(\bar{q}\left( \tau \right) \) exhibit almost the same behavior in GR and in the Jordan frame of \(f\left( R\right) \) gravity, as desired according to the choice of model parameters abovementioned. In particular, in the bottom panel of Fig. 4, we plot the quantity \(\left| 1-\bar{\phi }\left( \tau \right) \right| \) to evaluate the deviation from GR \((\bar{\phi }=1){:}\) we observe more relevant deviations in the late Universe for \(\tau >1\), but nevertheless the background modified gravity dynamics still remains almost undistinguishable from the \(\Lambda \)CDM scenario. Hence, we can shift the attention towards the first-order perturbation solutions in the Jordan frame of \(f\left( R\right) \) gravity.

6.2 Linearly perturbed solutions in an inhomogeneous Universe

We focus on the first-order perturbed equations to study the evolution of spherically symmetric perturbations. Considering the split between background terms and linear perturbations according to Eq. (54), the set of field equations (27) becomes

$$\begin{aligned}&\delta \dot{\beta }^{\prime }=\frac{1}{r}\,\left( \delta \dot{\alpha }- \delta \dot{\beta }\right) -\frac{1}{2\,\bar{\phi }}\,\left( \delta \dot{\phi }^{\prime }- \frac{\dot{\bar{a}}}{\bar{a}}\,\delta \phi ^{\prime }\right) ,\end{aligned}$$
(60a)
$$\begin{aligned}&\frac{2}{\bar{a}^{2}}\,\left[ \frac{1}{r^{2}}\,\left( \delta \alpha - \delta \beta \right) -\delta \beta ^{\prime \prime }-\frac{3}{r}\, \delta \beta ^{\prime }+\frac{1}{r}\,\delta \alpha ^{\prime }\right] \nonumber \\&\qquad +\left( 2\,\frac{\dot{\bar{a}}}{\bar{a}}+\frac{\dot{\bar{\phi }}}{\bar{\phi }}\right) \,\left( \delta \dot{\alpha }+2\,\delta \dot{\beta }\right) =\frac{\chi }{\bar{\phi }}\,\delta \rho -3\,\frac{\dot{\bar{a}}}{\bar{a}}\, \frac{\delta \dot{\phi }}{\bar{\phi }}\nonumber \\&\qquad +\left( \frac{1}{2}\,\left. \frac{dV}{d\phi }\right| _{\phi = \bar{\phi }}-\frac{1}{2}\,\frac{V\left( \bar{\phi }\right) }{\bar{\phi }}- \frac{\chi \,\bar{\rho }}{\bar{\phi }}+3\,\frac{\dot{\bar{a}}}{\bar{a}}\, \frac{\dot{\bar{\phi }}}{\bar{\phi }}\right) \,\frac{\delta \phi }{\bar{\phi }}\nonumber \\&\qquad +\frac{1}{\bar{a}^{2}\,\bar{\phi }}\,\left( \delta \phi ^{\prime \prime }+ \frac{2}{r}\,\delta \phi ^{\prime }\right) ,\end{aligned}$$
(60b)
$$\begin{aligned}&\delta \ddot{\beta }+3\,\frac{\dot{\bar{a}}}{\bar{a}}\,\delta \dot{\beta }+\frac{1}{\bar{a}^{2}\,r^{2}}\,\left( \delta \alpha - \delta \beta -r\,\delta \beta ^{\prime }\right) \nonumber \\&\quad =\left( \frac{1}{2}\,\left. \frac{dV}{d\phi } \right| _{\phi =\bar{\phi }}-\frac{1}{2}\,\frac{V\left( \bar{\phi } \right) }{\bar{\phi }}+\frac{\ddot{\bar{\phi }}}{\bar{\phi }} +2\,\frac{\dot{\bar{a}}}{\bar{a}}\,\frac{\dot{\bar{\phi }}}{\bar{\phi }}\right) \,\frac{\delta \phi }{2\,\bar{\phi }}\nonumber \\&\qquad -\frac{1}{2\,\bar{\phi }}\,\left( \delta \ddot{\phi } +2\,\frac{\dot{\bar{a}}}{\bar{a}}\,\delta \dot{\phi }+2\, \dot{\bar{\phi }}\,\delta \dot{\beta }-\frac{2}{\bar{a}^{2}\,r} \,\delta \phi ^{\prime }\right) . \end{aligned}$$
(60c)

Similarly, starting from Eq. (28), the linearized scalar field equation is given by

$$\begin{aligned}&\delta \ddot{\phi }+3\frac{\dot{\bar{a}}}{\bar{a}}\delta \dot{\phi }+ \left( \delta \dot{\alpha }+2\delta \dot{\beta }\right) \dot{\bar{\phi }}- \frac{1}{\bar{a}^{2}}\left( \delta \phi ^{\prime \prime }+\frac{2}{r} \delta \phi ^{\prime }\right) \nonumber \\&\quad +\frac{1}{3}\,\left( \bar{\phi }\,\left. \frac{d^{2}V}{d\phi ^{2}} \right| _{\phi =\bar{\phi }}-\left. \frac{dV}{d\phi }\right| _{\phi = \bar{\phi }}\right) \,\delta \phi =\frac{1}{3}\,\chi \,\delta \rho . \end{aligned}$$
(61)

Moreover, the continuity equation (25) rewrites as

$$\begin{aligned} \delta \dot{\rho }+3\,\frac{\dot{\bar{a}}}{\bar{a}}\,\delta \rho + \left( \delta \dot{\alpha }+2\,\delta \dot{\beta }\right) \,\bar{\rho }=0 \end{aligned}$$
(62)

at the linear perturbation order. We have used Eq. (55) to rewrite \(\bar{\alpha }\) and \(\bar{\beta }\) in terms of \(\bar{a}\).

Following the same approach we adopted in GR in Sect. 5, we use a separation of variables method to study separately the evolution of inhomogeneities in time and space. Hence, we factorize the linear perturbations as:

$$\begin{aligned} \delta \alpha \left( t,r\right)&\equiv A_{p}\left( t\right) \, {\mathcal {A}}_{p}\left( r\right) \nonumber \\ \delta \beta \left( t,r\right)&\equiv B_{p}\left( t\right) \,{\mathcal {B}}_{p}\left( r\right) \nonumber \\ \delta \rho \left( t,r\right)&\equiv P_{p}\left( t\right) \,\varrho _{p}\left( r\right) \nonumber \\ \delta \phi \left( t,r\right)&\equiv \Phi _{p}\left( t\right) \,\varphi _{p}\left( r\right) . \end{aligned}$$
(63)

Assuming this factorization, we can rewrite Eqs. (60), (61), and (62). However, we notice the presence of several mixed terms depending both on t and r, which do not allow us to solve the equations using the separation of variables in a standard way, unless we rely on reasonable and simplifying assumptions (further details on explicit calculations are in the Appendix B). For instance, we are able to use the separation of variables method for all field equations, if we require the two following conditions:

$$\begin{aligned} A_{p}&=\lambda _{1}\,B_{p},\end{aligned}$$
(64a)
$$\begin{aligned} \varrho _{p}&=\lambda _{2}\,\varphi _{p}, \end{aligned}$$
(64b)

where \(\lambda _{1}\) and \(\lambda _{2}\) are two proportionality constants. These conditions allow us to simplify the equation system and easily separate time and radial dependences: we obtain a set of differential equations describing the radial profiles of perturbations and another equation system concerning only the time evolution.

Hence, starting from Eqs. (60), (61), and (62), after long but straightforward calculations (see the Appendix B), we obtain a set of equations for the radial part:

$$\begin{aligned}&{\mathcal {A}}_{p}=\frac{1}{\lambda _{1}}\,\left[ {\mathcal {B}}_{p}+r\, \left( {\mathcal {B}}_{p}^{\prime }+\mu _{1}\,\varphi _{p}^{\prime }\right) \right] ,\end{aligned}$$
(65a)
$$\begin{aligned}&{\mathcal {B}}_{p}=\frac{2}{\mu _{4}\,r}\,\varphi _{p}^{\prime }-\mu _{1}\,\varphi _{p},\end{aligned}$$
(65b)
$$\begin{aligned}&\varphi _{p}^{\prime \prime }+\frac{2}{r}\,\varphi _{p}^{\prime }-\mu _{3}^{2}\,\varphi _{p}=0,\end{aligned}$$
(65c)
$$\begin{aligned}&\varrho _{p}=\frac{1}{\mu _{2}}\,\left( \lambda _{1}\,{\mathcal {A}}_{p} +2\,{\mathcal {B}}_{p}\right) , \end{aligned}$$
(65d)

where \(\mu _{1}\), \(\mu _{2}\), \(\mu _{3}\), and \(\mu _{4}\) are constants arising from the separation of variables. We have four unknown quantities (\({\mathcal {A}}_{p}\), \({\mathcal {B}}_{p}\), \(\varrho _{p}\), and \(\varphi _{p}\)), which are related through the condition given by Eq. (64b), the perturbed 0-1 component of field equations (65a), the perturbed 1-1 component (65b), the linearized scalar field equation (65c), and in addition the perturbed continuity equation (65d). In particular, note that \(\mu _{3}\) has dimensions of reciprocal length, i.e., \(\left[ \mu _{3}\right] =L^{-1}\), as you can see from Eq. (65c).

Similarly, in the Appendix B, we write an equation system for the time evolution of perturbations:

$$\begin{aligned}&\dot{B}_{p}=\frac{1}{2\,\bar{\phi }\,\mu _{1}}\,\left( \dot{\Phi }_{p}- \frac{\dot{\bar{a}}}{\bar{a}}\,\Phi _{p}\right) ,\end{aligned}$$
(66a)
$$\begin{aligned}&\frac{\mu _{2}\lambda _{2}}{2\mu _{1}}\left( 2\frac{\dot{\bar{a}}}{\bar{a}}+ \frac{\dot{\bar{\phi }}}{\bar{\phi }}\right) \left( \frac{\dot{\Phi }_{p}}{\Phi _{p}}- \frac{\dot{\bar{a}}}{\bar{a}}\right) +\frac{\chi \bar{\rho }}{\bar{\phi }}- \frac{1}{2}\left. \frac{dV}{d\phi }\right| _{\phi =\bar{\phi }}\nonumber \\&\quad +\frac{V\left( \bar{\phi }\right) }{2\bar{\phi }}+3\frac{\dot{\bar{a}}}{\bar{a}}\left( \frac{\dot{\Phi }_{p}}{\Phi _{p}}-\frac{\dot{\bar{\phi }}}{\bar{\phi }}\right) -\chi \lambda _{2}\frac{P_{p}}{\Phi _{p}}\nonumber \\&\quad +2\mu _{1}\mu _{3}^{2}\frac{\bar{\phi }B_{p}}{\bar{a}^{2}\Phi _{p}} =\frac{\mu _{3}^{2}}{\bar{a}^{2}},\end{aligned}$$
(66b)
$$\begin{aligned}&\ddot{B}_{p}+\dot{B}_{p}\,\left( 3\,\frac{\dot{\bar{a}}}{\bar{a}}+ \frac{\dot{\bar{\phi }}}{\bar{\phi }}\right) =\frac{\mu _{4}}{2\, \bar{a}^{2}}\,\left( \frac{\Phi _{p}}{\bar{\phi }}-\mu _{1}\,B_{p}\right) ,\end{aligned}$$
(66c)
$$\begin{aligned}&\frac{\ddot{\Phi }_{p}}{\Phi _{p}}+3\,\frac{\dot{\bar{a}}}{\bar{a}}\, \frac{\dot{\Phi }_{p}}{\Phi _{p}}-\frac{1}{3}\,\left. \frac{dV}{d\phi } \right| _{\phi =\bar{\phi }}+\frac{1}{3}\,\bar{\phi }\,\left. \frac{d^{2}V}{d\phi ^{2}}\right| _{\phi =\bar{\phi }}\nonumber \\&\quad +\mu _{2}\,\lambda _{2}\,\dot{\bar{\phi }}\,\frac{\dot{B}_{p}}{\Phi _{p}}-\frac{\chi \,\lambda _{2}}{3}\,\frac{P_{p}}{\Phi _{p}}= \frac{\mu _{3}^{2}}{\bar{a}^{2}},\end{aligned}$$
(66d)
$$\begin{aligned}&\dot{P}_{p}+3\,\frac{\dot{\bar{a}}}{\bar{a}}\,P_{p}+ \mu _{2}\,\bar{\rho }\,\dot{B}_{p}=0. \end{aligned}$$
(66e)

We have four unknown quantities (\(A_{p}\), \(B_{p}\), \(P_{p}\), and \(\Phi _{p}\)) for the time evolution of inhomogeneities, which are fully described by the assumption (64a), the perturbed 0-1, 0-0, 1-1 components of field equations given by Eqs. (66a), (66b), (66c), respectively, the linearized scalar field equation (66d), and the perturbed continuity equation (66e). Note that two equations of the latter list are redundant since the scalar field and continuity equations are not independent of the other field equations.

It should be stressed that the potential \(V\left( \phi \right) \) affects only the time evolution. As a consequence, since the scalar field potential is related to a specific modified \(f\left( R\right) \) model, the time evolution strongly depends on the particular modified gravity model considered, while the radial part of the linearized equations is completely model free. This is a crucial point to identify a peculiar feature of the inhomogeneities evolution in the Jordan frame of \(f\left( R\right) \) gravity through analysis of the radial profiles of perturbations.

Once we have split all field equations in time and radial contributions, we seek linear order solutions separately.

6.2.1 Radial profiles

If we focus on the radial evolution of perturbations, we can solve the respective equation system analytically. More specifically, in solving the differential equation (65c), we obtain the Yukawa behavior for the radial solution of the linearly perturbed scalar field:

$$\begin{aligned} \varphi _{p}\left( r\right) =\frac{\gamma }{r}\,e^{-\mu _{3}\,r}. \end{aligned}$$
(67)

We have set perturbations to vanish at infinity according to the cosmological principle, hence we have only one integration constant \(\gamma \). We recall that \(\left[ \mu _{3}\right] =L^{-1}\), as it can be checked also from Eq. (67). Note that \(\varrho _{p}\left( r\right) \) has the same radial dependence, i.e.

$$\begin{aligned} \varrho _{p}\left( r\right) =\frac{\lambda _{2}\,\gamma }{r}\,e^{-\mu _{3}\,r}, \end{aligned}$$
(68)

in which we considered the assumption given by Eq. (64b).

Consequently, from Eq. (65b), we also get

$$\begin{aligned} {\mathcal {B}}_{p}\left( r\right) =-\frac{\gamma }{\mu _{4}}\,e^{-\mu _{3}\,r}\, \left( \frac{\mu _{4}\,\mu _{1}}{r}+\frac{2\,\mu _{3}^{2}}{r^{2}}+\frac{2}{r^{3}}\right) , \end{aligned}$$
(69)

where we used the solution (67). Finally, we combine Eqs. (65a), (67), and (69) to obtain the scalar perturbation

$$\begin{aligned} {\mathcal {A}}_{p}\left( r\right) =\frac{\gamma }{\lambda _{1}}e^{-\mu _{3}r} \left( \frac{2\mu _{1}+\mu _{2}\lambda _{2}}{r}+\frac{4\mu _{3}^{2}}{\mu _{4}r^{2}}+ \frac{4}{\mu _{4}r^{3}}\right) . \end{aligned}$$
(70)

It should be noted that, in order to satisfy the compatibility between Eqs. (65a), (64b), (65c), (65b), and (65d), we require the following relation

$$\begin{aligned} \mu _{4}=\frac{2\,\mu _{3}^{2}}{3\,\mu _{1}+\mu _{2}\,\lambda _{2}} \end{aligned}$$
(71)

between the constants involved in the set of equations.Footnote 7 In particular, note that \(\left[ \mu _{4}\right] =L^{-2}\), since \(\mu _{3}\) has the dimension of inverse length, and the other constants are dimensionless.

It should be pointed out that the \(f\left( R\right) \) gravity establishes a typical radial scale, \(r_{c}\equiv \mu _{3}^{-1}\), such that local inhomogeneities vanish for \(r\gg r_{c}\) more rapidly than the respective perturbations in the \(\Lambda \)LTB model. For instance, this fact can be shown by comparing the behavior of the perturbed scale factor given in Eq. (53) with the radial profiles of the LTB metric functions in Eqs. (69) and (70). It is important to stress that our result is completely independent of the choice of scalar field potential \(V\left( \bar{\phi }\right) \). Hence these radial solutions apply to any f(R) extended model, providing a remarkable feature of the radial evolution within the Jordan frame of the \(f\left( R\right) \) gravity as compared to GR.

6.2.2 Time evolution

Now we focus on the time evolution of perturbations in the Jordan frame. Clearly, the choice of the background \(f\left( R\right) \) modified gravity model affects the time dependence of inhomogeneities since \(V\left( \bar{\phi }\right) \) appears in almost all equations regarding the time part. Our main result concerns the peculiarity of the radial profiles of perturbations in the Jordan frame, which does not depend on a specific modified gravity model. Here, we merely want to prove the existence of at least one stable time solution.

To solve numerically the equation system given by Eqs. (64a), (66a), (66e), (66d), (66b), (66c), we rewrite it in terms of the dimensionless parameter \(\tau \), defined in Eq. (33). We also recall that \(d/dt\approx H_{0}\,d/d\tau \).

In particular, Eqs. (64a) and (66a) maintain the same form if we write them in terms of \(\tau \) as

$$\begin{aligned} A_{p}\left( \tau \right)&=\lambda _{1}\,B_{p}\left( \tau \right) ,\end{aligned}$$
(72)
$$\begin{aligned} \frac{dB_{p}}{d\tau }&=\frac{1}{2\,\bar{\phi }\left( \tau \right) \,\mu _{1}}\,\left( \frac{d\Phi _{p}}{d\tau }-\frac{1}{\bar{a}}\,\frac{d\bar{a}}{d\tau }\,\Phi _{p}\left( \tau \right) \right) , \end{aligned}$$
(73)

respectively.

Furthermore, the linearized scalar field equation (66d) becomes

$$\begin{aligned}&\frac{1}{\Phi _{p}\left( \tau \right) }\,\frac{d^{2}\Phi _{p}}{d\tau ^{2}}+3\,\frac{1}{\bar{a}\left( \tau \right) }\,\frac{d\bar{a}}{d\tau }\,\frac{1}{\Phi _{p}\left( \tau \right) }\,\frac{d\Phi _{p}}{d\tau }\nonumber \\&\quad -\frac{1}{3}\frac{\Omega _{m0}}{m^{2}}\left. \frac{dV}{d\phi }\right| _{\phi =\bar{\phi }\left( \tau \right) }+\frac{1}{3}\bar{\phi }\left( \tau \right) \frac{\Omega _{m0}}{m^{2}}\left. \frac{d^{2}V}{d\phi ^{2}}\right| _{\phi =\bar{\phi }\left( \tau \right) }\nonumber \\&\quad +\mu _{2}\lambda _{2}\frac{d\bar{\phi }}{d\tau }\frac{1}{\Phi _{p}\left( \tau \right) }\frac{dB_{p}}{d\tau }-\frac{\lambda _{2}\Omega _{m0}\Xi \left( \tau \right) }{\bar{a}^{3}\left( \tau \right) \Phi _{p}\left( \tau \right) }=\frac{\tilde{\mu }_{3}^{2}}{\bar{a}^{2}\left( \tau \right) }. \end{aligned}$$
(74)

We have defined the density contrast \(\Xi \left( \tau \right) \equiv P_{p}\left( \tau \right) /\bar{\rho }\left( \tau \right) \) for linear perturbations. Note also that the quantity \(\tilde{\mu }_{3}\equiv \mu _{3}/H_{0}\) is dimensionless in natural units.

Similarly, Eq. (66b) in terms of \(\tau \) rewrites as

$$\begin{aligned}&\frac{\mu _{2}\lambda _{2}}{2\mu _{1}}\left( \frac{2}{\bar{a}\left( \tau \right) }\frac{d\bar{a}}{d\tau }+\frac{1}{\bar{\phi }\left( \tau \right) }\frac{d\bar{\phi }}{d\tau }\right) \left( \frac{1}{\Phi _{p}\left( \tau \right) }\frac{d\Phi _{p}}{d\tau }\right. \nonumber \\&\quad \left. -\frac{1}{\bar{a}\left( \tau \right) }\frac{d\bar{a}}{d\tau }\right) + \frac{3\,\Omega _{m0}}{\bar{\phi }\left( \tau \right) \,\bar{a}^{3}\left( \tau \right) }\nonumber \\&\quad +\frac{\Omega _{m0}}{2\,m^{2}}\left( \frac{V\left( \bar{\phi }\right) }{\bar{\phi }\left( \tau \right) }-\left. \frac{dV}{d\phi }\right| _{\phi =\bar{\phi }\left( \tau \right) }\right) +\frac{3}{\bar{a}\left( \tau \right) }\frac{d\bar{a}}{d\tau }\nonumber \\&\quad \times \left( \frac{1}{\Phi _{p}\left( \tau \right) }\frac{d\Phi _{p}}{d\tau }-\frac{1}{\bar{\phi }\left( \tau \right) }\frac{d\bar{\phi }}{d\tau }\right) -\frac{3\lambda _{2}\Omega _{m0}\Xi \left( \tau \right) }{\Phi _{p}\left( \tau \right) \,\bar{a}^{3}\left( \tau \right) }\nonumber \\&\quad +2\mu _{1}\tilde{\mu }_{3}^{2}\,\frac{B_{p}\left( \tau \right) }{\Phi _{p}\left( \tau \right) }\,\frac{\bar{\phi }\left( \tau \right) }{\bar{a}^{2}\left( \tau \right) }=\frac{\tilde{\mu }_{3}^{2}}{\bar{a}^{2}\left( \tau \right) }, \end{aligned}$$
(75)

and Eq. (66c) turns into:

$$\begin{aligned}&\frac{d^{2}B_{p}}{d\tau ^{2}}+\frac{dB_{p}}{d\tau }\,\left( \frac{3}{\bar{a}\left( \tau \right) }\,\frac{d\bar{a}}{d\tau }+\frac{1}{\bar{\phi }\left( \tau \right) }\,\frac{d\bar{\phi }}{d\tau }\right) \nonumber \\&\quad =\frac{\tilde{\mu }_{4}}{2\,\bar{a}^{2}\left( \tau \right) }\,\left( \frac{\Phi _{p}\left( \tau \right) }{\bar{\phi }\left( \tau \right) }-\mu _{1}\,B_{p}\left( \tau \right) \right) . \end{aligned}$$
(76)

In the latter equation, we have introduced the dimensionless quantity \(\tilde{\mu }_{4}\equiv \mu _{4}/H_{0}^{2}\) in natural units.

Fig. 5
figure 5

Numerical solutions of linear perturbations in the Jordan frame of \(f\left( R\right) \) gravity in terms of the parameter \(\tau \). Top panel: The difference between the density contrast \(\Xi \) evaluated at a generic \(\tau \) and \(\tau =1\) today represented in units of \(10^{-11}\) and logarithmic scale. Bottom panel: The ratio between the linearly perturbed scalar field \(\Phi _{p}\left( \tau \right) \) and the respective background scalar field \(\bar{\phi }\left( \tau \right) \) in units of \(10^{-13}\)

Finally, considering the definition of the density contrast \(\Xi \left( \tau \right) \) and the background equation (39), it is straightforward to show that the linearly perturbed continuity equation (66e) simply rewrites in terms of \(\tau \) as

$$\begin{aligned} \frac{d\Xi }{d\tau }+\mu _{2}\,\frac{dB_{p}}{d\tau }=0. \end{aligned}$$
(77)

Note that we can use Eq. (77) to reduce the number of unknown quantities in the other field equations (74).

Now we want to solve numerically Eqs. (73) and (74) to obtain \(\Xi \left( \tau \right) \) and \(\Phi _{p}\left( \tau \right) \). In this regard, we fix the values of constants for simplicity \(\mu _{1}=1\), \(\mu _{2}=10^{2}\), \(\lambda _{2}=5\), \(\tilde{\mu }_{3}=1\) and set initial conditions at \(\tau =1\) for inhomogeneities: \(\Xi \left( 1\right) =10^{-5}\), \(\Phi _{p}\left( 1\right) =10^{-12}\), and \(d\Phi _{p}/d\tau \left( 1\right) =0\). These values have been chosen to have weak and slowly varying perturbations and guarantee the existence of a stable numerical solution. Moreover, we use the background numerical solutions for \(\bar{a}\left( \tau \right) \) and \(\bar{\phi }\left( \tau \right) \), and the scalar field potential \(V\left( \bar{\phi }\right) \) for the HS model discussed in Sect. 6.1.

Then, we obtain numerical solutions for \(\Xi \left( \tau \right) \) and \(\Phi _{p}\left( \tau \right) \), which are plotted in Fig. 5. It should be noted that these solutions are stable in time, since inhomogeneous perturbations are dominated by background terms for any \(\tau \).

Once we have obtained \(\Xi \) and \(\Phi _{p}\) numerically, the remaining perturbed quantities \(A_{p}\) and \(B_{p}\) can be easily found by using Eqs. (72) and (77).

7 Conclusions

In this paper, we have analyzed the LTB spherically symmetric solution, linearized over a flat FLRW background, comparing its morphology in GR and \(f\left( R\right) \) modified gravity theories, as viewed in the Jordan frame. In the former case, we have referred to the \(\Lambda \)LTB model, including a matter fluid and a cosmological constant; in the latter model, we have considered the \(f\left( R\right) \) Hu–Sawicki formulation for the dark energy component of the background Universe, in which the cosmic acceleration is driven by the no-Einsteinian geometrical terms if compared it to GR.

We have studied the dynamics in both cosmological scenarios to highlight the peculiarities of these models. To describe spherically symmetric deviations from homogeneity in the late Universe, we have used the separation of variables method to address the partial differential equations system for the first-order perturbation. Then, the radial component of such a reduction procedure has been analytically integrated, while the-time dependent part has required a numerical treatment.

The key difference between the two cosmological models studied in this work concerns the different form of the 0-1 component of the gravitational field equations. Indeed, in the \(\Lambda \)LTB model, this equation (19a) can be easily solved by removing one of the two free metric functions of the problem, hence the LTB metric takes the well-known simplified form (22). On the other hand, within the framework of the \(f\left( R\right) \) gravity in the Jordan frame, the 0-1 component given by Eq. (27a) intrinsically links the metric tensor components to the non-minimally coupled scalar field. Thus, the non-minimally coupling prevents the simplification above unlike GR, and we have to deal with two distinct metric functions \(\alpha \left( t,r\right) \) and \(\beta \left( t,r\right) \) in the LTB metric given by Eq. (18).

Concerning the radial solutions, GR provides only a natural decay of the perturbations for large r values, following a power law, as it emerges from Eq. (53). Differently, in the \(f\left( R\right) \) modified gravity formulation, we obtain the Yukawa-like decaying for the radial perturbations of the scalar functions given by Eqs. (67), (68), (69), and (70). Furthermore, we have employed the \(f\left( R\right) \) HS model to describe the background Universe for comparison with the \(\Lambda \)CDM model, but we could have considered other viable \(f\left( R\right) \) modified gravity models. Indeed, we stress that our main result regarding the Yukawa-like radial perturbations does not depend on the \(f\left( R\right) \) functional form.

It should be noted that Yukawa-like radial profiles are recurring in \(f\left( R\right) \) theories, as evidenced, for instance, in other studies [115,116,117,118] by the presence of Yukawa-like corrections in the Newton potential with consequent implications for the dark matter problem and the flat rotation curves of galaxies.

In this paper, the different morphology of the radial solutions between the \(\Lambda \)LTB model and inhomogeneous \(f\left( R\right) \) cosmology must be regarded as the most relevant signature we fixed about the possibility to adopt the \(f\left( R\right) \) modified gravity scenario to describe the accelerating late Universe via spherically symmetric perturbations over a homogeneous background. In other words, the different radial profiles of local inhomogeneities in the Universe may be possible hints of a theory beyond GR.

For what concerned the time evolution of inhomogeneous perturbations both in the \(\Lambda \)LTB model and in the LTB solution as emerging from the \(f\left( R\right) \) gravity in the Jordan frame, the numerical analysis has allowed us to outline that it is always possible to obtain a non-divergent amplitude of the perturbations as time goes by, according to the reliable idea of a stable homogeneous and isotropic Universe in the near future.

Nevertheless, we are aware that our work has one limitation: the obtained radial solutions clearly diverge in the center of the LTB symmetry, where the observer, i.e., human location, is intended to be set. This feature simply suggests that our solution has a non-perturbative extension from a given large enough radial coordinate up to \(r=0\), which is an important task for future investigations in the late Universe. The present analysis fosters further studies about inhomogeneous cosmology when regarded as a local (non-linear) deformation of the FLRW geometry, as it may be also possibly pointed out by local measurements of the Hubble constant.

The present study may have a relevant impact on the observations of the large-scale structure of the Universe, when forthcoming missions, like the Euclid satellite [119], detect the clumpy galaxy distribution with greater accuracy. The comparison between the \(\Lambda \)CDM model and \(f\left( R\right) \) modified gravity theories through the investigation of spatial inhomogeneities may become a powerful tool to test the robustness of the cosmological concordance model.