1 Introduction

f(R) gravity is one of the modified theories of Einstein’s general relativity that attracted much attention in recent times [16]. In [7] \(f(R) =R+\alpha R^{2}\) with \(\alpha >0\) has been introduced as the model of inflated universe while \(f(R) =R-\alpha /R^{n}\) (\(\alpha >0\), \(n>0\)) was considered as a candidate for the dark energy model [813]. This model, however, is not a viable model for dark energy and instead \(f(R) =R-\alpha R^{n}\) with \(\alpha >0\) and \(0<n<1\) emerged as alternative which has been proposed in [14, 15]. Later on more viable models were studied in [1620]. A detailed review of these models is in [21] (other review papers are in [2225]). Some recent works on solutions in f(R) gravity are [2648]. For \( f(R) =R\), in \(D=4\) dimensional spacetime it coincides with standard general relativity but otherwise it comes with an action that is arbitrarily dependent on the Ricci scalar. Finding exact solutions in this theory with fourth order derivatives of the metric tensor is both important and challenging. Apart from exact analytic solutions there are f(R) models that can only be expressed implicitly in non-polynomial expressions. Each particular model has advantages/disadvantages as far as experimental tests are concerned [4955]. There are even models that lack the Einstein’s R-gravity limit. Among other expectations the UV/IR behaviors at near/far distances, quantum renormalizability with power counting of the counter terms are prominent. At any cost preferring to abide by the classical regime we confine ourselves first to sourceless (vacuum) f(R) models that admits exact integrals. In the last section we extend our discussion to cover external sources such as global monopole [56] and electromagnetic field. Let us add that the equivalence of f(R) gravity to Brans–Dicke (BD) theory (\( \omega =0\)) with a potential has also been highlighted extensively in the past as a transition between Jordan and Einstein frames. In this approach the exact solutions can be generated by adopting scalar field ansatzes which in general brings into the Lagrangian intricate potentials. Our method will be confined entirely to the Jordan frame without reference to the BD field or any scalar potential.

The vacuum of f(R) gravity is known to carry its own curvature sources. By vacuum in this theory is meant the absence of an external energy-momentum tensor \(T_{\mu \nu }\), of any physical source [57]. Carames and Bezarra de Mello in the latter work have considered the spherically symmetric vacuum solutions of f(R) gravity in higher dimensions. We shall rederive most of their results anew together with some additional extensions which we are interested in as we can to develop this further. Addition of external \(T_{\mu \nu }\ne 0,\) no doubt makes the problem technically more complicated, but following the lesson learned from the vacuum/empty solutions of \(f(R) =R\) theory of gravity we will attempt to derive the most general equations and in some specific cases the solutions as well. The D dimensional spherically symmetric line element that we shall consider will be

$$\begin{aligned} \mathrm{d}s^{2}=-A(r) \mathrm{d}t^{2}+\frac{1}{B(r)} \mathrm{d}r^{2}+r^{2}\mathrm{d}\Omega _{D-2}^{2} ,\end{aligned}$$
(1)

in which A(r) and B(r) are metric functions to be determined while \(\mathrm{d}\Omega _{D-2}^{2}\) represents the \(\left( D-2\right) \)-dimensional unit spherical line element. In particular integrals we have the restrictive case \(A(r) =B(r) \) included, but more general cases with \(A(r) \ne B(r) \) must be interesting as well. Beside the metric functions A(r) and B(r) we shall employ a third function denoted by \(F(R) =\frac{\mathrm{d}f(R) }{\mathrm{d}R},\) which characterizes the type of the f(R) gravity. Let us add that not in all cases of f(R) models the explicit form of f(R) can be expressed analytically in terms of the variable R,  the Ricci scalar. Instead, it involves a transcendental part that cannot be inverted in the form of \(r=r(R),\) these are hybrid forms. We add that even these hybrid forms do not prevent us from calculating \(\frac{\mathrm{d}f}{\mathrm{d}R}>0\) and \( \frac{\mathrm{d}^{2}f}{\mathrm{d}R^{2}}>0\), which are crucial terms to determine the absence of ghosts and thermodynamic stability, respectively.

In brief what has been achieved in this paper is to show that the metric functions A(r) and B(r) are related through an integral expression for the function f(R) (or f(r) ). This amounts to the fact that once f(R) is given it acts as a generator to generate a new set of (A(r) , B(r) ) pair. The function A(r) is expressed in terms of B(r) and f(R) and the remaining equation is reduced into a master equation satisfied by B(r) . Once we give an ansatz for f(R) our master equation can be integrated in principle to obtain B(r) . In this manner we can obtain an infinite class of metrics in f(R) gravity generated from an infinite set of f(R). No doubt the dimensionality of spacetime D (\(=d+1\)) also plays a role in the derivation. In particular, we present examples of new black hole solutions in \(D\ge 3,\) by the method described above. We wish to add also that in the reduction process the system of differential equations in f(R) gravity reduce naturally from the fourth order to the second order.

The paper is organized as follows. In Sect. 2 we rederive the f(R) field equations in D dimensions, which is comparable in some sense with [57]. A number of examples to justify the effectiveness of our method are given. Generalization to \(T_{\mu \nu }\ne 0\) is analyzed in Sect. 3. We end our discussion with our conclusions in Sect. 4.

2 The field equations in D dimensions

The D-dimensional vacuum f(R) gravity is represented by the action

$$\begin{aligned} I=\frac{1}{16\pi G}\int \mathrm{d}^{D}x\sqrt{-g}f(R) ,\end{aligned}$$
(2)

in which f(R) is a function of the Ricci scalar R and \(D\ge 3\). Variation of the action I with respect to \(g_{\mu \nu }\) provides the field equations (in the metric formalism)

$$\begin{aligned} FR_{\mu }^{\nu }-\frac{1}{2}f\delta _{\mu }^{\nu }-\nabla ^{\nu }\nabla _{\mu }F+\delta _{\mu }^{\nu }\square F=0 ,\end{aligned}$$
(3)

in which \(F=\frac{\mathrm{d}f}{\mathrm{d}R}\) and \(\square \) is the covariant Laplacian. The general spherically symmetric line element is given by (1) and the field equations (3) are explicitly given by

$$\begin{aligned}&FR_{t}^{t}-\frac{f}{2}+B\left( F^{\prime \prime }+\frac{B^{\prime }F^{\prime }}{2B}\right) +\frac{D_{2}BF^{\prime }}{r}=0, \end{aligned}$$
(4)
$$\begin{aligned}&FR_{r}^{r}-\frac{f}{2}+\frac{BA^{\prime }F^{\prime }}{2A}+\frac{ D_{2}BF^{\prime }}{r}=0 ,\end{aligned}$$
(5)

and

$$\begin{aligned} FR_{\theta }^{\theta }-\frac{f}{2}+\frac{BF^{\prime }}{2}\left( \frac{ A^{\prime }}{A}+\frac{B^{\prime }}{B}+\frac{2D_{3}}{r}\right) +BF^{\prime \prime }=0, \end{aligned}$$
(6)

in which

$$\begin{aligned} R_{t}^{t}= & {} -\frac{1}{4A}\left( B^{\prime }A^{\prime }+2BA^{\prime \prime }- \frac{BA^{\prime 2}}{A}+\frac{2D_{2}BA^{\prime }}{r}\right) , \end{aligned}$$
(7)
$$\begin{aligned} R_{r}^{r}= & {} -\frac{1}{4A}\left( B^{\prime }A^{\prime }+2BA^{\prime \prime }- \frac{BA^{\prime 2}}{A}+\frac{2D_{2}B^{\prime }A}{r}\right) , \end{aligned}$$
(8)

and

$$\begin{aligned} R_{\theta _{i}}^{\theta _{i}}=-\frac{1}{2r^{2}A}\left( rBA^{\prime }+rAB^{\prime }+2D_{3}A\left( B-1\right) \right) , \end{aligned}$$
(9)

for \(1\le i\le D_{2}.\) Herein and in the rest of the paper, \(D_{k}=D-k\), a prime stands for the derivative with respect to r, and \(F=\frac{\mathrm{d}f}{\mathrm{d}R}\). A particular combination of these three equations leads to two equations which are independent of f. The first of Eq. (4) may be written

$$\begin{aligned} 2ABrF^{\prime \prime }+H\left( AB^{\prime }-BA^{\prime }\right) =0, \end{aligned}$$
(10)

which can be integrated to

$$\begin{aligned} A=BH^{2}\exp \left( -2D_{1}\int \frac{F^{\prime }}{H}\mathrm{d}r\right) \end{aligned}$$
(11)

where

$$\begin{aligned} H=rF^{\prime }+D_{2}F\ne 0. \end{aligned}$$
(12)

The second one of Eq. (5) upon considering (11) becomes independent of A too. The closed form of the second equation reduces to a linear equation for B(r),  which is given by

$$\begin{aligned} B^{\prime \prime }+PB^{\prime }+2QB+\frac{2D_{3}}{r^{2}}=0, \end{aligned}$$
(13)

where

$$\begin{aligned} P=\frac{3r}{H}F^{\prime \prime }+\frac{H}{rF}-\frac{2}{r} \end{aligned}$$
(14)

and

$$\begin{aligned} Q=\frac{rF^{\prime \prime \prime }}{H}+\frac{\left( H^{2}-D_{1}rFF^{\prime }\right) F^{\prime \prime }}{FH^{2}}+\frac{F-H}{r^{2}F}. \end{aligned}$$
(15)

Finally, the explicit form of f in terms of r is given by

$$\begin{aligned} f= & {} \frac{2B\left( 2rF^{\prime }+FD_{3}\right) F^{\prime \prime }}{H} \nonumber \\&+\;\frac{2rF^{\prime }\left( rB^{\prime }+D_{3}B\right) -2\left( rB^{\prime }+D_{3}\left( B-1\right) \right) F}{r^{2}}.\nonumber \\ \end{aligned}$$
(16)

To complete our analysis we give the explicit form of the Ricci scalar in terms of r,

$$\begin{aligned} R= & {} -B^{\prime \prime }-\frac{D_{2}\left( 2rB^{\prime }+D_{3}\left( B-1\right) \right) }{r^{2}} \nonumber \\&-\;\frac{2r^{3}BF^{\prime \prime \prime }}{Hr^{2}}+\frac{r^{2}F^{\prime \prime }\left( 3r^{2}B^{\prime }F^{\prime }+FD_{2}\left( 3rB^{\prime }+2BD_{1}\right) \right) }{H^{2}r^{2}}.\nonumber \\ \end{aligned}$$
(17)

In summary, the only equation to be solved is Eq. (13) which is second order and linear for B. Therefore the procedure is reduced to set a f(R)—which eventually represents the form of f(R)—and solve the only equation, Eq. (13), to find \(B\left( r\right) \) and consequently A(r).

2.1 Applications of the method

Before we give certain applications for our formalism we would like to compare our approach with the work of Carames and Bezerra de Mello [57]. The main difference can be seen from the fact that in [57] there are two generating functions (so to say) which are F and Y. In other words Eqs. (16) and (17) of [57] are coupled and one must consider them together to find a solution to the field equations. In our formalism we have only one generating function, which is F, and Eq. (13) is the only equation to be solved. In the following three cases we shall show that for simple cases (\(F=1\) and \(F=1+\alpha r\)) our results overlap with [57] but for more complicated case (\(F=\alpha r^{a}\)) our solution is the general one while the solution given in [57] is a restricted one (look at Eq. (46) in [57] and (35) and (36) in this work).

2.1.1 \(F (r) =1\)

We start with the simplest case, with \(F=1\) or equivalently \(H=D_{2}.\) Definition of \(F=\frac{\mathrm{d}f}{\mathrm{d}R}\) implies

$$\begin{aligned} f=R-2\Lambda , \end{aligned}$$
(18)

in which \(-2\Lambda \) is an integration constant to be interpreted as the cosmological constant. The main equations (11) and (13) admit

$$\begin{aligned} B(r) =A(r) =\left\{ \begin{array}{ll} 1+\frac{C_{1}}{r^{D_{3}}}+C_{2}r^{2}, &{}\quad D>3,\\ C_{1}+C_{2}r^{2}, &{} \quad D=3, \end{array} \right. \end{aligned}$$
(19)

for the integration constants \(C_{1}\) and \(C_{2}\) and consequently

$$\begin{aligned} f(r)= & {} -2C_{2}D_{1}, \\ R= & {} -C_{2}DD_{1},\nonumber \end{aligned}$$
(20)

with

$$\begin{aligned} \Lambda =-\frac{1}{2}D_{2}D_{1}C_{2}. \end{aligned}$$
(21)

Finally the solution becomes

$$\begin{aligned} B\left( r\right) =A(r) =\left\{ \begin{array}{ll} 1-\frac{2M}{D_{3}r^{D_{3}}}-\frac{2\Lambda }{D_{2}D_{1}}r^{2}, &{} D>3,\\ -M-\Lambda r^{2}, &{} D=3, \end{array} \right. \end{aligned}$$
(22)

in which we set

$$\begin{aligned} C_{1}=\left\{ \begin{array}{cc} -\frac{2M}{D_{3}},&{} \quad D>3, \\ -M, &{} \quad D=3, \end{array} \right. \end{aligned}$$

where M is the ADM mass. The solution for \(D>3\) is Schwarzschild de/anti de-Sitter black hole solution and for \(D=3\) it is the BTZ black hole. Let us add that \(f(R) =\xi =\)constant, does not change the nature of the solution for the metric with constant scalar curvature. We note that our results in this section expectedly is the same as Sect. 3.1 in [57].

2.1.2 \(F(r) =1+\alpha r\), with \(\alpha =\) constant

As regards Sect. 3.2 of Ref. [57], we consider \(F^{\prime \prime }(r) =0\) in our general formalism but instead of going through a general D-dimensional solution, we investigate the cases in closed form for f(R). From Eq. (10) with \(F^{\prime \prime }=0\) one obtains \( A=B\) (up to a constant which one can set it unity via a redefinition of time). For an arbitrary D the solution for B may not be possible in a closed form but for specific dimensions we may find.

2.1.2.1 \(D=3\)

In three-dimensional spacetime the solution for B becomes

$$\begin{aligned} B=A=C_{2}r^{2}+C_{1}\left( \alpha r-\frac{1}{2}\right) -C_{1}r^{2}\alpha ^{2}\ln \left( 1+\frac{1}{\alpha r}\right) \end{aligned}$$
(23)

and

$$\begin{aligned} f=-4C_{2}+4C_{1}\alpha ^{2}\ln \left( 1+\frac{1}{\alpha r}\right) -\frac{ 2C_{1}\alpha \left( 1+2\alpha r\right) }{r\left( 1+\alpha r\right) }, \end{aligned}$$
(24)

where \(C_{1}\) and \(C_{2}\) are integration constants with the curvature scalar

$$\begin{aligned} R=-6C_{2}+6C_{1}\alpha ^{2}\ln \left( 1+\frac{1}{\alpha r}\right) -\frac{ C_{1}\alpha \left( 2+9\alpha r+6\alpha ^{2}r^{2}\right) }{r\left( 1+\alpha r\right) ^{2}}. \end{aligned}$$
(25)

The hybrid relation between \(f\left( r(R) ,R\right) \) and R is given by

$$\begin{aligned} f=\frac{2}{3}R-\frac{2C_{1}\alpha }{3r\left( 1+\alpha r\right) ^{3}}. \end{aligned}$$
(26)

Note also that from the foregoing expressions we can identify the cosmological constant by \(C_{2}=-\Lambda \). Furthermore, setting \(\alpha =0\), one recovers the previous example with \(C_{1}\) scaled, which suggests that it is related to the mass of the central object.

2.1.2.2 \(D=4\)

In four dimensions the solution is given by

$$\begin{aligned} B= & {} A=C_{2}r^{2}+\frac{1}{2}+\frac{1}{3\alpha r} \nonumber \\&+\;\frac{C_{1}}{r}\left( 3\alpha r-2-6\alpha ^{2}r^{2}+6\alpha ^{3}\ln \left( 1+\frac{1}{\alpha r}\right) \right) \end{aligned}$$
(27)

with

$$\begin{aligned} f= & {} -6C_{2}-36C_{1}\alpha ^{3}\ln \left( 1+\frac{1}{\alpha r}\right) \nonumber \\&+\;\frac{6\alpha C_{1}\left( -1+6\alpha ^{2}r^{2}+3\alpha r\right) }{r^{2}\left( 1+\alpha r\right) }+\frac{2\alpha r+1}{r^{2}} \end{aligned}$$
(28)

and

$$\begin{aligned} R= & {} -12C_{2}-72C_{1}\alpha ^{3}\ln \left( 1+\frac{1}{\alpha r}\right) \nonumber \\&+\;\frac{6\alpha C_{1}\left( -1+6\alpha ^{2}r^{2}+6\alpha r\right) \left( 1+2\alpha r\right) }{r^{2}\left( 1+\alpha r\right) ^{2}}+\frac{1}{r^{2}}. \end{aligned}$$
(29)

We see clearly the role of \(C_{2}=-\frac{\Lambda }{3}\) and we wish to proceed with \(C_{1}=0\), which implies

$$\begin{aligned} B=A=-\frac{\Lambda }{3}r^{2}+\frac{1}{2}+\frac{1}{3\alpha r}, \quad \alpha \ne 0, \end{aligned}$$
(30)

so that

$$\begin{aligned} f=R+2\alpha \sqrt{R-4\Lambda }-2\Lambda . \end{aligned}$$
(31)

This is a black hole solution with a singularity at \(r=0\) such that

$$\begin{aligned} R=\frac{1}{r^{2}}+4\Lambda . \end{aligned}$$
(32)

If we set \(\Lambda =0,\) with \(\alpha <0\) we may introduce a horizon for the solution located at

$$\begin{aligned} r_{h}=\frac{2}{3\left| \alpha \right| }, \end{aligned}$$
(33)

while for \(\alpha >0\) the solution possesses a naked singularity at \(r=0\). To complete our investigation let us determine the absence of ghosts and thermodynamic stability of the explicit f(R) found in (31). We see that \( \frac{\mathrm{d}f}{\mathrm{d}R}=1+\frac{\alpha }{\sqrt{R-2\Lambda }}\) and \(\frac{\mathrm{d}^{2}f}{\mathrm{d}R^{2} }=-\frac{\alpha }{2\left( R-2\Lambda \right) ^{3/2}}\). Clearly both conditions cannot be satisfied simultaneously.

2.1.3 \(F(r) =\alpha r^{a}\)

Our next example is a power-law form for f(R),  i.e.,

$$\begin{aligned} F=\alpha r^{a}, \end{aligned}$$
(34)

with constants \(\alpha \) and a, which upon using (11) yields

$$\begin{aligned} A=r^{\frac{2a\left( a-1\right) }{a+D_{2}}}B. \end{aligned}$$
(35)

Substituting into (13) one finds

$$\begin{aligned} B= & {} C_{1}r^{-\frac{2a^{2}-6a+6+\left( 2a-5\right) D+D^{2}}{a+D_{2}}}+C_{2}r^{ \frac{2\left( D_{2}+2a-a^{2}\right) }{a+D_{2}}} \nonumber \\&+\;\frac{D_{3}\left( a+D_{2}\right) ^{2}}{\left( 2a^{2}-6a+6+\left( 2a-5\right) D+D^{2}\right) \left( D_{2}+2a-a^{2}\right) },\nonumber \\ \end{aligned}$$
(36)

in which \(C_{1}\) and \(C_{2}\) are the integration constants. Using A and B we also find

$$\begin{aligned} f=\frac{2\alpha C_{2}D_{1}\left( a-1\right) \left( D_{2}+2a\right) r^{\frac{ a\left( D-a\right) }{a+D_{2}}}}{a+D_{2}}+\frac{2a\alpha D_{1}D_{3}r^{a-2}}{ D_{2}+2a-a^{2}} \end{aligned}$$
(37)

and

$$\begin{aligned} R=\frac{C_{2}D_{1}\left( D-a\right) \left( D_{2}+2a\right) }{\left( a+D_{2}\right) r^{\frac{2a\left( a-1\right) }{a+D_{2}}}}-\frac{ aD_{1}D_{3}\left( a-2\right) }{\left( D_{2}+2a-a^{2}\right) r^{2}}. \end{aligned}$$
(38)

We also note that although \(\alpha \) and a are two arbitrary constants a must satisfy \(a\ne -D_{2}\), \(1\pm \sqrt{D_{1}}.\) It is remarkable to observe that in Sect. 3.3.2 of [57] the same ansatz for F has been considered but the solutions to the field equations (see Eq. (46)–(49) of [57]) are not the same as what we found here is more general. As a matter of fact our solutions (35)–(38) with \(C_{2}=0\) reduce to their solutions. This shows that reducing the field equations into a master equation with a single generating function makes advances in finding exact solutions in f(R) gravity.

In \(D=3\) dimensions the solution becomes rather specific since the last term vanishes for all values of a. The functions then read

$$\begin{aligned} A= & {} r^{\frac{2a\left( a-1\right) }{a+1}}B, \end{aligned}$$
(39)
$$\begin{aligned} B= & {} C_{1}r^{\frac{-2a^{2}}{1+a}}+C_{2}r^{\frac{2\left( 1+2a-a^{2}\right) }{a+1}}, \end{aligned}$$
(40)
$$\begin{aligned} f= & {} \frac{4\alpha C_{2}\left( 2a^{2}-a-1\right) }{a+1}r^{\frac{a\left( 3-a\right) }{a+1}}, \end{aligned}$$
(41)

and

$$\begin{aligned} R=\frac{2\left( 2a+1\right) \left( a-3\right) C_{2}}{a+1}r^{\frac{2a\left( 1-a\right) }{a+1}}. \end{aligned}$$
(42)

This is nothing but the solution found by Zhang, Liu and Li in [58] with their parameters

$$\begin{aligned} p=-\frac{2a\left( 1-a\right) }{a+1} \end{aligned}$$
(43)

and

$$\begin{aligned} kL=-\frac{2\left( 2a+1\right) \left( a-3\right) C_{1}}{a+1}. \end{aligned}$$
(44)

Note that

$$\begin{aligned} f\sim R^{\frac{\left( 3-a\right) }{2\left( 1-a\right) }}, \end{aligned}$$
(45)

which yields \(f\sim R^{2}\) for the specific choice \(a=\frac{1}{3}\).

For \(D\ge 4\) one may set \(C_{2}=0\) and therefore

$$\begin{aligned} B= & {} C_{1}r^{-\frac{2a^{2}-6a+6+\left( 2a-5\right) D+D^{2}}{a+D_{2}}} \nonumber \\&+\;\frac{D_{3}\left( a+D_{2}\right) ^{2}}{\left( 2a^{2}-6a+6+\left( 2a-5\right) D+D^{2}\right) \left( D_{2}+2a-a^{2}\right) }\nonumber \\ \end{aligned}$$
(46)

with an analytic relation for f(R) given by

$$\begin{aligned} f=\bar{\alpha }R^{1-\frac{a}{2}}, \end{aligned}$$
(47)

in which \(\bar{\alpha }\) is a constant which can be set to unity (by a fine choice of \(\alpha \)). In the case of \(a=0\) the theory gives R gravity. The solution is a black hole with a singularity at \(r=0.\) Let us also add that with \(C_{1}=0\) and \(a=1\) the solution reduces to

$$\begin{aligned} \mathrm{d}s^{2}=-\xi \mathrm{d}t^{2}+\frac{1}{\xi }\mathrm{d}r^{2}+r^{2}\mathrm{d}\Omega _{D_{2}}^{2}, \end{aligned}$$
(48)

in which

$$\begin{aligned} \xi =\frac{D_{3}}{D_{2}} \end{aligned}$$
(49)

with

$$\begin{aligned} R=\frac{D_{3}}{r^{2}} \end{aligned}$$
(50)

and

$$\begin{aligned} f=\sqrt{R}. \end{aligned}$$
(51)

This represents a global monopole-type solution with a deficit angle. Another interesting setting is for \(a=-2\) and \(C_{2}=0\), by which upon making a proper choice of \(\alpha \) one finds

$$\begin{aligned} f(R) =R^{2}, \end{aligned}$$
(52)

and the solution becomes

$$\begin{aligned} B(r) =C_{1}r^{-\frac{DD_{9}+26}{D_{4}}}-\frac{D_{3}D_{4}^{2}}{ \left( DD_{9}+26\right) D_{10}}, \end{aligned}$$
(53)

while

$$\begin{aligned} A(r) =r^{\frac{12}{D_{4}}}B(r) . \end{aligned}$$
(54)

Clearly \(D=10\) and \(D=4\) are excluded. \(D=4\) is not allowed directly from (10) where \(H=0\) with \(F=\frac{\alpha }{r^{2}}\) demanding \(AB=0\), which is not acceptable. For \(D=10\) the particular solution can be obtained: we have

$$\begin{aligned} B=C_{2}-\frac{C_{1}}{6r^{6}}-\frac{7}{3}\ln r \end{aligned}$$
(55)

and

$$\begin{aligned} f=-\frac{4\alpha \left( 9C_{2}-7-21\ln r\right) }{r^{4}} \end{aligned}$$
(56)

with the Ricci scalar

$$\begin{aligned} R=\frac{98+168\ln r-72C_{2}}{r^{2}}. \end{aligned}$$
(57)

The metric function \(A\left( r\right) \) follows accordingly from (11), it is given in (54).

We comment that \(f=\bar{\alpha }R^{1-\frac{a}{2}}\) does not satisfy \(\frac{\mathrm{d}f }{\mathrm{d}R}>0\) and \(\frac{\mathrm{d}^{2}f}{\mathrm{d}R^{2}}>0\) simultaneously unless we set a to be negative (Note that \(\bar{\alpha }=1\) is needed to have the Einstein gravity recovered.). For instance with \(\bar{\alpha }=1\) and \(a=-2\), which implies \(f=R^{2},\) and both conditions are satisfied.

2.1.4 A new black hole solution in \(D=3\)

In [58] where \(f(R) =R^{d+1}\) in three-dimensional spacetime with \(d=const\). has been studied, the solution does not cover the case \(d=-\frac{1}{2}\), which makes \(f(R) =\sqrt{R}\). This can be seen from Eq. (12) of [58] and Eq. (45) (note that \(\frac{3-a}{ 2\left( 1-a\right) }=\frac{1}{2}\) has no answer) and in that paper both do not cover the case \(f(R) =\sqrt{R}\). However, in the following we wish to show that the solution \(f(R) =\sqrt{R}\) can easily be obtained in three dimensions. To do so let us consider

$$\begin{aligned} F(r) =\beta r\exp \left( \alpha r\right) \end{aligned}$$
(58)

with \(\alpha \) and \(\beta \) two real constants. This yields

$$\begin{aligned} A= & {} \frac{C_{1}}{r}+C_{2}r^{2}, \end{aligned}$$
(59)
$$\begin{aligned} B= & {} \left( \frac{C_{1}}{r}+C_{2}r^{2}\right) \exp \left( -2\alpha r\right) , \end{aligned}$$
(60)
$$\begin{aligned} f= & {} 2\alpha \beta \left( \frac{C_{1}}{r}+4C_{2}r^{2}\right) \exp \left( -\alpha r\right) , \end{aligned}$$
(61)

and

$$\begin{aligned} R=4\alpha \left( \frac{C_{1}}{4r^{2}}+C_{2}r-\frac{3C_{2}}{2\alpha }\right) \exp \left( -2\alpha r\right) . \end{aligned}$$
(62)

Note that \(C_{1}\) and \(C_{2}\) are two integration constants such that \( C_{2}\) effectively plays the role of a cosmological constant. The solution is a black hole with a horizon located at \(r_{h}=\left( \frac{-C_{1}}{C_{2}} \right) ^{1/3}\) with the condition that \(\frac{-C_{1}}{C_{2}}>0.\) Also from R we see that the solution is singular if and only if \(C_{1}\ne 0.\) In the sequel we are interested in \(C_{2}=0\), which makes the solution rather simple but singular. Accordingly the forms of f and R are given by

$$\begin{aligned} f= & {} 2\alpha \beta C_{1}\frac{\exp \left( -\alpha r\right) }{r}, \end{aligned}$$
(63)
$$\begin{aligned} R= & {} \alpha C_{1}\left( \frac{\exp \left( -\alpha r\right) }{r}\right) ^{2}, \end{aligned}$$
(64)

by which upon tuning the free parameter \(\beta \) by \(4\alpha \beta ^{2}C_{1}=1\) the form of f becomes

$$\begin{aligned} f=\sqrt{R}. \end{aligned}$$
(65)

Here \(\alpha \) and \(C_{1}\) are positive constants and the line element finally reads

$$\begin{aligned} \mathrm{d}s^{2}=-\frac{r_{0}}{r}\mathrm{d}t^{2}+\frac{r}{r_{0}\exp \left( -2\alpha r\right) } \mathrm{d}r^{2}+r^{2}\mathrm{d}\theta ^{2} \end{aligned}$$
(66)

in which \(r_{0}=\frac{1}{4\alpha \beta ^{2}}\) is also a positive constant.

2.1.5 A general class of solutions in \(2+1\) dimensions

In three dimensional spacetime in addition to what we found by now, we wish to show that there exist an important class of solutions yet to be discovered. This specific class, however, is a characteristic feature of only three dimensions. To see this solution let us set \(D=3\) in (13) which yields

$$\begin{aligned}&r^{2}F\left( rA^{\prime }-2A\right) F^{\prime \prime } \nonumber \\&\quad -r\left[ \left( rA^{\prime \prime }-A^{\prime }\right) F+\left( rA^{\prime }-2A\right) F^{\prime }\right] \left( rF^{\prime }+F\right) =0\nonumber \\ \end{aligned}$$
(67)

where we substituted B(r) by A(r) using (11) i.e.,

$$\begin{aligned} B=\frac{Ae^{4\int \frac{F^{\prime }}{rF^{\prime }+F}\mathrm{d}r}}{\left( rF^{\prime }+F\right) ^{2}}. \end{aligned}$$
(68)

Equation (67) possesses a trivial solution for A(r) irrespective of the form of f(R) , which is given by

$$\begin{aligned} A(r) =C_{0}r^{2} \end{aligned}$$
(69)

in which \(C_{0}\) is an integration constant. In this situation the field equations are all satisfied provided B(r) and A(r) satisfy the condition (68) i.e.,

$$\begin{aligned} B=\frac{C_{0}r^{2}e^{4\int \frac{F^{\prime }}{rF^{\prime }+F}\mathrm{d}r}}{\left( rF^{\prime }+F\right) ^{2}}. \end{aligned}$$
(70)

One can see easily that with \(F=\xi =\)constant we obtain

$$\begin{aligned} B=\frac{C_{0}}{\xi ^{2}}r^{2}. \end{aligned}$$
(71)

The solution given by (69), (71), and

$$\begin{aligned} f(R) =\eta +\xi R \end{aligned}$$
(72)

with \(\eta =\mathrm{const.},\) constitutes a particular class. Note that since the choice of f(R) in (70) is arbitrary this can be used to generate an infinite class of solutions. This will not be searched any further here.

2.1.6 \(3+1\)-dimensional black hole solution in \(f(R) =R+2\alpha \sqrt{R}\) gravity

Previously we found an exact solution for the model of gravity in the form

$$\begin{aligned} f(R) =R+2\alpha \sqrt{R} \end{aligned}$$
(73)

with \(\alpha \ne 0\). The solution to the field equations is given by

$$\begin{aligned} A(r) =B(r)=\frac{1}{2}+\frac{1}{3\alpha r} \end{aligned}$$
(74)

with

$$\begin{aligned} R=\frac{1}{r^{2}}. \end{aligned}$$
(75)

The solution is a black hole solution with \(\alpha <0\) and therefore one may write

$$\begin{aligned} \mathrm{d}s^{2}=-\frac{1}{2}\left( 1-\frac{r_{+}}{r}\right) \mathrm{d}t^{2}+\frac{\mathrm{d}r^{2}}{ \frac{1}{2}\left( 1-\frac{r_{+}}{r}\right) }+r^{2}\mathrm{d}\Omega ^{2}, \end{aligned}$$
(76)

in which the horizon is shown as \(r_{+}.\) A change of variables of the form \( t=\sqrt{2}T,\) \(r=\frac{\rho }{\sqrt{2}}\) reduces (76) to

$$\begin{aligned} \mathrm{d}s^{2}=-\left( 1-\frac{\rho _{+}}{\rho }\right) \mathrm{d}T^{2}+\frac{\mathrm{d}\rho ^{2}}{1- \frac{\rho _{+}}{\rho }}+\frac{1}{2}\rho ^{2}\mathrm{d}\Omega ^{2}, \end{aligned}$$
(77)

which is the Schwarzschild black hole with a deficit angle caused by a cosmic string.

3 Generalization to f(R) gravity coupled to matter sources

In this section we extend our vacuum analysis to the presence of matter coupled with gravity. Therefore the action becomes

$$\begin{aligned} I=\int \mathrm{d}^{D}x\sqrt{-g}\left( \frac{1}{16\pi G}f(R) +\mathcal {L} _{m}\right) \end{aligned}$$
(78)

in which \(\mathcal {L}_{m}\) is the matter Lagrangian density. The field equations become

$$\begin{aligned} FR_{\mu }^{\nu }-\frac{1}{2}f\delta _{\mu }^{\nu }-\nabla ^{\nu }\nabla _{\mu }F+\delta _{\mu }^{\nu }\square F=8\pi GT_{\mu }^{\nu } \end{aligned}$$
(79)

with \(T_{\mu }^{\nu }=\mathrm{diag}\left( -\rho ,p,q,q\right) \) the energy-momentum tensor of the matter source. The line element is going to be a spherically symmetric as (1) and without going through the details of the field equations, we give the changes in the field equations (11) and (13). The field equation corresponding to Eq. (11) reads

$$\begin{aligned} A=BH^{2}\exp \left( -2\int \left( \frac{D_{1}F^{\prime }}{H}-\frac{\left( \rho +p\right) }{BH}\right) \mathrm{d}r\right) , \end{aligned}$$
(80)

while the main Eq. (13) i.e. the master equation for B(r) takes the form

$$\begin{aligned} B^{\prime \prime }+\left( P+\frac{r\left( p+\rho \right) }{HB}\right) B^{\prime }+2QB+2S+\frac{2r^{2}\left( \rho +p\right) }{H^{2}B}=0\nonumber \\ \end{aligned}$$
(81)

in which P, Q, and H are given in (14), (15), and (12), respectively, and

$$\begin{aligned} S=\frac{D_{3}}{r^{2}}+\frac{\left( p-q\right) }{F}-\frac{\left( D_{1}F^{\prime }-rF^{\prime \prime }\right) \left( \rho +p\right) }{H^{2}}. \end{aligned}$$
(82)

Note that, unlike the source-free case, here the master B equation is not a linear equation. It can also be observed that the particular choice of \( \rho +p=0\) removes the non-linearity in the B Eq. (81). Further choice of \(p=q\) leaves us with the same equation for B as in the sourceless case. Yet with \(q\ne 0,\) the source shows itself in the \(\Psi \) function as given in the sequel.

The closed form of f is given by

$$\begin{aligned} f=-2q+\frac{1}{r^{2}A}\Psi \end{aligned}$$
(83)

where

$$\begin{aligned} \Psi =2r^{2}ABF^{\prime \prime }+\left[ BrA^{\prime }+\left( rB^{\prime }+2BD_{3}\right) A\right] rF^{\prime } \nonumber \\ -F\left[ BrA^{\prime }+\left( rB^{\prime }+2\left( B-1\right) D_{3}\right) A\right] . \end{aligned}$$
(84)

The foregoing expressions are not very impressive unless we provide concrete examples. This is our aim in the following section.

3.1 Applications

3.1.1 \(3+1\)-dimensional global monopole coupled to \(f=R+2\alpha \sqrt{R}\) modified gravity

One immediate application of Eq. (81) is the extension of the \(f=R+2\alpha \sqrt{R}\) in \(3+1\)-dimensional vacuum to the gravity coupled to the global monopole [56] whose energy-momentum at very large distance is given by (we assume \(A=B\) in the line element)

$$\begin{aligned} T_{\mu }^{\nu }=\mathrm{diag}.\frac{\eta ^{2}}{r^{2}}\left[ 1,1,0,0\right] \end{aligned}$$
(85)

in which \(\eta \) represents the global monopole charge. The solution for the metric is given by

$$\begin{aligned} A=B=\frac{1}{2}+\frac{\left( 2\eta ^{2}+1\right) }{3\alpha r} \end{aligned}$$
(86)

with

$$\begin{aligned} R=\frac{1}{r^{2}} \end{aligned}$$
(87)

and

$$\begin{aligned} F(r) =1+\alpha r. \end{aligned}$$
(88)

Again we must have \(\alpha \ne 0\) and in the limit \(\eta =0\) one recovers the vacuum solution.

3.1.2 \(2+1\)-dimensional Maxwell electric field coupled to f(R) gravity

Let us consider now the Maxwell electric field to be coupled to f(R) gravity in \(2+1\) dimensions. Using the line element (1) and the standard Maxwell Lagrangian together with \(F=1+\alpha r\) one finds

$$\begin{aligned} T_{\mu }^{\nu }=\mathrm{diag}.\frac{Q^{2}}{r^{2}}\left( -1,-1,1\right) \end{aligned}$$
(89)

in which Q is the electric charge. The solution with small \(\alpha \) up to first order simply reads

$$\begin{aligned} A= & {} B\simeq 2Q^{2}\left( 2\alpha r-1\right) \ln r \nonumber \\&+\;2\alpha \left( Q^{2}+M\right) r-M+C_{2}r^{2}+\mathcal {O}\left( \alpha ^{2}\right) \end{aligned}$$
(90)

and

$$\begin{aligned} f\simeq R+2C_{2}+\frac{4Q^{2}\alpha }{r}+\mathcal {O}\left( \alpha ^{2}\right) \end{aligned}$$
(91)

with

$$\begin{aligned} R\simeq & {} -6C_{2}+\frac{2Q^{2}}{r^{2}} \nonumber \\&-\;\frac{4\alpha }{r}\left( 4Q^{2}+M+2Q^{2}\ln r\right) +\mathcal {O}\left( \alpha ^{2}\right) . \end{aligned}$$
(92)

Clearly by setting \(\alpha =0\) one recovers the charged BTZ black hole with cosmological constant \(\Lambda =C_{2}\). We add that the solution when the energy-momentum tensor of the matter source is of the form of a fluid, one should consider it as an interior solution. Therefore one has to make sure that the Israel junction conditions are satisfied at the interface between exterior and interior solutions [59]. In two examples we studied here, the energy-momentum tensors are long-range fields which allow us to consider our solutions to be exterior.

4 Conclusion

The integrability of f(R) vacuum gravity with spherical/circular symmetry is reduced first to a set of master relations, i.e., Eq. (11) and a master equation for \(B\left( r\right) \), i.e., Eq. (13). Given any ansatz generating function \(F=\frac{\mathrm{d}f}{\mathrm{d}R}\) in terms of the coordinate r, our method generates a solution pair of \(A\left( r\right) , B\left( r\right) \) and a solution for the function f(R). Most of our solutions encountered are of hybrid nature, that is, f(R) cannot be expressed explicitly in terms of R. The power-law form for instance, of the form \(f(R) \sim R^{k}\), with a rational number k, is obtained easily in our method. Some of the solutions presented as applications are already known. Yet, new and rare types of solutions can also easily be obtained. In the second part of the paper, we extend the integrability of the vacuum case to the non-vacuum f(R) theories. For this case we found also a master relation, i.e., Eq. (80) and a master equation, i.e., Eq. (81). Considering f(R) to be the generating function for our formalism and \(T_{\nu }^{\mu }=\mathrm{diag}\left[ -\rho ,p,q,q\right] \) to be our energy-momentum tensor one finds a solution to the master equation (81). We presented two examples. In the first example we set \(F=1+\alpha r\) with a global monopole coupled to gravity in \(3+1\) dimensions. The second example considers the Maxwell electric field coupled to gravity in \(2+1\) dimensions with the same generating function. In this case we found the solutions approximately for small \(\alpha \). Let us also add that among the few examples we have studied we found some closed form of f(R) such as \(f(R) =R+2\alpha \sqrt{ R-2\Lambda }-2\Lambda \) and \(f(R) =\bar{\alpha }R^{1-\frac{a}{2}}\). We found that the first one cannot satisfy the conditions for the absence of ghosts and thermodynamic stability simultaneously, while the second one for specific a does satisfy the conditions. Finally it will be in order to state that our method of reduction for the spherically symmetric f(R) gravity has a large scope as far as solutions are concerned. Physical implications of the solutions obtained, such as a dark matter connection, are not considered in the present study. An extension of our formalism to problems with different symmetries, such as stationary axial symmetry, requires a separate investigation.