1 Introduction

Various astronomical and cosmological observations suggest that the present universe is undergoing a period of an accelerated expansion directly [2,3,4] and indirectly [5,6,7].

It is argued that an unknown hiddenly characteristics sort of energy with large negative pressure is responsible for this accelerating cosmic expansion [8]. This mysterious candidate being incompatible with strong energy condition is dubbed as dark energy. This cosmic behavior can also be explained either by modifying matter part (f(R) gravity, f(T) gravity, f(T) gravity with unusual term [9], scalar-tensor theories [10], etc.) or by modifying geometric part (chaplygin gas [11], quintessence [12], phantom [13], quintom [14], etc.) of the Einstein–Hilbert action. This new set of gravity theories passes several solar system and astrophysical tests successfully [15, 16].

The simple modification of Einstein’s theory of gravity namely f(R)-gravity, as a source of acceleration, was proposed by Capozziello et al. [17] and Carroll et al. [18]. The f(R) model gives sufficient generality to encapsulate some of the basic characteristics of higher-order gravity and yet are rather simple to handle. The modified f(R)-gravity can elucidate the cosmic acceleration without introducing the dark energy component [19,20,21]. In addition, it has been demonstrated that the modified f(R)-gravity can be derived from string/M-theory [22].

One of the unsolved problems in cosmology is the cosmological magnetic field emerging at large scale of the universe observationally [23]. In order to disentangle the origin of the primordial cosmological magnetic field, there are many theoretical explanations, for example, it has been created from the Big Bang like all matters populating the universe [24]. Besides this, such fields might play some roles on the cosmic microwave background radiation. For these reasons, in this paper, the primordial magnetic fields are included in the energy–momentum tensor of the Einstein field equation directly. It is worthwhile mentioning that the cosmological magnetic fields will naturally appear in the universe when the anisotropic cosmological models are taken into account. Hence we would like to consider the problem in an anisotropic background.

Cosmological models are investigated via several powerful tools: exact solutions, phase space [25, 26], \({\mathfrak {B}}\)-function method [27], Noether symmetry approach [28,29,30,31], Beyond Noether symmetry approach (B.N.S.) [32], Noether symmetry approach using CSSS-trick [33], Reconstruction methods [34,35,36,37,38], etc. Recently, a new strategy to the reconstruction of f(R)-gravity models using Raychaudhuri equation has been proposed by Choudhury et al. [1]. In this paper, from the perspective of this new method, we investigate the reconstruction of anisotropic Einstein–Maxwell equation in 1+3 covariant formalism of f(R)-gravity in four modes of evolution: (i) Reconstruction from a negative constant deceleration parameter refereeing to an ever-accelerating universe; (ii) Reconstruction from a constant jerk parameter \(j=1\) which recovers celebrated \(\varLambda \text {CDM}\) mode of evolution; (iii) Reconstruction from a time-variable jerk parameter \(j=Q(t)\); and (iv) Reconstruction from a slowly varying jerk parameter. The two last jerk types for f(T)-gravity has recently been studied by Chakrabarti et al. [39]. Finally, some suggestions for enhancing the method are proposed.

2 The model and basic equations

In this section, the evolution equations of the f(R)-gravity in orthogonally spatially homogeneous 1+3 covariant approach have been set up.

For a given fluid four-velocity vector field \(u^{\mu }\), the projection tensor \(h_{\mu \nu }=g_{\mu \nu }+u_{\mu }u_{\nu }\) projects into the instantaneous rest-space of a comoving observer who, in this paper, is characterized by \(u^{\mu }=(1,0,0,0)\). Indeed, the four-velocity \(u^{\mu }\) is orthogonal to the induce metric \(h_{\mu \nu }\) (i.e. \(h_{\mu \nu }u^{\mu }=0\)).

Introducing the vorticity tensor \(\omega _{\mu \nu }\) (\(\omega _{\mu \nu }=\omega _{[\mu \nu ]}\), \(\omega _{\mu \nu }u^{\nu }=0\)), the symmetric shear tensor \(\sigma _{\mu \nu }\) (\(\sigma _{\mu \nu }=\sigma _{(\mu \nu )}\), \(\sigma _{\mu \nu }u^{\nu }=0\), \({\sigma ^{\alpha }}_{\alpha }=0\)), and the volume expansion \(\varTheta =\nabla _{\alpha }u^{\alpha }\) the first covariant derivative of the four-velocity can therefore be decomposed as

$$\begin{aligned} \nabla _{\mu }u_{\nu }=-u_{\mu }\dot{u}_{\nu }+\omega _{\mu \nu } +\sigma _{\mu \nu }+\frac{1}{3}\varTheta h_{\mu \nu }, \end{aligned}$$
(1)

where \(\dot{u}_{\mu }\), which is defined as \(\dot{u}_{\mu }=u^{\nu }\nabla _{\nu }u_{\mu }\), is the acceleration vector. The last term in (1) is indeed the following difference

$$\begin{aligned} \frac{1}{3}\varTheta h_{\mu \nu }=\varTheta _{\mu \nu }-\sigma _{\mu \nu }, \end{aligned}$$
(2)

where \(\varTheta _{\mu \nu }\) are the components of the volume expansion tensor of the fluid (or the extrinsic curvature) whose its trace (i.e. \(\varTheta \equiv \varTheta _{\mu \nu } h^{\mu \nu }\)) is the rate of the volume expansion parameter namely Hubble parameter.

Relatively to \(u^{\mu }\), the energy-momentum tensor can be decomposed in the form:

$$\begin{aligned} T_{\mu \nu }=\rho u_{\mu } u_{\nu }+2u_{(\nu }q_{\mu )}+p h_{\mu \nu }+\pi _{\mu \nu }, \end{aligned}$$
(3)

where \(\rho \) is the energy density, p is the isotopic pressure, \(q_{\mu }\) is the energy flux (\(q_{\alpha }u^{\alpha }=0\)), and \(\pi _{\mu \nu }\) is the symmetric trace-free anisotropic stress pressure (\(\pi _{\mu \nu }=\pi _{\nu \mu }\), \({\pi ^{\alpha }}_{\alpha }=0\), \(\pi _{\mu \nu }u^{\mu }=0\)).

We start with the gravitational action of \(f(R)\)-gravity of the form:

$$\begin{aligned} S=\int \sqrt{-g}f(R) d^{4}x + \int {\mathscr {L}}_{{\mathscr {M}}} d^{4}x, \end{aligned}$$
(4)

where g is the determinant of metric, f(R) is a function of the Ricci scalar R, and \({\mathscr {L}}_{{\mathscr {M}}}\) stands for the matter fields Lagrangian density. Varying this action with respect to metric tensor \(g^{\mu \nu }\), the Einstein field equations are obtained as follows:Footnote 1

$$\begin{aligned} f^{\prime }(R) R_{\mu \nu }-\frac{1}{2}f(R)g_{\mu \nu }+g_{\mu \nu } \nabla _{\alpha } \nabla ^{\alpha }f^{\prime }(R)-\nabla _{\mu } \nabla _{\nu }f^{\prime }(R)=T^{{\mathscr {M}}}_{\mu \nu }, \end{aligned}$$
(5)

where \(f^{\prime }(R)=\mathrm {d}f/\mathrm {d}R\), and all the subscripts and superscripts run from zero to three (i.e. 0, 1, 2, and 3). Assuming the total energy-momentum tensor, \(T^{{\mathscr {M}}}_{\mu \nu }\), consists of an electromagnetic filed, \(T^{\mathrm{em}}_{\mu \nu }\), and a perfect fluid, \(T^{\mathrm{pf}}_{\mu \nu }\), as two main non-interacting parts, it can therefore be written as

$$\begin{aligned} T^{{\mathscr {M}}}_{\mu \nu }=T^{\mathrm{pf}}_{\mu \nu }+T^{\mathrm{em}}_{\mu \nu }, \end{aligned}$$
(6)

whereFootnote 2

$$\begin{aligned} T^{\mathrm{pf}}_{\mu \nu }=\rho _{m} u_{\mu } u_{\nu }+p_{\mathrm{m}}h_{\mu \nu }, \end{aligned}$$
(7)

and

$$\begin{aligned} T^{\mathrm{em}}_{\mu \nu }=F_{\mu \alpha } {F^{\alpha }}_{\nu } -\frac{1}{4}g_{\mu \nu } F_{\alpha \beta }F^{\alpha \beta }, \end{aligned}$$
(8)

in which \(F_{\mu \nu }\) is the field strength. For a given electric field, \(E_{\mu }\), and magnetic field, \(B_{\mu }\), the field strength \(F_{\mu \nu }\) is defined as

$$\begin{aligned} F_{\mu \nu }=\frac{1}{2}u_{[\mu }E_{\nu ]} +\eta _{\mu \nu \alpha \beta }B^{\alpha }u^{\beta }, \end{aligned}$$
(9)

in which \(\eta _{\mu \nu \alpha \beta }\) is an antisymmetric permutation tensor of space-time with \(\eta _{0123}=\sqrt{-g}\). The energy-momentum tensor of Maxwell field can be recast in the form

$$\begin{aligned} T^{\mathrm{em}}_{\mu \nu }=\rho _{\mathrm{em}}u_{\mu } u_{\nu } +p_{\mathrm{em}} h_{\mathrm{em}}+\pi _{\mathrm{em}}, \end{aligned}$$
(10)

where \(\rho _{\mathrm{em}}\) and \(p_{\mathrm{em}}\) are the energy density and the isotropic pressure of the electromagnetic field, respectively, and they are given by

$$\begin{aligned} \rho _{\mathrm{em}}=3 p_{\mathrm{em}}= \frac{1}{3} \left( E^2 + B^2 \right) , \end{aligned}$$
(11)

and the anisotropic stress is

$$\begin{aligned} \pi _{\mu \nu }= -E_{\mu }E_{\nu }-B_{\mu }B_{\nu }+\frac{1}{3} \left( E^2 + B^2 \right) h_{\mu \nu }. \end{aligned}$$
(12)

In the present paper, we prefer to work with a pure magnetic case (i.e. \(E=0\) and \(B \ne 0\)).

Let us consider the problem in the anisotropic background of the form

$$\begin{aligned} \mathrm {d}s^2 = -\mathrm {d}t^2 + a^2(t) \; \mathrm {d}x^2 + b^2(t) \left( \mathrm {d}y^2 + \mathrm {d}z^2 \right) . \end{aligned}$$
(13)

This line element is known as Locally Rotationally Symmetric Bianchi type-I (LRS B-I). Pursuant to this background geometry, the magnetic fields may have component as \(B_{\mu }=(0; B(t), 0, 0)\).

Defining \(S_{\mu \nu }=\nabla _{\mu } \nabla _{\nu }f^{\prime }\) and using equation (5), the Ricci tensor takes the following form

$$\begin{aligned} R_{\mu \nu }=\frac{1}{f^{\prime }}\left( \frac{1}{2}g_{\mu \nu }f -\left( g_{\mu \nu }g^{\alpha \beta } - g^{\alpha }_{\mu }g^{\beta }_{\nu } \right) S_{\alpha \beta }+ T^{{\mathscr {M}}}_{\mu \nu } \right) . \end{aligned}$$
(14)

Now, utilizing this equation, the Ricci tensor \(R_{\mu \nu }\) can be split into the following forms:

$$\begin{aligned}&R=\frac{1}{f^{\prime }} \left( T^{{\mathscr {M}}}+2f-3S \right) , \end{aligned}$$
(15)
$$\begin{aligned}&R_{\mu \nu }u^{\mu } u^{\nu }=\frac{1}{f^{\prime }} \left( T^{{\mathscr {M}}}_{\mu \nu } u^{\mu } u^{\nu } -\frac{1}{2}f+h^{\mu \nu }S_{\mu \nu } \right) , \end{aligned}$$
(16)
$$\begin{aligned}&R_{\mu \nu }u^{\mu } h^{\nu }_{\alpha }=\frac{1}{f^{\prime }} \left( S_{\mu \nu }u^{\mu }h^{\nu }_{\alpha } - q_{\alpha } \right) , \end{aligned}$$
(17)
$$\begin{aligned}&R_{\mu \nu }h^{\mu }_{\alpha } h^{\nu }_{\beta }=\frac{1}{f^{\prime }} \left( S_{\mu \nu }h^{\mu }_{\alpha } h^{\nu }_{\beta }+\pi _{\alpha \beta } -\left( p+S+\frac{1}{2}f \right) \right) , \end{aligned}$$
(18)

where \(p=p_{\mathrm{tot.}}=p_{\mathrm{m}}+p_{\mathrm{em}}\). In analogous with the Ricci tensor, for the \(S_{\mu \nu }\) one has the following relations:

$$\begin{aligned}&S=-f^{\prime \prime } \left( \ddot{R}+\varTheta \dot{R} \right) -f^{\prime \prime \prime } \dot{R}^{2}, \end{aligned}$$
(19)
$$\begin{aligned}&S_{\mu \nu } u^{\mu } u^{\nu }=f^{\prime \prime } \ddot{R}+f^{\prime \prime \prime } \dot{R}^{2}, \end{aligned}$$
(20)
$$\begin{aligned}&S_{\mu \nu } h^{\mu \nu }=-f^{\prime \prime } \varTheta \dot{R}. \end{aligned}$$
(21)

Therefore, it can be demonstrated that the Raychaudhuri equation in the 1+3 covariant formalism of f(R)-gravity of Bianchi type-I is obtained as

$$\begin{aligned} \dot{\varTheta }+\frac{1}{3}\varTheta ^{2}+2 \sigma ^{2}+\frac{1}{f^{\prime }} \left( \rho -\frac{1}{2}f-f^{\prime \prime }\varTheta \dot{R} \right) =0, \end{aligned}$$
(22)

where \(\rho =\rho _{\mathrm{tot.}}=\rho _{\mathrm{m}}+\rho _{\mathrm{em}}\). Restricting the magnetic field to be aligned along the shear eigenvector, the shear tensor would also diagonal \(\sigma _{\mu \nu }=\mathrm {diag}(\sigma _{11},\sigma _{22},\sigma _{33})\). Pursuant to our background geometry of study (13), it is comfortably deduced that \(\sigma _{11}=-(\sigma _{22}+\sigma _{33})\).Footnote 3 The propagations of matter parts (\(\mathrm {pf}\)/\(\mathrm {m}\) and \(\mathrm {em}\)) and each element of the shear tensor, are then given byFootnote 4

$$\begin{aligned}&{\dot{\rho }}_{\mathrm{m}}+ \left( 1+w\right) \varTheta \rho _{\mathrm{m}}=0; \qquad w=p_{\mathrm{m}}/\rho _{\mathrm{m}}, \end{aligned}$$
(23)
$$\begin{aligned}&\dot{B}+\frac{2}{3}\varTheta B+\sigma _{11}B=0, \end{aligned}$$
(24)
$$\begin{aligned}&{\dot{\sigma }}_{\mu \mu }+\varTheta \sigma _{\mu \mu } +\frac{f^{\prime \prime }}{f^{\prime }}\dot{R}\sigma _{\mu \mu } -\frac{1}{f^{\prime }}\pi _{\mu \mu }=0. \end{aligned}$$
(25)

Using Eq. (22) and its first integral, it can easily be indicated that

$$\begin{aligned} R=2 \dot{\varTheta } +\frac{4}{3} \varTheta ^{2} + 2 \sigma ^{2}. \end{aligned}$$
(26)

This well-known relation is used frequently in this paper.

3 Reconstruction of f(R)-gravity

In flat FRW background (i.e. \(\mathrm {d}s^2 = -\mathrm {d}t^2 + a^2(t)_{\mathrm{FRW}}(\mathrm {d}x^2 + \mathrm {d}y^2 + \mathrm {d}z^2)\)), writing the Taylor expansion of the scale factor down as

$$\begin{aligned} a(t)_{\mathrm{FRW}}&=a_{\mathrm{FRW0}}\bigg \{1+H_{0}(t-t_{0}) -\frac{1}{2} q_{0} H^2_{0}(t-t_{0})^2 \nonumber \\&\quad +\frac{1}{6} j_{0} H^3_{0}(t-t_{0})^3 +\frac{1}{24} s_{0} H^4_{0}(t-t_{0})^4+\cdots \bigg \}, \end{aligned}$$
(27)

some dimensionless parameters, namely the deceleration, q, jerk, j, snap, s, and others, are appeared and they are defined as [40, 41]

$$\begin{aligned} q&=\frac{-\ddot{a}_{\mathrm{FRW}}}{a_{\mathrm{FRW}}} \left( \frac{\dot{a}_{\mathrm{FRW}}}{a_{\mathrm{FRW}}} \right) ^{-2}, \quad j=\frac{\dddot{a}_{\mathrm{FRW}}}{a_{\mathrm{FRW}}} \left( \frac{\dot{a}_{\mathrm{FRW}}}{a_{\mathrm{FRW}}} \right) ^{-3}, \nonumber \\ s&=\frac{\ddddot{a}_{\mathrm{FRW}}}{a_{\mathrm{FRW}}} \left( \frac{\dot{a}_{\mathrm{FRW}}}{a_{\mathrm{FRW}}} \right) ^{-4}, \quad \ldots . \end{aligned}$$
(28)

In (27), \(a_{\mathrm{FRW0}}\) and \(H_{0}\) are the present values of the scale factor and Hubble parameter, respectively. These parameters are a focus of interest because their amounts give important knowledge about the universe. In our anisotropic background geometry, LRS B-I, the relation (27) can be regarded as the Taylor expansion of the average scale factor \(\bar{a}=(a b^{2})^{1/3}\). Consequently, we may rewrite the dimensionless parameters (28) using the extrinsic curvature \(\varTheta \). This make our work easy. Furthermore, in order to reconstruct f(R)-gravity models by (22), we need \(\varTheta \), not a(t) or b(t). Hence, we deal with the rate of volume expansion parameter \(\varTheta \), not the scale factors.

In a spatially homogeneous model the ratio of shear scalar \(\sigma \) to the to expansion scalar \(\varTheta \) is constant: \((\sigma / \varTheta )=\mathrm {const.}\). This may compel the following conditions among the directional Hubble parameters \(H_{a}\) and \(H_{b}\) (\(H_{a}\) along x direction while \(H_{b}\) along y and z directions) and the expansion scalar \(\varTheta \):

$$\begin{aligned} H_{a}=\epsilon _{1} \varTheta , \quad H_{b}=\epsilon _{2} \varTheta , \end{aligned}$$
(29)

where \(\epsilon _{1}\) and \(\epsilon _{2}\) are constant, yielding

$$\begin{aligned} \sigma ^{2}=\frac{(\epsilon _{1}-\epsilon _{2})^2}{3} \varTheta ^{2}, \end{aligned}$$
(30)

as we expect (because \((\sigma /\varTheta )=(|\epsilon _{1} -\epsilon _{2}|/\sqrt{3})=\mathrm {const.}\)). This physical relation makes our work easy in the calculations. It is important to mention that the special case \(\sigma =0\) implies \(\epsilon _{1} =\epsilon _{2}=(1/3)\) meaning an isotropic background – FRW.

Note that according to (30), the rate of \(\sigma \) and \(\varTheta \) would be equal since \((\dot{\sigma }/\sigma )=(\dot{\varTheta }/\varTheta )\).

Pursuant to observational data, it has been demonstrated in [37, 42] that \(|\epsilon _{1}-\epsilon _{2}| /\sqrt{3}\) is of order \(10^{-10}\).

3.1 A constant deceleration parameter (an accelerating universe)

As the first example, let us focus on the acceleration epoch of the universe. This feature of the universe can be determined by the deceleration parameter q – for an accelerating universe \(q<0\) and for a decelerating universe \(q>0\). For the aforementioned purpose, a constant deceleration parameter as

$$\begin{aligned} q=-|m|; \quad m \in \{(-1,0) \cup (0,+1)\}, \end{aligned}$$
(31)

is our start point in this part. Writing the deceleration parameter in terms of the extrinsic curvature as

$$\begin{aligned} q=-1-3 \frac{\dot{\varTheta }}{\varTheta ^{2}}, \end{aligned}$$
(32)

and combining it with (31), yields

$$\begin{aligned} \varTheta =\left( \frac{3}{1-|m|}\right) \frac{1}{t-t_{0}}, \end{aligned}$$
(33)

where \(t_{0}\) is an integration constant which we must take it as an initial time (i.e. at all times of interest \(t_{0}<t\)) in order to keep expanding phase of the universe (i.e. if \(t_{0}<t\) then we have \(\varTheta >0\)). Using the average scale factor \(\bar{a}\), the average Hubble parameter \(\bar{H}\), and the \({\mathfrak {B}}\text {-function}\) [27], one has

$$\begin{aligned} {\mathfrak {B}}[\bar{a},0;\bar{H}(\bar{a})] =b^{\frac{\epsilon _{1}+2\epsilon _{2}}{3\epsilon _{2}}} \frac{\dot{\varTheta }}{\varTheta }, \end{aligned}$$
(34)

for this case. According to (31) we get

$$\begin{aligned} -1<{\mathfrak {B}}[\bar{a},0;\bar{H}(\bar{a})]<0. \end{aligned}$$
(35)

According to Ref. [27], this era is an accelerated era with non-phantom-like regime property. The limited amounts \(-1\) and 0 correspond to the inflection point namely shifting from a decelerated to an accelerated expansion (i.e. an expansion with constant rate) and de Sitter era/expansion, respectively. It is worthwhile to mention that the left bound, \(-1\), is equivalent to \(m=0\) and \(w_{\mathrm{eff.}}=-1/3\) and the right bound, 0, is equivalent to \(|m|=1\) and \(w_{\mathrm{eff.}}=-1\). Note that we have used the well-known definition

$$\begin{aligned} w_{\mathrm{eff.}}=\frac{p_{\mathrm{eff.}}}{\rho _{\mathrm{eff.}}}. \end{aligned}$$
(36)

in which \(\rho _{\mathrm{eff.}}\) and \(p_{\mathrm{eff.}}\) are given by

$$\begin{aligned} \rho _{\mathrm{eff.}}&= \left[ \frac{2\epsilon _{1}\epsilon _{2} +\epsilon ^{2}_{2}}{\left( \epsilon _{1} +2\epsilon _{2} \right) ^{2}} \right] \varTheta ^{2}, \end{aligned}$$
(37)
$$\begin{aligned} -p_{\mathrm{eff.}}&= \left[ \frac{\epsilon ^{2}_{1}+\epsilon _{1}\epsilon _{2} +4\epsilon ^{2}_{2}}{2\left( \epsilon _{1}+2\epsilon _{2} \right) ^{2}} \right] \varTheta ^{2} +\left[ \frac{\epsilon _{1}+3 \epsilon _{2}}{2\left( \epsilon _{1} +2\epsilon _{2} \right) } \right] \dot{\varTheta }, \end{aligned}$$
(38)

whence we get

$$\begin{aligned} w_{\mathrm{eff.}} = \frac{2|m|+1}{-3}. \end{aligned}$$
(39)

It is worth mentioning that this relation is also deducible from the relation

$$\begin{aligned} w_{\mathrm{eff.}} = -1-2\frac{\dot{\varTheta }}{\varTheta ^{2}}, \end{aligned}$$
(40)

and Eq. (33).

Fig. 1
figure 1

This figure demonstrates the possible orders of R produced by constant parameters

Using (26), (30), and (33) in (22) one arrives at:

$$\begin{aligned} R^{2}f^{\prime \prime }+l_{1}Rf^{\prime }+l_{2}f=l_{3}\rho , \end{aligned}$$
(41)

where

$$\begin{aligned} l_{1}&=\frac{m}{2(1-m)}+\frac{(\epsilon _{1}-\epsilon _{2})^{2}}{(1-m)}, \end{aligned}$$
(42)
$$\begin{aligned} l_{2}&=\frac{-3 \gamma }{4(1-m)}, \qquad l_{3}=\frac{-3 \gamma }{2(1-m)}, \end{aligned}$$
(43)

in which

$$\begin{aligned} \gamma =\frac{1}{3}\left\{ 2(m-1)+2(\epsilon _{1}-\epsilon _{2})^{2}+4 \right\} . \end{aligned}$$
(44)

The total density in (41), \(\rho =\rho _{\mathrm{pf}}+\rho _{\mathrm{em}}\), is given by

$$\begin{aligned} \rho =\rho _{\mathrm{m}}+\rho _{\mathrm{em}} =\underbrace{l_{4}\; R^{v}}_{\mathrm{m-part}} +\underbrace{l_{5}\;R^{n}}_{\mathrm{em-part}} \end{aligned}$$
(45)

where

$$\begin{aligned} l_{4}&=C_{1} \left( \frac{3 \sqrt{\gamma }}{(1-m)} \right) ^{\frac{-3}{1-m}}, \end{aligned}$$
(46)
$$\begin{aligned} l_{5}&=\frac{1}{2} C_{2}^{2} \left( \frac{3 \sqrt{\gamma }}{(1-m)} \right) ^{\frac{6 \beta }{1-m}}, \end{aligned}$$
(47)
$$\begin{aligned} \beta&=\frac{2}{3} \left( 1- \frac{\left| \epsilon _{1} -\epsilon _{2} \right| }{\sqrt{3}} \right) . \end{aligned}$$
(48)
$$\begin{aligned} v&=\frac{3}{2(1-m)}, \end{aligned}$$
(49)
$$\begin{aligned} n&=\frac{3\beta }{(1-m)}. \end{aligned}$$
(50)

in which \(C_{1}\) and \(C_{2}\) are integration constants. Equations (41) and (45) give the form of f(R) as follows:

$$\begin{aligned} f(R)= C_{3} R^{l}+C_{4} R^{k}+l_{8}R^{v}+l_{9}R^{n}, \end{aligned}$$
(51)

where \(C_{3}\) and \(C_{4}\) are integration constants and

$$\begin{aligned} l&=\frac{1-l_{1}}{2}+\frac{\sqrt{l_{1}^{2}-2l_{1} +1-4l_{2}}}{2}, \end{aligned}$$
(52)
$$\begin{aligned} k&=\frac{1-l_{1}}{2}-\frac{\sqrt{l_{1}^{2}-2l_{1} +1-4l_{2}}}{2}, \end{aligned}$$
(53)
$$\begin{aligned} l_{8}&=\frac{-l_{4}}{v^{2}+(l_{1}-1)v+l_{2}}, \end{aligned}$$
(54)
$$\begin{aligned} l_{9}&=\frac{-l_{5}}{n^{2}+(l_{1}-1)n+l_{2}}. \end{aligned}$$
(55)

The terms \(l_{8}R^{v}\) and \(l_{9}R^{n}\) are related to \(\mathrm {m-part}\) and \(\mathrm {em-part}\), respectively. In Fig. 1, the possible powers of R with their generators have been demonstrated for FRW-case. According to (48)–(50), one always has \(n>v\). As is observed, the orders between \((1-\sqrt{3})/2 \approx -0.366\) and \((1+\sqrt{3})/2 \approx + 1.366\) are out of access. The inverse powers of R can be generated only by k-parameter. The positive orders of R (here, greater than 1.366) – so-called higher orders – can be produced by l-parameter. The matter part can only produce the powers greater than 3/2 while the electromagnetic part can generate greater than \(+2\). Therefore, practically, the contribution of both \(\mathrm {m-part}\) and \(\mathrm {em-part}\) lie on higher orders which can also be generated by l-parameter. It means that the feasible orders of R for a vacuum case and a universe filled with matter/electromagnetic/both matter and electromagnetic, are the same. Note that these discussions are valid only for an ever-accelerating universe. It is important to mention that l, k, and n are affected by anisotropic term, while power v, which comes form matter part, is not affected by it. For anisotropic one, the dashed lines in Fig. 1 shift a little (of order \(10^{-10}\)). Beside all these discussions, it is worthwhile mentioning that there is no way to reach Einstein’s theory (i.e. \(f(R)=R\)), and it may back to this point that Einstein’s theory does not lead to an ever-accelerating universe.

As is clear, from the mathematical viewpoint, all the integration constants and consequently the parameters \(C_{3}\), \(C_{4}\), \(l_{8}\), and \(l_{9}\) can take any complex value in general. Therefore, let us set them to oneFootnote 5 (\(C_{3}=C_{4}=l_{8}=l_{9}=1\)) for simplicity. It means that the participation amplitude of each term of the obtained form of f(R) in (51) has been normalized to \(+1\). In order to compare our plots with the results of Ref. [1], let us take \(|m|=0.5\). As is observed from Fig. 2, the manner of our plots are different than the ones studied in the aforementioned reference either when we consider limited case namely without \(\mathrm {em-part}\) (see figures 2 and 3 in Ref. [1]). The plots are presented for FRW case and note that for the anisotropic one, the plots are shifted so little such that they are not visible (i.e. the total behavior will be unchanged). As we know, from the viability analysis viewpoint, two conditions must be adopted for a f(R)-model: \(f^{\prime }(R)>0\) (for having a positive effective constant of gravitation) and \(f^{\prime \prime }(R)>0\) (for the stability of the model). At low curvature, there will be negative and anomalous parts for \(f^{\prime }\) and \(f^{\prime \prime }\) due to the term \(R^{k}\) as k is always negative. Without loss of generality, one may set \(C_{4}=0\) and remove this term, then both validity conditions are satisfied. If one keeps \(C_{4}\) non-zero, then there will be a lower bound for the evolution range of curvature. For example, in plotting Fig. 2, we kept \(C_{4}\), hence there was a lower bound for curvature for the satisfaction of \(f^{\prime \prime }>0\) as \(R > 0.2411751621\). For this reason, the related plots have been presented for \(R \ge 1\). Keeping \(C_{4} \ne 0\) causes that the growing speed of f(R) be faster than \(f^{\prime }(R)\) and \(f^{\prime \prime }(R)\) as R increases; for example, at \(R=500\) the values of f, \(f^{\prime }\), and \(f^{\prime \prime }\) are of orders \(10^{13}\), \(10^{11}\), and \(10^{8}\), respectively.

Fig. 2
figure 2

This figure demonstrates the plots of f(R) (red color), \(f^{\prime }(R)\) (green color), and \(f^{\prime \prime }(R)\) (blue color) for constant deceleration parameter case at curvature interval [1, 5]

3.2 A constant, a variable, and slowly variable jerk parameters

As is observed from (28), another interesting dimensionless parameter for focusing is the jerk parameter. It is not hard to show that this parameter in terms of the extrinsic curvature can be written as

$$\begin{aligned} j=9 \frac{\ddot{\varTheta }}{\; \varTheta ^{3}}+9\frac{\dot{\varTheta }}{\; \varTheta ^{2}}+1. \end{aligned}$$
(56)

Three types of jerk values are of physical interest:

  1. 1.

    A constant jerk parameter, \(j=1\), which mimics the \(\varLambda \text {CDM}\) model;

  2. 2.

    A variable jerk parameter, \(j=Q(t)\), such that the jerk parameter is proportional to the Hubble parameter by an inverse square relation. Hence, Q(t) may be taken as \(j=Q(t)=\lambda ^{2}/H^{2}\) where \(\lambda \) is an arbitrary non-zero real constant and H is the mean Hubble parameter.

  3. 3.

    A slowly varying jerk parameter.

Since the formulation of two first cases of interest is the same in some parts, hence we first consider these two. The slowly varying case will be considered at the end of this section separately.

The solutions to equation (56) for \(j=1\) and \(j=Q(t)\) cases of interest are as follows:

$$\begin{aligned} \text {Sol-I: }\; \varTheta _{1}&=n\lambda \tanh [\lambda (t-t_{0}) ], \end{aligned}$$
(57)
$$\begin{aligned} \text {Sol-II: }\; \varTheta _{2}&=n\lambda \coth [\lambda (t-t_{0}) ]. \end{aligned}$$
(58)

The special values \(n=2\) and \(n=3\) give \(j=1\) and \(j=\lambda ^{2}/H^{2}\), respectively. Note that both (57) and (58) are a solution to each case with the aforementioned conditions. Therefore, for the first case of interest namely \(j=1\), the parameter \(\lambda \), in the above solutions, is a free constant parameter while for the second case namely \(j=Q(t)\) it is exactly the constant parameter of relation \(j=\lambda ^{2}/H^{2}\).

For (57) and (58) the effective EoS reads

$$\begin{aligned} w_{\mathrm{eff.1}}&=\frac{p_{\mathrm{eff.1}}}{\rho _{\mathrm{eff.1}}} =\frac{-2}{n}\coth ^{2}[\lambda (t-t_{0})]+\frac{2-n}{n}, \end{aligned}$$
(59)
$$\begin{aligned} w_{\mathrm{eff.2}}&=\frac{p_{\mathrm{eff.2}}}{\rho _{\mathrm{eff.2}}} =\frac{-2}{n}\tanh ^{2}[\lambda (t-t_{0})]+\frac{2-n}{n}, \end{aligned}$$
(60)

respectively. Therefore, for the constant jerk case (\(j=1\) or equivalently \(n=2\)), the boundary values will be

$$\begin{aligned}&w_{\mathrm{eff.1}}(t \rightarrow t_{0})=-\infty , \quad w_{\mathrm{eff.1}}(t \rightarrow \infty )=-1; \end{aligned}$$
(61)
$$\begin{aligned}&w_{\mathrm{eff.2}}(t \rightarrow t_{0})=0,\quad w_{\mathrm{eff.2}}(t \rightarrow \infty )=-1, \end{aligned}$$
(62)

and for the variable jerk parameter (\(j=\lambda ^{2}/H^{2}\) or equivalently \(n=3\)), we have

$$\begin{aligned}&w_{\mathrm{eff.1}}(t \rightarrow t_{0})=-\infty , \quad w_{\mathrm{eff.1}}(t \rightarrow \infty )=-1; \end{aligned}$$
(63)
$$\begin{aligned}&w_{\mathrm{eff.2}}(t \rightarrow t_{0})=-1/3, \quad w_{\mathrm{eff.2}}(t \rightarrow \infty )=-1. \end{aligned}$$
(64)

As is clear from (61) and (63), the solution (57) leads to an unacceptable model because it provides an ever-accelerated universe with wrong behavior of \(w_{\mathrm{eff.}}\)s because both \(w_{\mathrm{eff.}}\)s stay in negative region and decay from a high value to \(-1\) and consequently it lacks radiation and matter-dominated eras in the past for both jerk types. However, the amounts of \(w_{\mathrm{eff.}}\)s in (61) and (63), indicate phantom-like regime, but a physical EoS must decrease from positive values (crossing from +1/3 (radiation-dominated era) and 0 (matter-dominated era)) to negative values. Besides these problems, in what follows, it is argued that this type of solution yields an imaginary form for f(R)-gravity which is non-physical. According to (62) and (64) the solution (58) may be called physical as both behaviors of \(w_{\mathrm{eff.}}\)s are in accordance with a part of the (accelerating) evolution of the observed universe with a non-phantom-like regime. A difference between the two is that \(w_{\mathrm{eff.2}}=0\) in (62) indicates matter-dominated era that pursuant to \(w_{\mathrm{eff.2}}=-1\) in (62), it is followed by an accelerating expansion, while for the next case of study the start point of EoS is \(-1/3\) which only refers to an acceleration mode of expansion. This difference may be interpreted as a privilege to \(\varLambda \text {CDM}\) model in comparison with a decaying jerk model. Note that whether the obtained forms of \(\varTheta \) lead to a physical behavior of EoS or not, it is better we study all these cases because they may yield a form of f(R) which may help for giving a model and solving some problems in other subjects of physics (e.g. Inflation). In other words, if an obtained form of f(R) does not work here because of its non-physical outcomes, it may be examined in other models which besides f(R) term there is, for example, a scalar field lagrangian and then it may solve some problems.

For both sets of solutions, (57), (58), the Raychaudhuri equation turns out to be

$$\begin{aligned}&\frac{-2}{n}A_{4}\left( R-2n\lambda ^{2}\right) ^{2}f^{\prime \prime } -2n\lambda ^{2}A_{3}\left( R-2n\lambda ^{2}\right) f^{\prime \prime } \nonumber \\&\quad +n \lambda ^{2} f^{\prime }+A_{3}\left( R-2n\lambda ^{2}\right) f^{\prime }-\frac{1}{2}f+\rho =0 \end{aligned}$$
(65)

where

$$\begin{aligned}&A_{3}=A_{1}/A_{2}, \quad A_{4}=A_{3}/A_{2}, \nonumber \\&A_{1}=\frac{-1}{n}+\frac{1}{3}+\frac{2}{3}(\epsilon _{1}-\epsilon _{2})^2, \nonumber \\&A_{2}=\frac{-2}{n}+\frac{4}{3}+\frac{2}{3}(\epsilon _{1}-\epsilon _{2})^2. \end{aligned}$$

The density in (65) is given by

$$\begin{aligned} \rho =\rho _{\mathrm{m}}+\rho _{\mathrm{em}} \end{aligned}$$
(66)

in which

$$\begin{aligned} \rho _{\mathrm{m}}&=\rho _{\mathrm{m0}} \left[ \epsilon -\epsilon A_{5} \left( R-2n \lambda ^{2} \right) \right] ^{n/2}, \end{aligned}$$
(67)
$$\begin{aligned} \rho _{\mathrm{em}}&=\rho _{\mathrm{em0}} \left[ \epsilon -\epsilon A_{5} \left( R-2n \lambda ^{2} \right) \right] ^{n \left| \beta _{1}\right| }, \end{aligned}$$
(68)

where \(\rho _{\mathrm{m0}}\) and \(\rho _{\mathrm{em0}}\) are constants of integration and

$$\begin{aligned}&A_{5}=\left( n^{2} \lambda ^{2} A_{2} \right) ^{-1}, \end{aligned}$$
(69)
$$\begin{aligned}&\beta _{1}=\frac{2}{3} \left( \frac{\left| \epsilon _{1} -\epsilon _{2} \right| }{\sqrt{3}}-1 \right) , \end{aligned}$$
(70)
$$\begin{aligned}&\left\{ \begin{array}{ll} \text {For solution}~(57) \; \Leftrightarrow \; \epsilon =+1; \\ \text {For solution}~(58) \; \Leftrightarrow \; \epsilon =-1. \end{array}\right. \end{aligned}$$
(71)

3.2.1 The constant jerk case \(j=1\) (\(n=2\))

In this part, we proceed with a constant jerk parameter. Limpidly, four options are of interest:

  • \(\rho _{\mathrm{m}}\ne 0\) and \(\rho _{\mathrm{em}} \ne 0\);

  • \(\rho _{\mathrm{m}}=0\) and \(\rho _{\mathrm{em}} \ne 0\);

  • \(\rho _{\mathrm{m}} \ne 0\) and \(\rho _{\mathrm{em}} = 0\);

  • \(\rho _{\mathrm{m}} = 0\) and \(\rho _{\mathrm{em}} = 0\).

If we keep both densities non-zero, then the analytical solution of Eq. (65) will be a very complicated case in terms of hypergeometric function. More precisely, besides some hypergeometric functions, there are some complicated analytically unsolvable integrals in terms of hypergeometric functions. The same situation is for the pure electromagnetic case (i.e. \(\rho _{\mathrm{m}}=0\) and \(\rho _{\mathrm{em}} \ne 0\)). It means that the electromagnetic part leads to some analytically unsolvable integrals. Nonetheless, I think that we may do a thing: “Solving numerically and then fitting the obtained curve with a suitable function in each interval of interest”. This, however, provides an approximation function to f(R) but it helps for observing the manner of the evolution of f(R) and giving a model for f(R)-gravity. Between two first options, let us proceed with the generalist case namely \(\rho _{\mathrm{m}} \ne 0\) and \(\rho _{\mathrm{em}} \ne 0\). It is needless to consider the second option as well since the solving process for both is the same. Solving Eq. (65) with the conditions

$$\begin{aligned}&f(R=7)=20, \qquad f^{\prime }(R=7)=9.90, \qquad \lambda =\sqrt{3}/2,\nonumber \\&\epsilon =-1,\qquad \rho _{\mathrm{m}}=\rho _{\mathrm{em}}=1/2, \qquad \left| \epsilon _{1}-\epsilon _{2} \right| =\sqrt{3} \times 10^{-10} \end{aligned}$$
(72)

numerically via the Runge–Kutta-Fehlberg 4th order method provides three Figs. 3, 4 and 5. The figures are presented in the curvature interval 7 through 600. As is observed, both conditions \(f^{\prime }(R)>0\) and \(f^{\prime \prime }(R)>0\) are satisfied in this large interval. According to figures, it seems that polynomial function or some forms of exponential function are good candidates for fitting the curve. On the other hand, according to the plot of \(f^{\prime \prime }(R)>0\), the form of f(R) is at least forth order as

$$\begin{aligned} f(R)=c_{0}+c_{1}R+c_{2}(R-c_{3})^2+c_{4}(R-c_{5})^{3}+c_{6}(R-c_{7})^4, \end{aligned}$$
(73)

where \(c_{i}\)s are constants. Now, if we fit the form of f(R) in the curvature interval 10 to 100 polynomially with step 1, we arrive at the form:

$$\begin{aligned} f(R)&=-43.3892391638874 + 7.12150883125319 \; R \nonumber \\&\quad +0.240246117112700 \; R^2 -0.00109345398314376 \; R^3 \nonumber \\&\quad +3.13314951937404 \times 10^{-6} \; R^4+{\mathscr {O}}(R^5). \end{aligned}$$
(74)

Note that the precision of this work depends upon the curvature interval length. Obviously, fitting in a small interval with small step gives a good approximation for the function. We started the interval from 10 instead of 7 because of ignoring some departures observed in the plot of \(f^{\prime \prime }(R)\) (see Fig. 5). Our starting point to numerical analysis was \(R=7\) because (68) and (72) lead to

$$\begin{aligned} \rho _{\mathrm{em}}=\frac{(R-4)^{4/3}}{2}, \end{aligned}$$
(75)

hence, for having physical behavior, the minimum value of curvature is four. According to (74), our approximation type for f(R) looks good for the rest of the interval. It means that at high precision, the form of f(R) would also be a polynomial function.

Fig. 3
figure 3

This figure indicates the behavior of f(R) (obtained from numerical analysis) versus curvature R at curvature interval [7, 600]

Fig. 4
figure 4

This figure demonstrates the plot of \(f^{\prime }(R)\) (obtained from numerical analysis) versus curvature R at curvature interval [7, 600]

Fig. 5
figure 5

This figure indicates the plot of \(f^{\prime \prime }(R)\) (obtained from numerical analysis) versus curvature R at curvature interval [7, 600]. The input figure demonstrates the behavior of \(f^{\prime \prime }(R)\) at low curvature interval [7, 15] with a suitable resolution

Two last options namely \( \{\rho _{\mathrm{m}} \ne 0 \; \& \; \rho _{\mathrm{em}} = 0\}\) and \( \{\rho _{\mathrm{m}} = 0 \; \& \; \rho _{\mathrm{em}} = 0\}\), for FRW case have sufficiently been studied in Ref. [1]. The solution for anisotropic one is not so different than FRW’s solution. Only the constants will vary a little. Hence we do not discuss this case.

3.2.2 The variable jerk case \(j=Q(t)\) (\(n=3\))

In this part, we study a variable jerk parameter. Again, like the constant jerk case, here there are four options of interest.

  • Pure electromagnetic case (\(\rho _{\mathrm{em}} \ne 0\) and \(\rho _{\mathrm{m}} = 0\)):

    For this case, the solution to the Raychaudhuri equation is found as

    $$\begin{aligned} f(R)=2 \rho _{\mathrm{em0}}+ \frac{\rho _{\mathrm{em0}}}{18 \lambda ^{4}} \left( R-6\lambda ^{2}\right) ^{2}+A_{6}\exp \left[ \frac{R-6\lambda ^{2}}{6\lambda ^{2}} \right] \end{aligned}$$
    (76)

    where \(A_{6}\) is a constant of integration. This solution holds for both types of extrinsic curvatures in (57), (58). Note that this solution is obtained for the special case \(\epsilon _{1}=\epsilon _{2}=1/3\) namely FRW. For the anisotropic case, the basic equation yields an analytically unsolvable integral. Hence, it should be solved numerically. But since the order of anisotropy of the universe is so little, hence its solution will not so different than this solution. Indeed, the solution (76) can also be regarded as a curve fitted function to anisotropic one as well. This situation is in three cases in what follows as well. According to the solution (76), both validity conditions \(f^{\prime }(R)>0\) and \(f^{\prime \prime }(R)>0\) are satisfied only by taking \(A_{6}>0\). The behaviors of f, \(f^{\prime }\) and \(f^{\prime \prime }\) in the curvature interval [13, 35] are presented in Figs. 6, 7 and 8 with blue color.

  • Pure matter case (\(\rho _{\mathrm{em}} = 0\) and \(\rho _{\mathrm{m}} \ne 0\)):

    For this case, the solution to the Raychaudhuri equation for \(\epsilon =-1\), which corresponds to (58), is obtained as

    $$\begin{aligned} f(R)&=\left( \frac{-3\rho _{\mathrm{m0}}}{\sqrt{6}}\right) \sqrt{\frac{R-12\lambda ^{2}}{\lambda ^{2}}} +\left( \frac{\rho _{\mathrm{m0}}}{3\sqrt{6}}\right) \left( \frac{R-12\lambda ^{2}}{\lambda ^{2}}\right) ^{3/2} \nonumber \\&\quad +\left[ A_{7}-\left( \frac{27\rho _{\mathrm{m0}}\sqrt{\pi }}{2 \; e} \right) \text {erf} \left( \frac{R-12\lambda ^{2}}{\sqrt{6}\lambda ^{2}}\right) \right] \exp \left[ \frac{R-6\lambda ^{2}}{6\lambda ^{2}} \right] , \end{aligned}$$
    (77)

    where \(A_{7}\) is a constant of integration and e is the base of the natural logarithm, \(e=2.718281828\cdots \), and “ erf ” is the error function.Footnote 6 For the case \(\epsilon =+1\), which corresponds to (57), the corresponded solution yields imaginary form for f(R) which is non-physical, hence we put it aside. As mentioned earlier, the case (57) has further problems as well.

    Because the value of error function in every point is in \(-1 \le \text {erf}(x) \le +1\), hence the last term in (77) is not so strange thing as it can be removed by \(A_{7}\). Furthermore, the last term tends to zero as R increasesFootnote 7 and it means that the effect of this term on the evolution of f(R) is so little such that it may reasonably be ignored. Indeed, the fluctuations and surplusage produced by the last term are practically petty and insignificant.

    As is clear from (77), by taking \(R>12\lambda ^{2}\), both validity conditions (\(f^{\prime }>0 \; and \; f^{\prime \prime }>0\)) are satisfied. For example, three figures are presented for this case in which the constants have been taken as \(A_{7}=\rho _{\mathrm{m0}}=1\); see green plots in Figs. 6, 7 and 8.

  • Both electromagnetic and matter cases (\(\rho _{\mathrm{em}} \ne 0\) and \(\rho _{\mathrm{m}} \ne 0\)):

    In general, this case leads to an integral which is analytically unsolvable. But, by choosing \(\lambda =+1\) and \(\epsilon =-1\), one can arrive at:

    $$\begin{aligned} f(R)&=2\rho _{\mathrm{em0}} +A_{8} \exp \left[ \frac{R-6}{6} \right] +\left( \frac{\rho _{\mathrm{em0}}}{18} \right) \left( R-6 \right) ^{2} \nonumber \\&\quad +\left( \frac{\rho _{\mathrm{m0}}}{108} \right) \left( 6R-72 \right) ^{3/2} +\left( \frac{\rho _{\mathrm{m0}}}{2} \right) \sqrt{6R-72}\nonumber \\&\quad -\left( \frac{3 \sqrt{\pi }\rho _{\mathrm{m0}}}{2} \right) \left( \text {erf}\left[ \frac{\sqrt{6R-72}}{6} \right] \right) \exp \left[ \frac{R-12}{6} \right] , \end{aligned}$$
    (78)

    where \(A_{8}\) is a constant of integration. This solution is like the sum of the solutions of two cases which obtained above. Limpidly, the error function comes from the matter part not electromagnetic. Also, the root of existing the powers 1/2 and 3/2 backs to matter part while the electromagnetic part produces \(+2\) instead.

    However, the behavior of (78) depends upon the selection of constant parameters, but obviously, in general, both validity conditions for (78) are satisfied by taking \(R>12\). Taking start point \(R=13\) and setting \(A_{8}=1\) and \(\rho _{\mathrm{m0}}=\rho _{\mathrm{em0}}=1/2\), three plots have been presented in the interval 13 through 35; see red plots in Figs. 6, 7 and 8.

  • Vacuum case (\(\rho _{\mathrm{em}} = 0\) and \(\rho _{\mathrm{m}} = 0\)):

    For the vacuum case (i.e. \(\rho _{\mathrm{em}} = 0\) & \(\rho _{\mathrm{m}} =0\)) of a varying jerk \(j=Q(t)\), a solution to the Raychaudhuri equation would be

    $$\begin{aligned} f(R)=A_{9} \exp \left[ \frac{R-6\lambda ^{2}}{6\lambda ^{2}} \right] , \end{aligned}$$
    (79)

    where \(A_{9}\) is a constant of integration. This solution is arguable from the last three solutions as the term which does not depend upon the densities is this term. Hence, it is the effect of the vacuum case.

    Clearly, both validity conditions are satisfied only by taking \(A_{9}>0\). Unlike three last cases, here, there is no lowers bound for starting the physical values of curvature according to (79).

    The related plots to this case have been demonstrated by orange color in Figs. 6, 7 and 8.

According to all solutions obtained for \(j=Q(t)\) and their Taylor expansions,Footnote 8 all four f(R)s of this case obviously reduce to Einstein’s theory at so low curvature. Furthermore, at low curvature, f, \(f^{\prime }\), and \(f^{\prime \prime }\) of four options in view of their amounts, satisfy this relation: \(\mathrm {em}\)Footnote 9\(>\mathrm {m+em}\)Footnote 10\(>\mathrm {vacuum}\)Footnote 11\(>\mathrm {m}\)Footnote 12 (see Figs. 6, 7, 8). At high curvature, the arrangement will be changed as \(\mathrm {em}>\mathrm {vacuum}>\mathrm {m+em}>\mathrm {m}\). It means that adding electromagnetic part causes that the amounts of f, \(f^{\prime }\), and \(f^{\prime \prime }\) increase, while adding typical matter/perfect fluid implies that their amounts decrease than vacuum case. In all curvature of interest, f, \(f^{\prime }\), and \(f^{\prime \prime }\) of pure electromagnetic and pure matter cases have the highest and lowest values, respectively. At high curvature, f, \(f^{\prime }\), and \(f^{\prime \prime }\) of vacuum case are greater than the case which contains both matter and electromagnetic while at low curvature, the layout is changed.

Fig. 6
figure 6

This figure demonstrates the plot of f(R) for four options of interest (1- Pure electromagnetic case (blue color); 2- Pure matter case (green color); 3- Both electromagnetic and matter cases (red color); 4- Vacuum case (orange color)) at curvature interval [13, 35]

Fig. 7
figure 7

This figure indicates the plot of \(f^{\prime }(R)\) for four options of interest (1– Pure electromagnetic case (blue color); 2 – Pure matter case (green color); 3 – Both electromagnetic and matter cases (red color); 4 – Vacuum case (orange color)) at curvature interval [13, 35]

Fig. 8
figure 8

This figure demonstrates the plot of \(f^{\prime \prime }(R)\) for four options of interest (1 – Pure electromagnetic case (blue color); 2 – Pure matter case (green color); 3 – Both electromagnetic and matter cases (red color); 4 – Vacuum case (orange color)) at curvature interval [13, 35]

3.2.3 A slowly varying jerk parameter

In this part, a scenario where the jerk parameter is a slowly varying function of redshift z, viz,

$$\begin{aligned} j(z)=1- \eta _{1} F(z), \end{aligned}$$
(80)

where \(\eta _{1}\) is a small constant parameter and F(z) is a slowly varying function of the redshift, is considered. Since j(z) varies slowly with respect to z, hence it is a good approximate that we take \(F(z) \approx F_{0}+F_{1}z\) (\(F_{0}\) and \(F_{1}\) are constant). Therefore, one may easily get

$$\begin{aligned} \dot{\varTheta } \approx \eta _{2} \varTheta ^{2}, \end{aligned}$$
(81)

where \(\eta _{2}\) is a constant. Unlike the previous examples, let us here take perfect fluid in general not only pressureless dust fluid (i.e. \(p_{\mathrm{m}}=w\rho _{\mathrm{m}}\)). For this case, a solution to the Raychaudhuri equation is as follows

$$\begin{aligned} f(R)=\underbrace{\eta _{3} \; R^{\xi _{1}}+\eta _{4} \; R^{\xi _{2}}}_{\mathrm{vacuum \;\;part}}+\underbrace{\eta _{5} \rho _{\mathrm{em0}} \; R^{4|\beta _{1}|}}_{\mathrm{em-part}} +\underbrace{\eta _{6} \rho _{\mathrm{m0}} \; R^{2(1+w)}}_{\mathrm{m-part}} \end{aligned}$$
(82)

where \(\eta _{3}\) and \(\eta _{4}\) are integration constants and

$$\begin{aligned} \xi _{1}&=\frac{-k_{1}+k_{2}+\sqrt{k^{2}_{1}+k^{2}_{2}-2k_{1}k_{2}+2k_{2}}}{2k_{2}}, \end{aligned}$$
(83)
$$\begin{aligned} \xi _{2}&=\frac{-k_{1}+k_{2}-\sqrt{k^{2}_{1}+k^{2}_{2}-2k_{1}k_{2}+2k_{2}}}{2k_{2}} \end{aligned}$$
(84)
$$\begin{aligned} \beta _{1}&=\frac{2}{3}\left( \frac{|\epsilon _{1}-\epsilon _{2}|}{\sqrt{3}}-1 \right) , \end{aligned}$$
(85)
$$\begin{aligned} \eta _{5}&=\frac{-2}{\eta _{8} \eta _{9}}\left[ 8k_{2}w^{2}+\left( 4k_{1}+12k_{2} \right) w +4k_{1}+4k_{2}-1\right] , \end{aligned}$$
(86)
$$\begin{aligned} \eta _{6}&=\frac{-2}{\eta _{8}\eta _{9}}\left[ k_{2}\beta ^{2}_{1} +8k_{1}\left| \beta _{1} \right| -8k_{2}\left| \beta _{1} \right| -1 \right] , \end{aligned}$$
(87)
$$\begin{aligned} k_{1}&=\frac{1}{\eta _{7}}\left[ \eta _{2}+\frac{1}{3} +\frac{2(\epsilon _{1}-\epsilon _{2})^2}{3} \right] , \end{aligned}$$
(88)
$$\begin{aligned} k_{2}&=\frac{-2\eta _{2}}{\eta _{7}}, \end{aligned}$$
(89)
$$\begin{aligned} \eta _{7}&=2\eta _{2}+\frac{4}{3}+\frac{2(\epsilon _{1}-\epsilon _{2})^2}{3}, \end{aligned}$$
(90)
$$\begin{aligned} \eta _{8}&=8k_{2}w^{2}+4k_{1}w+12wk_{2}+4k_{1}+4k_{2}-1, \end{aligned}$$
(91)
$$\begin{aligned} \eta _{9}&=32k_{2}\beta ^{2}_{1}+8k_{1} \left| \beta _{1} \right| -8k_{2} \left| \beta _{1} \right| -1. \end{aligned}$$
(92)

Obviously, the powers related to vacuum part namely \(\xi _{1}\) and \(\xi _{2}\) can take any constant, but it is better we take them positive for the satisfaction of validity conditions. The participation of electromagnetic and perfect fluid are as \(R^{4|\beta _{1}|}\) and \(R^{2(1+w)}\), respectively. Again like previous cases of study, we observe that unlike the matter part term, the power of curvature arisen from the electromagnetic part is affected by the anisotropic background. Note that \(|\beta _{1}| \approx 2/3\) hence the electromagnetic part for this case produces \(R^{8/3}\) (8/3 is the exact value of FRW background). The special cases namely pressureless dust matter (\(w=0\)) generates \(R^{2}\) which is less than the electromagnetic case. Therefore, pursuant to the previous examples and this one, it seems that the electromagnetic case in most cases of interest, generates the higher powers of curvature than perfect fluid/matter case. It is interesting to note that for the dark energy (\(w=-1\)) the power \(2(1+w)\) would be zero, hence it does not produce any power for the curvature. Both perfect fluid and electromagnetic parts satisfy the validity conditions separately. And as a final point, we mention that Einstein’s general relativity theory can be recovered by the terms of the vacuum part or by a matter with the EoS \(w=(-1/2)\).

4 On the enhancement of the method

The presented method has this potential to be applied further. The first generalization is that the inverse road of the method may be adopted to examine a given theory of f(R) according to its emerged outcomes (i.e. behaviors of shear and Hubble, etc.) and comparing them with observational data. But, it seems that in most cases of interest, this application is numerically feasible, not analytically.

According to observational data, the treatment of Hubble, EoS, and etc. are clear. On the other hand, we have Raychaudhuri equation which gives us the form of f(R). Hence, by applying a curve-fitting method to obtained curve from numerical methods, it is feasible to arrive at some forms for f(R) at different stages of the evolution of the universe. This is the second generalization.

Because these tasks are beyond the scope of this paper, hence I do not give an example but pursuant to the first suggestion, I tried for some given forms of f(R) and found that they are only numerically doable.

5 Conclusions

Utilizing Raychaudhuri-based reconstruction strategy suggested by Choudhury et al. [1], the reconstruction of anisotropic Einstein–Maxwell equation in \(1+3\) covariant formalism of f(R)-gravity was investigated. The matter part of the problem was assumed to be a non-interacting combination of a perfect fluid and an electromagnetic field. The model has been reconstructed in four interesting modes of evolution. In summary, some of our findings to these modes were as follows:

  1. 1.

    A constant deceleration parameter (an accelerating universe): The obtained form for f(R) was as:

    $$\begin{aligned} f(R)= C_{3} R^{l}+\frac{C_{4}}{R^{|k|}}+l_{8}R^{v}+l_{9}R^{n}. \end{aligned}$$

    The range of powers was given in Fig. 1. It has been concluded that Einstein’s theory does not emerge from this form because of the domains of powers and it is due to the fact that his theory does not give an ever-accelerating universe. The terms \(l_{8}R^{v}\) and \(l_{9}R^{n}\) in the above form come from matter and electromagnetic parts, respectively. Under the conditions of the problem, one always has \(n>v\) and both contribute at the higher orders of curvature which are also reachable via vacuum case.

  2. 2.

    The constant jerk case \(j=1\) mimicking \(\varLambda \text {CDM}\) model:

    Generally, this case is analytically unsolvable. Hence, we proceed using the Runge–Kutta–Fehlberg 4th order method and (functional) curve-fitting method. The outcome for the generalist case up to fifth order polynomial in some curvature interval was as:

    $$\begin{aligned} f(R)&=-43.3892391638874 + 7.12150883125319 \; R \\&\quad +0.240246117112700 \; R^2 -0.00109345398314376 \; R^3 \\&\quad +3.13314951937404 \times 10^{-6} \; R^4 +{\mathscr {O}}(R^5). \end{aligned}$$
  3. 3.

    The variable jerk case \(j=Q(t)\):

    For this case, four options were of interest: 1- \( \{\rho _{\mathrm{m}}\ne 0 \; \& \; \rho _{\mathrm{em}} \ne 0\}\); 2- \( \{\rho _{\mathrm{m}}=0 \; \& \; \rho _{\mathrm{em}} \ne 0\}\); 3- \( \{\rho _{\mathrm{m}} \ne 0 \; \& \; \rho _{\mathrm{em}} = 0\}\); 4- \( \{\rho _{\mathrm{m}} = 0 \; \& \; \rho _{\mathrm{em}} = 0\}\). The obtained forms to f(R) were respectively as follows:

    $$\begin{aligned} f_{1}(R)&= 2\rho _{\mathrm{em0}} +A_{8} \exp \left[ \frac{R-6}{6} \right] +\left( \frac{\rho _{\mathrm{em0}}}{18} \right) \left( R-6 \right) ^{2} \\&\quad +\left( \frac{\rho _{\mathrm{m0}}}{108} \right) \left( 6R-72 \right) ^{3/2} +\left( \frac{\rho _{\mathrm{m0}}}{2} \right) \sqrt{6R-72}\\&\quad -\left( \frac{3 \sqrt{\pi }\rho _{\mathrm{m0}}}{2} \right) \left( \text {erf}\left[ \frac{\sqrt{6R-72}}{6} \right] \right) \exp \left[ \frac{R-12}{6} \right] ; \\ f_{2}(R)&=2 \rho _{\mathrm{em0}}+ \frac{\rho _{\mathrm{em0}}}{18 \lambda ^{4}} \left( R-6\lambda ^{2}\right) ^{2}+A_{6}\exp \left[ \frac{R-6\lambda ^{2}}{6\lambda ^{2}} \right] ; \\ f_{3}(R)&=\left( \frac{-3\rho _{\mathrm{m0}}}{\sqrt{6}}\right) \sqrt{\frac{R-12\lambda ^{2}}{\lambda ^{2}}} +\left( \frac{\rho _{\mathrm{m0}}}{3\sqrt{6}}\right) \left( \frac{R-12\lambda ^{2}}{\lambda ^{2}}\right) ^{3/2}\\&\quad +\left[ A_{7}-\left( \frac{27\rho _{\mathrm{m0}}\sqrt{\pi }}{2e} \right) \text {erf} \left( \frac{R-12\lambda ^{2}}{\sqrt{6}\lambda ^{2}}\right) \right] \exp \left[ \frac{R-6\lambda ^{2}}{6\lambda ^{2}} \right] ; \\ f_{4}(R)&=A_{9} \exp \left[ \frac{R-6\lambda ^{2}}{6\lambda ^{2}} \right] . \end{aligned}$$

    Pursuant to these forms, reconstruction via variable jerk led to an exponential function of f(R), \(\exp (R-R_{0})\), and the contribution of matter and electromagnetic parts appeared as \( \{(R-R_{0})^{3/2} \; \& \; (R-R_{0})^{1/2} \; \& \; \text {erf}(R-R_{0}) \times \exp (R-R_{0})\}\) and \(\{(R-R_{0})^2\}\), respectively. All these interesting obtained forms at low curvature tend to Einstein’s theory of gravity.

  4. 4.

    A slowly varying jerk parameter with redshift:

    For this case, the form of f(R) found out as

    $$\begin{aligned} f(R)=\eta _{3} \; R^{\xi _{1}}+\eta _{4} \; R^{\xi _{2}} +\eta _{5}\rho _{\mathrm{em0}} \; R^{4|\beta _{1}|}+\eta _{6} \rho _{\mathrm{m0}} \; R^{2(1+w)}. \end{aligned}$$

    The first two terms come from vacuum part while the third and fourth terms arise from the electromagnetic and perfect fluid, respectively. Hence, the participation of the electromagnetic part for FRW is as \(R^{8/3}\). For the pressureless dust matter, the power of curvature will be \(+2\) and for the dark energy, the power of curvature is zero.

    The validity conditions for all f(R)s obtained from four modes of evolution were satisfied (in some cases entirely and in others at special intervals or under specific conditions).

There is a interesting common property among all cases studied in this paper:

Unlike the perfect fluid/matter part, the power of curvature produced by the electromagnetic part is affected by anisotropic property of background. Furthermore, the power of curvature supplied by electromagnetic part is higher than matter/perfect fluid part. For example, for FRW case, some of our findings were as follows:

  • For constant deceleration parameter: \({\mathscr {P}}_{\mathrm{em}} >2\) and \({\mathscr {P}}_{\mathrm{m}}>3/2\);

  • For variable jerk parameter with time: \({\mathscr {P}}_{\mathrm{em}} =2\) and \({\mathscr {P}}_{\mathrm{m}}=3/2 \; and \; 1/2\);

  • For slowly varying jerk parameter with redshift: \({\mathscr {P}}_{\mathrm{em}} =8/3\) and \({\mathscr {P}}_{\mathrm{m}}=2\),

where \({\mathscr {P}}_{\mathrm{em}}\) and \({\mathscr {P}}_{\mathrm{m}}\) refer to the powers of curvatures of the electromagnetic and matter parts, respectively.

Finally, some discussions about the enhancement of the method were done.