1 Introduction

Modified theories of gravity with the presence of higher-order curvature terms have been introduced in a attempt to describe the early and late cosmological history including the early time inflation and the late time acceleration. Another motivation to study such theories is for understanding the presence of dark matter and the confrontation between gravity theories and the recent observations [1,2,3,4]. On more theoretical grounds, higher-order corrections to the Einstein–Hilbert term lead to a renormalizable and thus quantizable gravitational theory [5]. Therefore, modified theories of gravity with higher-order corrections, provide a deeper understanding of general relativity (GR). The presence of high curvature correction terms in GR provides some interesting physical results, for examples, it makes the condensation harder to be formed in holographic superconductivity [6, 7]; it modifies the low-energy tensor perturbation spectrum in string backgrounds [8]; and it influences the dynamics of stellar structure [9].

At very early times, to avoid restricting the gravitational Lagrangian to be only a linear function of R, variable modified theories of gravity that contain some of the four possible second-order curvature invariants were proposed with the effects of quadratic Lagrangians. Besides, one particular class of models that includes higher order curvature invariants as functions of the Ricci scalar is the f(R) gravity model [10,11,12,13,14,15,16,17,18,19]. Although such theories exclude contributions from any curvature invariants other than R, they could also avoid the Ostrogradsk’s instability [20] which proves to be problematic for general higher derivative theories [21]. Considering the gravitational collapse, one would expect all the matter present to be absorbed by the black hole, so the final state should be vacuum except for the presence of electromagnetic fields associated with the black hole. Therefore, it is of great interest to study the stationary black hole solutions in Maxwell-f(R) theory, which describe how the nonlinearity of f(R) guides and affects the contribution of Maxwell field on the geometry.

Although it is well known that the black hole solutions in GR are also solutions in many modified gravity theories, including a large class of f(R) gravity [22], the black hole solutions in modified gravity theories that differ from the solutions in GR can be used to distinguish different modified gravity theories or give the constraints on parameters of the models by gravitational waves or shadows. Therefore the searching for exact solutions in the f(R) theory of gravity is important but challenging because the equations of motion are very complicated with higher order terms.

Nevertheless a lot of exact and numerical solutions are obtained by various of methods, including the method of Lagrange multiplier [23] and the so-called generator method [24]. Firstly the most simple case is a special class of f(R) gravity with constant curvature, the solutions of which (including Schwarzschild-like [22], RN-like [25, 26] and Kerr-Newman-like solutions [27]) differ from GR solutions only by a constant coefficient \(f'(R_0)\) that however can be absorbed into the Newton’s constant. While the solutions with dynamic curvatures [22, 23] have real distinctions with the solutions in GR. Besides, static spherically symmetric solutions with perfect fluid [28], Yang–Mills field [29], nonlinear Yang–Mills field [26, 30], Maxwell field and non-linear electromagnetic fields [31,32,33,34] are also obtained. By Noether symmetries, axially symmetric solutions can be derived from exact spherically symmetric solutions [35]. In addition, an interesting correspondence between the solutions in Einstein-conformally invariant Maxwell theory and the solutions in f(R) gravity without matter field in arbitrary dimensions is shown in [36, 37]. Furthermore, the spherically symmetric vacuum solutions in f(R) gravity in higher dimensions were studied in [24, 38].

In this work, considering a spherically symmetric metric ansatz with \(g_{tt}g_{rr}=-1\), without specifying the form of the function f(R), we obtain exact charged black hole solutions in general D-dimensional f(R) gravity. Constraining the parameters of the general solution we get polynomial solutions which reveal some interesting properties when compared with RN black holes. We then focus on the \((3+1)\)-dimensions, where the form of f(R) can be solved explicitly from the polynomial solution and we discuss in details the thermodynamics of this solution studying the First-Law, entropy, Hawking temperature and heat capacity.

The work is organized as follows. In Sect. 2 we discuss the general D-dimensional solution. In Sect. 3 we show that for \(c_2=0\) the general solution can reduce to RN black hole in D-dimensions in Einstein gravity and to the known charged black hole solutions with constant curvature in f(R) gravity. While for \(c_1=-1\) we can obtain new charged D-dimensional solutions, which can reduce to the spherically symmetric vacuum solutions discussed in [24, 38]. In Sect. 4 we study the polynomial solution in D-dimensions. In Sect. 5 we find the corresponding equivalent theories in scalar–tensor gravity. In Sect. 6 we study the thermodynamics of the black hole solution in \((3+1)\)-dimensions. Finally Sect. 8 are our conclusions.

2 General solution in D-dimensions (\(D\ge 3\))

We consider a D-dimensional action

$$\begin{aligned} I=\int d^D x\sqrt{-g}\left[ \frac{1}{2\kappa }\left( R+f(R)-2\Lambda \right) -\frac{1}{2}F_{\mu \nu }F^{\mu \nu }\right] ~,\nonumber \\ \end{aligned}$$
(1)

which, except for the Ricci scalar R, includes a general function of f(R) that is not specified, a Maxwell field and a cosmological constant \(\Lambda \).

In this paper we use \(\kappa =8\pi G=1\). By variation of the above action we obtain the field equations

$$\begin{aligned}&I_{\mu \nu }\equiv R_{\mu \nu }\left( 1+f_R\right) -\frac{1}{2}g_{\mu \nu }\left( R+f(R)-2\Lambda \right) \nonumber \\&\qquad +\left( g_{\mu \nu }\square -\nabla _\mu \nabla _\nu \right) f_R-\kappa T_{\mu \nu } = 0~, \end{aligned}$$
(2)
$$\begin{aligned}&\nabla _{\mu }F^{\mu \nu }=0, \end{aligned}$$
(3)

where

$$\begin{aligned} f_R\equiv & {} \frac{df(R)}{dR}~, \end{aligned}$$
(4)
$$\begin{aligned} T_{\mu \nu }= & {} -\frac{1}{2}g_{\mu \nu }F+2F_{\mu \sigma }{F_\nu }^\sigma ~, \end{aligned}$$
(5)
$$\begin{aligned} F_{\mu \nu }= & {} \partial _\mu A_\nu -\partial _\nu A_\mu ~,\end{aligned}$$
(6)
$$\begin{aligned} A_a= & {} h(r)(dt)_a~. \end{aligned}$$
(7)

We consider a metric ansatz with \(g_{tt}g_{rr}=-1\) that contains only one unknown function B(r)

$$\begin{aligned} ds^2=-B(r)dt^2+\frac{1}{B(r)}dr^2+r^2d\Omega _k^2~, \end{aligned}$$
(8)

where

$$\begin{aligned} d\Omega _k^2=\left\{ \begin{array}{l@{\quad }r} d\theta _1^2+\sum \limits _{i=2}^{D-2}\prod \limits _{j=1}^{i-1}\sin ^2 \theta _j d\theta _i^2 &{} k=1~, \\ d\theta _1^2+\sinh ^2{\theta _1}d\theta _2^2+\sinh ^2{\theta _1}\sum \limits _{i=3}^{D-2}\prod \limits _{j=2}^{i-1}\sin ^2 \theta _j d\theta _i^2 &{} k=-1~, \\ \sum \limits _{i=1}^{D-2}d\theta _i^2 &{} k=0~, \\ \end{array} \right. \end{aligned}$$
(9)

represents the line element of a \((D-2)\)-dimensional Einstein manifold with positive (\(k=1\)), negative (\(k=-1\)), or zero (\(k=0\)) curvature.

In GR, with or without the Maxwell field, assuming a general spherically symmetric metric ansatz, we can get the RN BH or Schwarzschild BH with the resultant relation \(g_{tt} g_{rr}=-1\). However, in general modified gravity theories the relation \(g_{tt} g_{rr}=-1\) is not a necessary result and the resulting solutions are expected to be more complicated. In f(R) theories, it is difficult to get exact solutions for a general metric ansatz. Therefore, in order to get exact solutions we assume this special form of the metric. Another motivation to consider the specific form \(g_{tt} g_{rr}=-1\) of the metric, is to be able to compare the resulting exact solutions with the RN black holes in GR and study what is the effect of the f(R) function on the known solutions in GR. In fact as we will discuss in the following content, in \((3+1)\)-dimensions we obtained an exact charged black hole with the form \(f(R)=2\alpha \sqrt{R-4\Lambda }\) of the f(R) function and we found some interesting properties when we compared them with RN black holes.

The non-zero components of the Einstein equation under the metric ansatz (8) are

$$\begin{aligned} I_t^t= & {} \frac{1}{4 r}\left[ -2 r f_R(r) B''(r)-2 r B''(r)-2 (D \right. \nonumber \\&\left. -2) B'(r)\left( 1+ f_R(r)\right) +2 r B'(r) f_R'(r)\right. \nonumber \\&\left. +4 (D-2) B(r) f_R'(r)+4 r B(r) f_R''(r)\right. \nonumber \\&\left. -2 r f(r)+r h'(r)^2+4 \Lambda r-2 r R(r)\right] =0~, \end{aligned}$$
(10)
$$\begin{aligned} I_r^r= & {} \frac{1}{4 r}\left[ -2 r f_R(r) B''(r)-2 r B''(r)-2 (D\right. \nonumber \\&\left. -2) B'(r)\left( 1+ f_R(r)\right) +2 r B'(r) f_R'(r)\right. \nonumber \\&\left. +4 (D-2) B(r) f_R'(r)-2 r f(r)+r h'(r)^2\right. \nonumber \\&\left. +4 \Lambda r-2 r R(r)\right] =0~, \end{aligned}$$
(11)
$$\begin{aligned} I_{\theta _1}^{\theta _1}= & {} -\frac{1}{4 r^2}\left[ -4 r \left( r B'(r) f_R'(r)+B(r) \left( (D-2) f_R'(r)\right. \right. \right. \nonumber \\&\left. \left. \left. +r f_R''(r)\right) \right) +2 r^2 (f(r)-2\Lambda +R(r))\right. \nonumber \\&\left. +4 (f_R(r)+1) \left( r B'(r)+(D-3) (B(r)-k)\right) \right. \nonumber \\&\left. +4 r B(r) f_R'(r)+r^2 h'(r)^2\right] =0~,\end{aligned}$$
(12)
$$\begin{aligned} I_{\theta _i}^{\theta _i}= & {} I_{\theta _1}^{\theta _1}~, \end{aligned}$$
(13)

where \(f(r) \equiv f\left( R(r)\right) \) and

$$\begin{aligned} R(r)=-\frac{r^2 B''(r)+2 (D-2) r B'(r)+(D-3) (D-2) (B(r)-k)}{r^2} \end{aligned}$$
(14)

is the Ricci scalar expressed by the metric function B(r) and its derivatives \(B'(r)\) and \(B''(r)\).

The equation \(I_t^t-I_r^r=0\) can lead to a simple relation

$$\begin{aligned} B(r)f_R''(r)=0~, \end{aligned}$$
(15)

which gives

$$\begin{aligned} f_R(r)=c_1+c_2 r~, \end{aligned}$$
(16)

where \(c_1\) and \(c_2\) are integration constants. Since \(f_R=f'(R)\) this relation becomes

$$\begin{aligned} f'(R)= & {} c_1+c_2 r(R)~, \end{aligned}$$
(17)

which is solved as

$$\begin{aligned} f(R)= & {} c_1 R+c_2\int ^R r(R)dR~. \end{aligned}$$
(18)

Now the integration constants \(c_1, c_2\) in the relation (18) play the role of parameters of the function f(R) as \(c_1\) is a dimensionless coefficient of the linear part of the function, while the parameter \(c_2\) is the coefficient of the nonlinear part of the function that has dimension \(\left[ c_2\right] =L^{-1}\). The physical meaning of these parameters will be discussed in the following.

Therefore when \(c_1\) and \(c_2\) are small this theory can be considered as a small perturbation of the Einstein gravity. The relation (18) is one of the central relations in our work.

Besides, the t component of the electromagnetic field equation gives

$$\begin{aligned} (D-2) h'(r)+r h''(r)=0~, \end{aligned}$$
(19)

from which we can solve

$$\begin{aligned} h(r)=\left\{ \begin{array}{l@{\quad }r} -\frac{q }{(D-3)r^{D-3}}+\phi _0 &{} D>3~, \\ q \ln {r}+\phi _0 &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(20)

where q and \(\phi _0\) are integration constants.

Using the Eq. (20) we can find that the parameter q is proportional to the charge Q

$$\begin{aligned} Q= & {} \frac{1}{4\pi }\int _S \ ^* F_{ab}=\frac{1}{8\pi }\int _S F^{ab}\varepsilon _{abc_1 c_2 \ldots c_{D-2}} \nonumber \\= & {} \frac{1}{4\pi } \int _S h'(r)\sqrt{-g}d\theta _1 d\theta _2 \ldots d\theta _{D-2} \nonumber \\= & {} \frac{q}{4\pi } \omega _{D-2}~, \end{aligned}$$
(21)

where \(\omega _{D-2}\) is the volume of the unit \((D-2)\)-dimensional spherical (\(k=1\)), hyperbolic (\(k=-1\)) and flat (\(k=0\)) horizons. For \(k=1\), we choose sphere \(S^{D-2}\) topology while for \(k=0\) we consider hypertorus \({\mathbb {T}}^{D-2}={\mathbb {R}}^{D-2}/{\mathbb {Z}}^{D-2}\) then

$$\begin{aligned} \omega _{D-2}=\left\{ \begin{array}{l@{\quad }r} \frac{2\pi ^{\frac{D-1}{2}}}{\Gamma \left( \frac{D-1}{2}\right) } &{} k=1~, \\ \left( 2 \pi \right) ^{D-2} &{} k=0~. \end{array} \right. \end{aligned}$$
(22)

However for \(k=-1\) there is a vast set of distinct compact manifolds that are difficult to calculate even for \(D=4\) [39].

Substituting the expressions of \(f_R(r)\) and h(r) into the Einstein equations, we have two independent equations with two unknown functions f(r) and B(r),

$$\begin{aligned} I_t^t= & {} c_2 \left[ B'(r)+\frac{(D-2) B(r)}{r}\right] - \frac{c_2}{2} B'(r) \nonumber \\&-\frac{1}{2r}(c_1+c_2 r+1) \left[ r B''(r)+(D-2) B'(r)\right] \nonumber \\&+\frac{q^2}{4 r^{2 (D-2)}}-\frac{1}{2}\left[ f(r)-2\Lambda +R(r)\right] =0~, \end{aligned}$$
(23)
$$\begin{aligned} I_{\theta _1}^{\theta _1}= & {} -\frac{1}{4 r^2}\left\{ 4 c_1 r B'(r)+4 r B'(r)+2 (c_1+1) (D\right. \nonumber \\&\left. -3) B(r)-4(D-3)\left( c_1+1+c_2 r\right) k +\frac{q^2}{r^{2(D-3)}}\right. \nonumber \\&\left. +2 r^2 f(r)-4 \Lambda r^2+2 r^2 R(r)\right\} =0~, \end{aligned}$$
(24)

which contain both \(D>3\) and \(D=3\) cases. We solve f(r) from \(I_{\theta _1}^{\theta _1}=0\),

$$\begin{aligned} f(r)= & {} \frac{2 \left\{ (D-3) \left[ -(c_1+1) B(r)+\left( c_1+c_2 r+1\right) k\right] -(c_1+1) r B'(r)\right\} }{r^2}\nonumber \\- & {} \frac{q^2}{2 r^{2 (D-2)}}+2\Lambda -R(r)~, \end{aligned}$$
(25)

and put it back into \(I_t^t=0\), then a simple second order differential equation with respect to the metric function B(r) is obtained

$$\begin{aligned}&(c_1+c_2 r+1) \left[ r^2 B''(r)+2 (D-3)k\right] \nonumber \\&\qquad +r B'(r) \left[ (c_1+1) (D-4)+c_2 r(D-3)\right] \nonumber \\&\qquad - 2 B(r) \left[ (c_1+1) (D-3)+c_2 r(D-2)\right] \nonumber \\&\quad =q^2 r^{2(3-D)}~, \end{aligned}$$
(26)

from which we get the general exact solution in D-dimensions (\(D>3\)) for the metric function B(r)

$$\begin{aligned} B(r)= & {} -\left\{ 3Dr^6\Gamma (D+2)\left( c_1+1\right) ^2\left[ -q^2 \left( 2 D^2 \right. \right. \right. \nonumber \\&\left. \left. \left. -7 D+6\right) r^{-2 D} \Gamma (2 D-2) _2F_1^*\left( 1,2 (D-1);2 D \right. \right. \right. \nonumber \\&\left. \left. \left. -1;-\frac{c_1+1}{r c_2}\right) \right. \right. \nonumber \\&+c_2^4 \ln \left| \frac{c_2 r+c_1+1}{c_2 r}\right| \left( 2 (D-3) k \left( c_2 D r \right. \right. \nonumber \\&\left. \left. +c_1 (D-2)-3 c_2 r+D-2\right) +q^2 (D-2) r^{6-2 D}\right) \nonumber \\&\quad \left. 2 r^{-8}(3-2 D)^2 (D-3) k \Gamma (D+1)\, _2 \right. \nonumber \\&\left. \quad F_1\left( 1,D+1;D+2;-\frac{c_1+1}{r c_2}\right) \right] \nonumber \\&-\left[ (D-3) r^D \left( 2 k r^D \left( c_2 D r+c_1 (D-2) \right. \right. \right. \nonumber \\&\left. \left. \left. -3 c_2 r +D-2\right) +c_4 (D-2) r^3\right) +q^2 (D-2) r^6\right] \nonumber \\&\quad 3 \left( c_1+1\right) {}^2 D (2 D-3) r^{-2 D} \Gamma (D+1) \, _2 \nonumber \\&\quad F_1\left( 1,D+1;D+2;-\frac{c_1+1}{r c_2}\right) \nonumber \\&+r c_2 \left[ D \left( 2 D^2-9 D+9\right) k \Gamma (D+2) \left( \right. \right. \nonumber \\&\left. \left. -2 \left( c_1+1\right) ^2 (D-2)-6 c_2^2 r^2+3 c_2 \left( c_1+1\right) r\right) \right. \nonumber \\&-\left( c_1+1\right) (D+1) \Gamma (D+1)\left[ 3 c_2 D \left( 2 D^2 \right. \right. \nonumber \\&\left. \left. -9 D+9\right) r \left( (3-D) k-c_3 (D-2) r^2\right) \right. \nonumber \\&\left. \left. +(2-D) r^{-2 D} \left( \left( 2 D^2-9 D+9\right) r^D \left( 2 \left( c_1 \right. \right. \right. \right. \right. \nonumber \\&\left. \left. \left. \left. \left. +1\right) D k r^D+3 c_4 r^3\right) +3 q^2 D r^6\right) \right) \right] \nonumber \\&\quad \left. \right\} \big / \left[ 3 \left( c_1+1\right) c_2^2 (D-3) (D-2) D (D \right. \nonumber \\&\left. \left. +1) (2 D-3) r^2 \Gamma (D+1)\right] \right. , \end{aligned}$$
(27)

where \(c_3\) and \(c_4\) are constants of integration, while \(_2F_1\) and \(_2F_1^*\) are the hypergeometric function and the regularized generalized hypergeometric function respectively.

Note that when we solve Eq. (27), with the dimension D to be an arbitrary parameter, the domain \(|-\frac{c_1+1}{r c_2}|<1\) of the hypergeometric functions and the regularized generalized hypergeometric functions which appear in the general solution, is hard to be satisfied. But in fact, the dimension \(D>3\) being an integer, the hypergeometric functions reduce to the logarithmic functions, whose domain \(|\frac{c_2 r+c_1+1}{c_2 r}|>0\) can be satisfied with \(r>0\) and \(c_2>0\) avoiding the divergence \(r=0\) and the zero \(r=-\frac{c_1+1}{c_2}\). Note that the condition \(|c_1|<<1\) has been used to ensure the deviation of our theory from Einstein gravity which is not large. Besides, the solution contains \((1+c_1)\) and \(c_2\) in the denominator, therefore this general solution is only valid for \(c_1\ne -1\) and \(c_2\ne 0\). We will elaborate these special cases in the next section.

In the action (1) the presence of an explicit cosmological constant \(\Lambda \) introduces a scale \(1/L^2\) in the theory. However in (27) this cosmological constant \(\Lambda \) does not appear explicitly, though it shows up in the field equations. This is because the function f(R), rather than R, introduces another length scale which redefines the original cosmological constant to an effective cosmological constant \(\Lambda _{eff}\). In the following parts, we will show that even in higher dimensional cases, the effective cosmological constant can be defined as the coefficient of \(r^2\) term in the metric function redefining the length scale of the theory.

For \(D=3\) we obtain a new exact charged black hole solution

$$\begin{aligned} B(r)= & {} -\frac{1}{4 \left( c_1+1\right) {}^3}\left\{ \left( c_1+1\right) \left[ q^2 \left( -4 c_2 r+c_1+1\right) \right. \right. \nonumber \\&\left. -4 \left( c_1+1\right) {}^2 c_3 r^2\right] \nonumber \\&+2 \left( c_1+1\right) q^2 \left( -2 c_2 r+c_1+1\right) \ln {r}\nonumber \\&+4 c_2^2 q^2 r^2 Li_2\left( -\frac{r c_2}{c_1+1}\right) \nonumber \\&+2 c_4 \left[ 2 c_2^2 r^2 \ln {\left| \frac{c_2 r+c_1+1}{r}\right| }\right. \nonumber \\&\left. +\left( c_1+1\right) \left( -2 c_2 r+c_1+1\right) \right] \nonumber \\&-2 c_2^2 q^2 r^2 \ln ^2{r} \nonumber \\&\left. +4 c_2^2 q^2 r^2 \ln {r} \ln {\left| \frac{c_2 r+c_1+1}{c_1+1}\right| }\right\} ~, \end{aligned}$$
(28)

where

$$\begin{aligned} Li_2(z)=-\int _0^z \frac{\ln {\left( 1-u\right) }}{u}du, \quad z\le 1~, \end{aligned}$$
(29)

is the Spence’s function or dilogarithm, a particular case of the polylogarithm (here we only consider the field of real number). To make sure the Spence’s function \(Li_2\) is valid for all the positive r, the condition \(c_2>0\) is required when \(|c_1|<<1\).

The cosmological constant \(\Lambda \) does not show up in the solution, but we can know if the space is flat, AdS or dS by analysing its asymptotic behaviors at spacial infinity and origin

$$\begin{aligned}&B\left( r\rightarrow \infty \right) \rightarrow -Sgn\left( \Lambda _{\text {eff}}\right) \infty ~, \end{aligned}$$
(30)
$$\begin{aligned}&B\left( r \rightarrow 0\right) =-\frac{2 q^2 \ln (r)+q^2+2 c_4}{4 c_1+4} \nonumber \\&\quad \rightarrow Sgn\left( 1+c_1\right) \infty ~, \end{aligned}$$
(31)

where

$$\begin{aligned} \Lambda _{\text {eff}}= & {} -6 c_3-\frac{c_2^2 }{\left( c_1+1\right) {}^3}\left[ q^2 \left( 3 \ln ^2\left( \frac{c_2}{c_1+1}\right) +\pi ^2\right) \right. \nonumber \\&\left. -6 c_4 \ln \left( c_2\right) \right] . \end{aligned}$$
(32)

In \((2+1)\)-dimensions, near horizon solutions, asymptotically Lifshitz black hole solutions and rotating black holes with exponential form of f(R) theory have been discussed in [40]. They first gave the basic field equations as same as our equations with \(D=3\), but their solution is different with our solution.

3 Special solutions

We will first consider solutions with \(c_2=0\). In this case \(f'(R)=c_1\) and the Eq. (26) becomes

$$\begin{aligned}&(c_1+1) \Big (r^2 B''(r)+(D-4) r B'(r)\nonumber \\&\qquad -2 (D-3) B(r)+2 D k-6 k\Big )\nonumber \\&\quad =q^2 r^{6-2 D}~,\nonumber \\ \end{aligned}$$
(33)

the solutions of which are

$$\begin{aligned} B(r)=\left\{ \begin{array}{l@{\quad }r} \displaystyle \frac{q^2 }{2 (c_1+1) (D-3) (D-2)r^{2(D-3)}}&{}\\ \qquad +c_3 r^2+c_4 r^{3-D}+k &{} D>3~, \\ \displaystyle c_4+\frac{c_3 r^2}{2}-\frac{q^2 }{2 (c_1+1)}\ln \left( 2 (c_1+1) r\right) &{} D=3~, \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(34)

and then the functions R(r) and f(r) become

$$\begin{aligned} R(r)= & {} \left\{ \begin{array}{l@{\quad }r} -c_3 (D-1) D-\frac{q^2 (D-4) }{2 (c_1+1) (D-2)r^{2 D-4}} &{} D>3~, \\ \frac{q^2}{2 (c_1+1) r^2}-3 c_3 &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(35)
$$\begin{aligned} f(r)= & {} \left\{ \begin{array}{l@{\quad }r} 2\Lambda -c_3 (D-1) (2 c_1-D+2)-\frac{c_1 q^2 (D-4)}{2 (c_1+1) (D-2) r^{2 D-4}} &{} D>3~, \\ 2\Lambda -2 c_1 c_3+c_3+\frac{c_1 q^2}{2 (c_1+1) r^2} &{} D=3~. \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(36)

For \(c_2=0\) we have two cases:

3.1 Non-constant R

For non-constant R, using the the solutions (35), (36) we have for f(R)

$$\begin{aligned} f(R)= & {} \left\{ \begin{array}{l@{\quad }r} c_1 R+c_3(c_1+1) (D-1)(D-2)+2\Lambda &{} D>3~, \\ c_1 R+c_3\left( 1+c_1\right) +2\Lambda &{} D=3~, \\ \!\!\!\nonumber \end{array} \right. \\ \end{aligned}$$
(37)

and then to have \(f(R)=c_1R\) we get for the parameter \(c_3\) (\([c_3]=[\Lambda ]=L^{-2}\))

$$\begin{aligned} c_3=\left\{ \begin{array}{l@{\quad }r} -\frac{2\Lambda }{(c_1+1)(D-1)(D-2)} &{} D>3~, \\ -\frac{2\Lambda }{c_1+1} &{} D=3~. \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(38)

Then the metric function and the curvature function become

$$\begin{aligned} B(r)= & {} \left\{ \begin{array}{l@{\quad }r} \frac{q^2 }{2 (c_1+1) (D-3) (D-2)r^{2(D-3)}}-\frac{2\Lambda r^2}{(c_1+1) (D-2) (D-1)}+\frac{c_4}{r^{D-3}}+k &{} D>3~,\\ c_4-\frac{\Lambda r^2}{ (c_1+1)}-\frac{q^2 }{2 (c_1+1)}\ln \left( 2 (c_1+1) r\right) &{} D=3~, \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(39)
$$\begin{aligned} R(r)= & {} \left\{ \begin{array}{l@{\quad }r} \frac{2D \Lambda }{(c_1+1) (D-2)}-\frac{q^2 (D-4) }{2 (c_1+1) (D-2)r^{2 D-4}} &{} D>3~, \\ \frac{q^2}{2 (c_1+1) r^2}+\frac{6 \Lambda }{c_1+1} &{} D=3~. \\ \end{array} \right. \end{aligned}$$
(40)

This result implies that it reduces to the Einstein gravity \(R+f(R)-2\Lambda =(1+c_1)R-2\Lambda =R-2\Lambda \) when \(c_1=0\). In this case the solutions (39) become

$$\begin{aligned} B(r)= & {} \left\{ \begin{array}{l@{\quad }r} \frac{q^2 }{2 (D-3) (D-2)r^{2(D-3)}}\\ \qquad -\frac{2\Lambda r^2}{ (D-2) (D-1)}+\frac{c_4}{r^{D-3}}+k &{} D>3~, \\ c_4-\Lambda r^2-\frac{q^2 }{2}\ln \left( 2 r\right) &{} D=3~, \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(41)
$$\begin{aligned} R(r)= & {} \left\{ \begin{array}{l@{\quad }r} \frac{2D \Lambda }{ (D-2)}-\frac{q^2 (D-4) }{2 (D-2)r^{2 D-4}} &{} D>3~, \\ \frac{q^2}{2 r^2}+6 \Lambda &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(42)

which after some parameterization

$$\begin{aligned} \left\{ \begin{array}{l@{\quad }r} c_4=-m_1,\quad q^2=2(D-3)(D-2)q_1^2 &{} D>3~, \\ c_4=-m_2+2q_2^2 \ln {2\ell },\quad q^2=4q_2^2 &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(43)

are exactly the standard higher-dimensional charged black hole solutions [41] and the charged BTZ black hole solution [42] in Einstein–Maxwell theory

$$\begin{aligned} B(r)=\left\{ \begin{array}{l@{\quad }r} k-\frac{2\Lambda }{(D-1)(D-2)}r^2 -\frac{m_1}{r^{D-3}}+\frac{q_1^2}{r^{2(D-3)}} &{} D>3~, \\ \frac{r^2}{l^2}-m_2-2 q_2^2 \ln {\frac{r}{\ell }} &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(44)

with dynamic curvatures

$$\begin{aligned} R(r)= & {} \left\{ \begin{array}{l@{\quad }r} \frac{ 2D \Lambda }{D-2}-\frac{(D-3)(D-4) q_1^2}{r^{2(D-2)}} &{} D>3~, \\ \frac{2q_2^2}{ r^2}-\frac{6}{\ell ^2} &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(45)

where parameters \(q_1\) and \(m_1\) are related to the electric charge and the ADM mass of the BH, and \(\ell \) is the AdS radius \(\Lambda =-\frac{1}{\ell ^2}\).

3.2 Constant curvature \(R=R_0\)

For constant curvature \(R=R_0\), we can take the trace of the Einstein equation and obtain

$$\begin{aligned} R_0\left( 1+f'(R_0)\right) -\frac{D}{2}\left( R_0+f(R_0)-2\Lambda \right) =\kappa T=0,\nonumber \\ \end{aligned}$$
(46)

where Maxwell electromagnetic field is traceless \(T=g^{\mu \nu }T_{\mu \nu }=0\). This relation can lead to

$$\begin{aligned} f(R_0)=-R_0+2\Lambda +c_0 R_0^{D/2}~, \end{aligned}$$
(47)

which means \(R_0+f(R_0)-2\Lambda =c_0 R_0^{D/2}\).

To see this consider the solutions Eq. (35). We can see that for constant curvature the parameters must satisfy \(q=0\) or \(D=4\). The former condition \(q=0\) leads to

$$\begin{aligned} B(r)= & {} k-\frac{R_0 r^2}{(D-1)D} +\frac{c_4}{r^{D-3}}~, \end{aligned}$$
(48)
$$\begin{aligned} f(R_0)= & {} 2\Lambda +\frac{(2 c_1+2-D)R_0}{D}~, \end{aligned}$$
(49)

which hold for all dimensions \(D\ge 3\). Comparing with the Eq. (47), we can obtain the relation between the parameter \(c_1\) and the constant curvature \(R_0\)

$$\begin{aligned} c_1=\frac{c_0 D}{2}R_0^{\frac{D-2}{2}}-1~. \end{aligned}$$
(50)

These geometries are exactly the same with the Schwarzschild black hole solutions in D-dimensions and the BTZ black hole solution in 3-dimensions,

$$\begin{aligned} B(r)=\left\{ \begin{array}{l@{\quad }r} k-\frac{2\Lambda }{(D-1)(D-2)}r^2 -\frac{m}{r^{D-3}} &{} D>3~, \\ \frac{r^2}{l^2}-m &{} D=3~. \\ \end{array} \right. \end{aligned}$$
(51)

Specially in 4-dimensions, the Ricci scalar is always a constant even with nonzero q,

$$\begin{aligned} B(r)= & {} k+\frac{q^2 }{4 (c_1+1) r^{2}}-\frac{R_0}{12} r^2+\frac{c_4}{r}~, \end{aligned}$$
(52)
$$\begin{aligned} f(R_0)= & {} 2\Lambda + \frac{(c_1-1)R_0}{2}~, \end{aligned}$$
(53)

where \(c_1\) has the same relation as in Eq. (50).

Note that \(f'(R_0)=c_1\), after parametrizations we have

$$\begin{aligned} B(r)= & {} k-\frac{m}{r}+\frac{q^2 }{4 \left( f'(R_0)+1\right) r^{2}}-\frac{R_0}{12} r^2, \end{aligned}$$
(54)

which has been studied in [26, 43]. However this kind of solutions can not be distinguished with the RN black holes in Einstein gravity, since we can always adjust the gravitational constant to make them the same.

It is worth noticing that this charged solution with constant curvature only exists in 4-dimensions while the Schwarzschild solution can be present in any higher dimensions.

3.3 New charged D-dimensional solutions for \(c_1=-1\)

We consider the special solutions for \(c_1=-1\). In this case the linear term \((1+c_1)R\) in the action will disappear and the nonlinear term dominates. The Eq. (26) becomes

$$\begin{aligned}&c_2 r \left( r^2 B''(r)+(D-3) r B'(r)-2 (D-2) B(r)\right. \nonumber \\&\quad \left. +2 D k-6 k\right) =q^2 r^{6-2 D}~, \end{aligned}$$
(55)

the solutions of which are

$$\begin{aligned} B(r)=\left\{ \begin{array}{l@{\quad }r} \frac{(D-3) k}{D-2}+\frac{q^2}{c_2 \left( 2 D^2-9 D+9\right) r^{2 D-5}}\\ \qquad +\frac{c_4}{r^{D-2}}+c_3 r^2 &{} D>3~, \\ c_3 r^2+\frac{c_4}{r}-\frac{q^2 }{9 c_2 r}\left( 3 \ln (r)+1\right) &{} D=3~, \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(56)

and then the functions R(r) and f(r) become

$$\begin{aligned} R(r)= & {} \left\{ \begin{array}{l@{\quad }r} -\frac{(D-2) q^2 }{c_2 (2 D-3)r^{2 D-3}}-c_3 (D-1) D+\frac{(D-3) k}{r^2} &{} D>3~, \\ -\frac{q^2}{3 c_2 r^3}-6 c_3 &{} D=3~, \\ \end{array} \right. \end{aligned}$$
(57)
$$\begin{aligned} f(r)= & {} \left\{ \begin{array}{l@{\quad }r} \frac{(D-3) k (2 c_2 r-1)}{r^2}+\frac{(D-2) q^2 }{c_2 (2 D-3)r^{2 D-3}}+c_3 (D-1) D-\frac{c_3^2}{2r^{2 D-4}} +2 \Lambda &{} D>3~, \\ \frac{q^2}{3 c_2 r^3}-\frac{c_3^2}{2 r^2}+6 c_3+2 \Lambda &{} D=3~. \\ \end{array} \right. \nonumber \\ \end{aligned}$$
(58)

When \(q=0\), these solutions are reduced to the solutions discussed in [24, 38].

4 Explicit solutions in various dimensions

In this Section we will discuss the forms and the properties of the general solution (27) in various dimensions. First we discuss the simplest solution in 3-dimensions.

4.1 The solution in (2+1)-dimensions (\(D=3\))

We have found the solution for \(D=3\) Eq. (28), to compare with the BTZ black hole we set \(q=0\) and then the metric function becomes

$$\begin{aligned} B(r)= & {} c_3 r^2-\frac{c_4 \left( -2 c_2 r+c_1+1\right) }{2 \left( c_1+1\right) {}^2}\nonumber \\&-\frac{c_2^2 c_4 r^2 }{\left( c_1+1\right) {}^3}\ln \left| \frac{c_2 r+c_1+1}{r}\right| ~. \end{aligned}$$
(59)

From \(\left| \frac{c_2 r+c_1+1}{r}\right| >0\) we can get \(c_2(1+c_1)>0\).

The asymptotic behaviors of the metric function are

$$\begin{aligned} B\left( r\rightarrow 0\right)= & {} -\frac{c_4}{2(1+c_1)}\equiv B_0~, \end{aligned}$$
(60)
$$\begin{aligned} B\left( r\rightarrow \infty \right)= & {} \left( c_3-\frac{c_2^2 c_4}{\left( 1+c_1\right) ^3}\ln {c_2}\right) r^2+o\left( r^2\right) ~, \end{aligned}$$
(61)

where the leading order at \(r\rightarrow \infty \) is \(r^2\) term, so we define its coefficient as the effective cosmological constant

$$\begin{aligned} \Lambda _{\text {eff}}=\frac{c_2^2 c_4}{\left( 1+c_1\right) ^3}\ln {c_2}-c_3~, \end{aligned}$$
(62)

the sign of which can determine the property of spacetime to be AdS or dS or if \(\Lambda _{\text {eff}}=0\) to be flat.

To check the possibility of flat and dS black hole, we introduce a root function

$$\begin{aligned} Root(r)= & {} \frac{\left( c_1+1\right) }{2 c_2^2} \left( \frac{2 \left( c_1+1\right) {}^2 c_3}{c_4}-\frac{-2 c_2 r+c_1+1}{r^2}\right) \nonumber \\&-\ln \left| \frac{c_2 r+c_1+1}{r}\right| ~, \end{aligned}$$
(63)

the roots of which are also the roots of the metric function B(r). The derivative of Root(r) is always positive under the condition \(c_2(1+c_1)>0\)

$$\begin{aligned} Root'(r)=\frac{\left( c_1+1\right) {}^3}{c_2^2 r^3 \left( c_2 r+c_1+1\right) }>0 \quad always, \end{aligned}$$
(64)

and the asymptotic behaviors of root function at \(r \rightarrow 0\) and \(r\rightarrow \infty \) are respectively

$$\begin{aligned} Root(r \rightarrow 0)= & {} -\frac{\left( 1+c_1\right) ^2}{2c_2^2 r^2} \rightarrow -\infty , \end{aligned}$$
(65)
$$\begin{aligned} Root(r\rightarrow \infty )= & {} \frac{\left( c_1+1\right) {}^3 c_3-c_2^2 c_4 \ln \left( c_2\right) }{c_2^2 c_4} \nonumber \\= & {} \frac{\left( 1+c_1\right) ^2\Lambda _{\text {eff}}}{2c_2^2 B_0}~, \end{aligned}$$
(66)

where \(\frac{\Lambda _{\text {eff}}}{B_0}>0\) indicates one horizon and \(\frac{\Lambda _{\text {eff}}}{B_0} \le 0\) indicates no horizon. If we want a dS black hole, there at least two horizons exist, while if we want an AdS black hole, one horizon is required. It is clear that the solution we obtained can only represent AdS black hole spacetimes (\(\Lambda <0\) and \(B_0<0\)) or pure dS spacetimes (\(\Lambda >0\) and \(B_0>0\)).

4.2 Solutions in D-dimensions (\(D>3\))

The general solution (27) contains some special functions that are not easy to analyse. However, when we solve the Eq. (26) in each dimension, the solutions become much simpler, only containing polynomials and logarithmic terms. In the Appendix A we give the solutions for \(D=4,5,6\) dimensions. The solution (A1) for \(D=4\) has been discussed in [32] while the solutions in higher dimensions are new and they have not been studied before.

To compare with the RN black holes and understand the physical meaning of the constants of integration, we set the coefficients of the logarithmic terms to be zero and then the solutions are just polynomials. Then from the solutions (A1), (A2) and (A3) we obtain the general constraint for the parameters

$$\begin{aligned}&c_4(-1)^D (D-3) (D-2) (c_1+1)^{D-3} c_2^{D-3}\nonumber \\&\quad +2 (D-3) k (c_1+1)^{2 D-5}\nonumber \\&\quad +q^2 (D-2) c_2^{2 (D-3)}=0~, \end{aligned}$$
(67)

under which the solutions (A1), (A2) and (A3) can be reduced to simpler polynomial solutions in D-dimensions

$$\begin{aligned} B(r)= & {} \frac{(D-3) k}{D-2}+\left[ c_3 +\frac{2 c_2^2 (2 D-5) k}{(c_1+1)^2 (D-2)^2 (D-3)}\right] r^2\nonumber \\&+\sum _{n=1}^{D-3} \frac{2 k (-1)^{n+1} (c_1+1)^n}{(D-2) (n+2) c_2^n r^n} \nonumber \\&+\sum _{n=D-2}^{2 (D-3)} \frac{q^2 (-1)^n c_2^{2 D-n-6}}{(D-3) (n+2) r^n (c_1+1)^{2 D-n-5}}~. \end{aligned}$$
(68)

Compared with RN black hole, our solution (68) has more terms from 1/r to \(1/r^{2(D-3)}\) while RN black hole only has two terms 1/r and \(1/r^{2(D-3)}\) as mass term and charge term respectively. Another interesting difference is that the constant term in our solution is a fraction \(\frac{(D-3) k}{D-2}\) depending on dimension D, and this fraction can not be rescaled. Moreover, the dynamic curvature R(r) and the nonzero gravitational action f(r) can not be simplified by the transformation of coordinates.

Firstly, the constant term of the solution is \(\frac{D-2}{D-3}\), indicating that it is non-asymptotic flat with a deficit angle. This deficit angle will disappear at large D limit, i.e. the constant term becomes 1. Secondly, since the spacetime remains non-zero curvature even with zero mass, it can be interpreted as the global monopole solution in proper limits. Thirdly, there do exist some entanglements of mass and charge terms in the metric function. These entanglements become more and more complicated with the increase of the dimension, nevertheless we figure out the rules with any dimensions D.

Using relations (14) and (25) we can obtain the expressions of R(r) and f(r)

$$\begin{aligned} R(r)= & {} \frac{(D-3) k}{r^2}-(D-1)D \left[ c_3 +\frac{2 c_2^2 (2D-5) k}{(c_1+1)^2 (D-3) (D-2)^2} \right] \nonumber \\&+\sum _{n=1}^{D-3} \frac{2 k (-1)^n (c_1+1)^n \left( D^2-D (2 n+5)+n^2+5 n+6\right) }{(D-2) (n+2)c_2^{n} r^{n+2}} \nonumber \\&-\sum _{n=D-2}^{2(D-3)} \frac{q^2 (-1)^n \left( D^2-D (2 n+5)+n^2+5 n+6\right) }{(D-3) (n+2)(c_1+1)^{2 D-n-5} c_2^{n+6-2D}r^{n+2}}~, \end{aligned}$$
(69)
$$\begin{aligned} f(r)= & {} (D-1)(D-2-2 c_1)\left[ c_3 +\frac{2 c_2^2 (2D-5) k}{(c_1+1)^2 (D-3) (D-2)^2}\right] \nonumber \\&+\frac{2 c_2 (D-3) k}{r}-\frac{q^2}{2 r^{2 D-4}} +\frac{(D-3) k (2 c_1-D+4)}{(D-2) r^2}\nonumber \\&-\sum _{n=1}^{D-3} \frac{2 k (-1)^n (c_1+1)^n (-D+n+3) (2 c_1-D+n+4)}{(D-2) (n+2)c_2^{n} r^{n+2}}\nonumber \\&+\sum _{n=D-2}^{2 (D-3)} \frac{q^2 (-1)^n (-D+n+3) (2c_1-D+n+4)}{(D-3) (n+2)(c_1+1)^{2 D-n-5} c_2^{n+6-2D}r^{n+2}}+2\Lambda ~,\nonumber \\ \end{aligned}$$
(70)

and using the relation (16) we can get the exact expression of f(R),

$$\begin{aligned} f(R)= & {} (D-1)(D-2-2 c_1)\left[ c_3 +\frac{2 c_2^2 (2D-5) k}{(c_1+1)^2 (D-3) (D-2)^2}\right] \nonumber \\&+\frac{2 c_2^2 (D-3) k}{f'(R)-c_1}-\frac{q^2 c_2^{2 D-4}}{2 \left( f'(R)-c_1\right) ^{2 D-4}} \nonumber \\&+\frac{(D-3) k (2 c_1-D+4)c_2^2}{(D-2) \left( f'(R)-c_1\right) ^2}\nonumber \\&-\sum _{n=1}^{D-3} \frac{2 k (-1)^n (c_1+1)^n c_2^{2} (-D+n+3) (2 c_1-D+n+4)}{(D-2) (n+2) \left( f'(R)-c_1\right) ^{n+2}}\nonumber \\&+\sum _{n=D-2}^{2 (D-3)} \frac{q^2 (-1)^n c_2^{2D-4} (-D+n+3) (2 c_1-D+n+4) }{(D-3) (n+2)(c_1+1)^{2 D-n-5}\left( f'(R)-c_1\right) ^{n+2}}+2\Lambda ~.\nonumber \\ \end{aligned}$$
(71)

Defining an effective cosmological constant

$$\begin{aligned}&\Lambda _\text {eff}=-\frac{(D-1)(D-2)}{2}\left( c_1+1\right) \nonumber \\&\quad \left[ c_3 +\frac{2 c_2^2 (2 D-5) k}{(c_1+1)^2 (D-2)^2 (D-3)}\right] ~, \end{aligned}$$
(72)

we rewrite the functions B(r), R(r), f(r), and f(R) in the Appendix B.

5 Equivalence to scalar–tensor theory

5.1 From f(R) gravity to scalar–tensor theory

For general f(R) theory,

$$\begin{aligned} S_{met}=\frac{1}{2\kappa }\int d^D x \sqrt{-g}f(R)+S_M\left( g_{\mu \nu },\psi \right) , \end{aligned}$$
(73)

one can introduce a new field \(\chi \) and write the dynamically equivalent action

$$\begin{aligned} S_{met}= & {} \frac{1}{2\kappa }\int d^D x \sqrt{-g}\left[ f(\chi )+f'(\chi )\left( R-\chi \right) \right] \nonumber \\&+S_M\left( g_{\mu \nu },\psi \right) . \end{aligned}$$
(74)

Variation with respect to \(\chi \) leads to the equation

$$\begin{aligned} f''(\chi )\left( R-\chi \right) =0. \end{aligned}$$
(75)

Therefore, \(\chi =R\) if \(f''(\chi )\ne 0\), which reproduces the action (73). Redefining the field \(\chi \) by \(\phi =f'(\chi )\) and setting

$$\begin{aligned} V(\phi )=\chi (\phi )\phi -f\left( \chi (\phi )\right) , \end{aligned}$$
(76)

the action takes the form

$$\begin{aligned} S_{met}=\frac{1}{2\kappa }\int d^D x \sqrt{-g}\left[ \phi R-V(\phi )\right] +S_M\left( g_{\mu \nu },\psi \right) . \end{aligned}$$
(77)

This is the Jordan frame representation of the action of a Brans-Dicke theory with Brans-Dicke parameter \(\omega _0=0\). It should be stressed that the scalar degree of freedom \(\phi =f'(\chi )\) is quite different from a matter field, like all nonminimally coupled scalars, it can violate all of the energy conditions.

For the solutions in 4.2, using

$$\begin{aligned} \phi (r)= & {} f_R(r)=c_1+c_2 r, \end{aligned}$$
(78)
$$\begin{aligned} V(r)= & {} \phi (r) R(r)-f(r), \end{aligned}$$
(79)

we can obtain the potential as a function of \(\phi \)

$$\begin{aligned}&V(\phi ) =V_0+V_1 \phi +\frac{q^2 c_2^{2 D-4}}{2 (\phi -c_1)^{2 D-4}}\nonumber \\&\qquad +\frac{c_2^2 (D-3) k (-2 c_1+(D-2) \phi +D-4)}{(D-2) (\phi -c_1)^2} -\frac{2 c_2^2 (D-3) k}{\phi -c_1}-2\Lambda \nonumber \\&\qquad -\sum _{n=D-2}^{2 (D-3)} \frac{q^2 (-1)^n c_2^{2 D-4} (-D+n+3) (c_1+1)^{-2 D+n+5} (-2 c_1+\phi (-D+n+2)+D-n-4) }{(D-3) (n+2) (\phi -c_1)^{n+2}}\nonumber \\&\qquad +\sum _{n=1}^{D-3} \frac{2 c_2^2 k (-1)^n (c_1+1)^n (-D+n+3) (2 c_1+\phi (-D+n+2)-D+n+4)}{(D-2) (n+2) (\phi -c_1)^{n+2}} . \end{aligned}$$
(80)

Note that there are \((\phi - c_1)\) terms in the denominators, indicating the divergence of the potential at \(\phi =c_1\). This divergent point \(\phi =c_1\) only appears at origin \(r=0\), where a physical singularity exists. Also, the constant term of a scalar field \(\phi \) that comes from the transformation of f(R) gravity can always be rescaled. Besides, considering that the coefficient of the Einstein–Hilbert term in the action \((1+c_1)\) can be absorbed into the Newton’s constant, we can always set \(c_1=0\). Then the divergent point becomes \(\phi =0\), which can be controlled in a potential.

Therefore though the f(R) form is still unknown, but the equivalent scalar–tensor theory is clear.

6 Explicit solution in \((3+1)\)-dimensions

In \((3+1)\)-dimensions the form of f(R) can be solved explicitly so we will discuss this solution in details and also study its thermodynamics.

The solution (68) in \((3+1)\)-dimensions writes

$$\begin{aligned} B(r)= & {} \frac{k}{2}+\frac{\left( c_1+1\right) k}{3 c_2 r}+\frac{q^2}{4 \left( c_1+1\right) r^2}\nonumber \\&+\frac{3 c_2^2 k +2 c_3 \left( c_1+1\right) {}^2}{2 \left( c_1+1\right) {}^2}r^2~, \end{aligned}$$
(81)
$$\begin{aligned} R(r)= & {} -\frac{18 c_2^2 k}{(c_1+1)^2}-12 c_3+\frac{k}{r^2}~, \end{aligned}$$
(82)
$$\begin{aligned} f(r)= & {} \frac{c_1 k}{r^2}+\frac{2 c_2 k}{r}-\frac{9 \left( c_1-1\right) c_2^2 k}{\left( c_1+1\right) {}^2}\nonumber \\&-6 \left( c_1-1\right) c_3+2\Lambda ~, \end{aligned}$$
(83)

from which we can have an explicit form of f(R)

$$\begin{aligned} f(R)= & {} \frac{2 c_2^2 k}{c_1}+c_1 \left( c_5+R\right) \pm 2 \sqrt{\frac{c_2^2 k W(R)}{c_1^2 \left( c_1+1\right) {}^2}}~, \end{aligned}$$
(84)
$$\begin{aligned} W(R)= & {} -c_1 \left( 5 c_2^2 k+6 c_3+2\Lambda \right) \nonumber \\&+c_1^2 \left( 11 c_2^2 k-6 c_3+c_5-4 \Lambda +R\right) +2 c_2^2 k \nonumber \\&+c_1^3 \left( 6 c_3+2 c_5-2\Lambda +2 R\right) \nonumber \\&+c_1^4 \left( 6 c_3+c_5+R\right) ~, \end{aligned}$$
(85)

where the constant of integration \(c_5\) should be set to

$$\begin{aligned} c_5=-\frac{2c_2^2 k}{c_1^2}~, \end{aligned}$$
(86)

to ensure that the only constant in the action is \(-2\Lambda \). After this constraint the f(R) becomes

$$\begin{aligned}&f(R)=c_1 R\nonumber \\&\quad \pm 2 \sqrt{\frac{c_2^2 k \left( 9 \left( c_1-1\right) c_2^2 k+\left( c_1+1\right) {}^2 \left( c_1 R-2\Lambda \right) +6 \left( c_1-1\right) c_3 \left( c_1+1\right) {}^2\right) }{c_1 \left( c_1+1\right) {}^2}}.\nonumber \\ \end{aligned}$$
(87)

Substituting R(r) into this expression and comparing with f(r), we finally get

$$\begin{aligned} c_3=\frac{-2c_1 \Lambda -9 c_2^2 k-2\Lambda }{6 (c_1+1)^2}~, \end{aligned}$$
(88)

then the solution becomes

$$\begin{aligned} B(r)= & {} \frac{k}{2}+\frac{(c_1+1) k}{3 c_2 r}+\frac{q^2}{4 (c_1+1) r^2}-\frac{\Lambda r^2}{3 (c_1+1)}~, \end{aligned}$$
(89)
$$\begin{aligned} R(r)= & {} \frac{4 \Lambda }{c_1+1}+\frac{k}{r^2}~, \end{aligned}$$
(90)
$$\begin{aligned} f(r)= & {} \frac{2k c_2}{r}+\frac{c_1 k}{r^2}+\frac{4 c_1 \Lambda }{c_1+1}~, \end{aligned}$$
(91)

with

$$\begin{aligned} f(R)=c_1 R \pm 2 c_2 \sqrt{k\left( R-\frac{4\Lambda }{1+c_1}\right) }~. \end{aligned}$$
(92)

We define the action of gravitational part as \(F(R)=R+f(R)-2\Lambda \), then after a rescale we get,

$$\begin{aligned} \frac{1}{2\kappa } F(R)\equiv & {} \frac{1}{2\kappa }\left( R+f(R)-2\Lambda \right) \nonumber \\= & {} \frac{1}{2\kappa }\left( (1+c_1) R\pm c_2\sqrt{ k \left( R-\frac{4\Lambda }{1+c_1}\right) }-2\Lambda \right) \nonumber \\= & {} \frac{(1+c_1)}{2\kappa }\left( R\pm \frac{c_2}{1+c_1} \sqrt{ k \left( R-\frac{4\Lambda }{1+c_1}\right) }\right. \nonumber \\&\quad \left. -\frac{2\Lambda }{1+c_1}\right) \nonumber \\= & {} \frac{1}{2\kappa '} \left( R\pm \frac{c_2}{1+c_1} \sqrt{ k \left( R-4\Lambda '\right) }-2\Lambda '\right) ,\nonumber \\ \end{aligned}$$
(93)

where \(\Lambda '=\frac{\Lambda }{1+c_1}\) is an effective cosmological constant and \(\kappa '=\frac{\kappa }{1+c_1}\). Then we can obtain the other equivalent form \({\tilde{F}}(R)\)

$$\begin{aligned} {\tilde{F}}(R)=R\pm \frac{c_2}{1+c_1} \sqrt{ k \left( R-4\Lambda '\right) }-2\Lambda '~. \end{aligned}$$
(94)

In fact we can always rescale to make \(1+c_1=1\), then then we can adjust the parameter \(c_2\) to change the relation between Einstein action term R and the nonlinear action term \(\sqrt{k\left( R-\frac{4\Lambda }{1+c_1}\right) }\).

Note that when \(c_1=0\) and \(c_2=0\) the action (92) and the general solution will reduce to the Einstein gravity and RN black hole, but for this brunch with \(c_2 \ne 0\), the solution can never reduce to the standard RN black hole solution even when \(c_1=0\) and \(c_2\) approaches to 0. Here we give the solutions \(B_0(r)\), \(R_0(r)\), \(f_0(r)\) and \(F_0(r)\) to represent the solutions B(r) , R(r), f(r) and F(r) with \(c_1=0\),

$$\begin{aligned} B_0(r)= & {} \frac{k}{2}+\frac{ k}{3 c_2 r}+\frac{q^2}{4 r^2}-\frac{\Lambda r^2}{3 }~, \end{aligned}$$
(95)
$$\begin{aligned} R_0(r)= & {} 4 \Lambda +\frac{k}{r^2}~, \end{aligned}$$
(96)
$$\begin{aligned} f_0(r)= & {} \frac{2k c_2}{r}~, \end{aligned}$$
(97)
$$\begin{aligned} F_0(r)= & {} 2\Lambda +\frac{k}{r^2}+\frac{2k c_2}{r}~. \end{aligned}$$
(98)

In the following figures we depict the plots of \(B_0(r)\) to show the influence of parameter \(c_2\). In Fig. 3, the figures are plotted with positive \(c_2\). It is clear that there can not exist any black holes for \(k=1\), since all the terms in the metric function \(B_0(r)\) are positive (Here we choose the asymptotic anti-de Sitter spacetimes). While for \(k=-1\) black hole solutions exist and the black hole with larger \(c_2\) has smaller radius of event horizon, which means that larger nonlinear gravitational action gives smaller black hole.

Fig. 1
figure 1

Metric functions \(B_0(r)\) with \(k=\pm 1\). The black curve, black dashed curve, cyan curve, cyan dashed curve, pink curve and pink dashed curve correspond to metric functions \(B_0(r)\) with \(c_2=-1,-2,-3,-4,-5,-6\) respectively. Other parameters are set as \(q=0.4\) and \(\Lambda =-0.1\)

In Fig. 1, the figures are plotted with negative \(c_2\). It shows that for \(k=1\) the black hole with larger absolute value of \(c_2\) has smaller radius of event horizon, which means that larger proportion of the nonlinear action part gives smaller black holes. While for \(k=-1\) the black hole with larger absolute value of \(c_2\) corresponds to larger radius of event horizon, indicating that larger proportion of the nonlinear action part gives larger black holes.

The above two figures are giving us some typical examples of the formation of black holes in (3+1)-dimensions due to the presence of the nonlinear term of the curvature.

Compared with RN black hole in \((3+1)\)-dimensions,

$$\begin{aligned} B_{\text {RN}}(r)= & {} k -\frac{m_1}{r}+\frac{q_1^2}{r^{2}}-\frac{\Lambda }{3}r^2~, \end{aligned}$$
(99)
$$\begin{aligned} R_{\text {RN}}(r)= & {} 2\Lambda ~, \end{aligned}$$
(100)
$$\begin{aligned} F_{\text {RN}}(r)= & {} 0~, \end{aligned}$$
(101)

our solution has two terms related to the parameter k, which means the topology has more influence on the geometry. Besides, our solution also contains a dynamic curvature R(r) and non-zero gravitational action F(r), while the RN black hole has a constant curvature and zero gravitational action. Except the difference of the constant terms, we can rescale the parameters

$$\begin{aligned} q=2q_1, \quad c_2=-\frac{k}{3m_1}, \end{aligned}$$
(102)

to make their metric functions very similar

$$\begin{aligned} B_0(r)= & {} \frac{k}{2}-\frac{ m_1}{ r}+\frac{q_1^2}{ r^2}-\frac{\Lambda r^2}{3 }~, \end{aligned}$$
(103)
$$\begin{aligned} B_{\text {RN}}(r)= & {} k -\frac{m_1}{r}+\frac{q_1^2}{r^{2}}-\frac{\Lambda }{3}r^2~. \end{aligned}$$
(104)
Fig. 2
figure 2

The black curve represents \(B_{RN}(r)\) with \(m_1=2\). While black dashed curve, cyan curve, cyan dashed curve, pink curve and pink dashed curve correspond to \(B_0(r)\) with \(m_1=2,2.5,3,3.5,4\) respectively. Other parameters are set as \(q_1=0.5\) and \(\Lambda =-1\)

In Fig. 2, we depict the plots of the metric functions \(B_\text {RN}(r)\) and \(B_0(r)\) with different parameters \(m_1\) to observe the changes when the nonlinear term is present. Note that, no matter how we change the parameters, the metric functions \(B_\text {RN}(r)\) and \(B_0(r)\) always differ with a constant \(\frac{k}{2}\), so we mainly plot the figures for \(B_0(r)\). For black holes with the same charge and the cosmological constant, with the increase of \(m_1\) (the nonlinear action part alleviates), the black holes have larger radius of event horizons and deeper depressions of geometry inside the event horizons.

Similar solution has been obtained in a recent paper [44] with an action of the form \(F(R)=R-2\alpha \sqrt{R-8\Lambda }-\Lambda \).

Fig. 3
figure 3

Metric functions \(B_0(r)\) with \(k=\pm 1\). The black curve, black dashed curve, cyan curve, cyan dashed curve, pink curve and pink dashed curve correspond to metric functions \(B_0(r)\) with \(c_2=1,2,3,4,5,6\) respectively. Other parameters are set as \(q=0.4\) and \(\Lambda =-0.1\)

Fig. 4
figure 4

The black curves represent RN black hole in Einstein gravity while the cyan curves represent our black hole in f(R) gravity in \((3+1)\)-dimensions. In addition, the full lines, the dashed lines and the dotdashed lines correspond to \(q=0,1,2\) respectively

7 Thermodynamics

In this section we will study the thermodynamics of the black hole solution in \((2+1)\)-dimensions, including the First Law, Hawking temperature, entropy and heat capacity. Before we study the thermodynamics of our solution in f(R) gravity, we first review the First Law for RN black hole in Einstein gravity to compare.

7.1 RN black hole in Einstein gravity

The metric of RN black hole in D-dimensions is

$$\begin{aligned} B(r)=1-\frac{m}{r^{D-3}}+\frac{q^2}{r^{2 (D-3)}}, \end{aligned}$$
(105)

which gives the relation of the event horizon

$$\begin{aligned} m=q^2 r_+^{3-D}+r_+^{D-3}. \end{aligned}$$
(106)

Then the Hawking temperature and the entropy can be expressed by \(r_+\)

$$\begin{aligned} T(r_+)= & {} \frac{1}{4\pi }B'(r_+)=\frac{(D-3) r_+^{-2 D-1} \left( r_+^{2 D}-q^2 r_+^6\right) }{4 \pi }, \end{aligned}$$
(107)
$$\begin{aligned} S(r_+)= & {} \frac{A(r_+)}{4G}=2\pi A(r_+)=\frac{4 \pi ^{\frac{D+1}{2}} r_+^{D-2}}{\Gamma \left( \frac{D-1}{2}\right) }. \end{aligned}$$
(108)

For constant charge Q, the First Law \(dM=TdS+\Phi _e dQ\) gives

$$\begin{aligned}&M=\int T(r_+)dS(r_+)=\frac{(D-2) \pi ^{\frac{D-1}{2}}\left( q^2 r_+^{3-D}+r_+^{D-3}\right) }{\Gamma \left( \frac{D-1}{2}\right) }\nonumber \\&\quad =\frac{(D-2) \pi ^{\frac{D-1}{2}} m}{\Gamma \left( \frac{D-1}{2}\right) }. \end{aligned}$$
(109)

Note that the expression of \(r_+\) can be replaced by m, therefore the thermodynamic mass of the black hole can be described only by the parameter m.

7.2 f(R) black hole in \((3+1)\)-dimensions

In \((3+1)\)-dimensions, the metric is

$$\begin{aligned} B(r)=\frac{1}{2}+\frac{1}{3 c_2 r}+\frac{q^2}{4 r^2}, \end{aligned}$$
(110)

to compare with the RN black hole which can be written as

$$\begin{aligned} B(r)=\frac{1}{2}-\frac{m}{r}+\frac{q^2}{r^2}, \end{aligned}$$
(111)

where \(m=-1/(3c_2)\) and \(q \rightarrow 2q\).

With the relation between m, q and the event horizon \(r_+\)

$$\begin{aligned} m=\frac{q^2}{r_+}+\frac{r_+}{2}, \end{aligned}$$
(112)

the Hawking temperature and Bekenstein–Hawking entropy in f(R) gravity [45, 46] become

$$\begin{aligned} T(r_+)= & {} \frac{r_+^2-2 q^2}{8 \pi r_+^3}, \end{aligned}$$
(113)
$$\begin{aligned} S(r_+)= & {} \frac{8 \pi ^2 r_+^2 \left( 6 q^2+r_+^2\right) }{3 \left( 2 q^2+r_+^2\right) }. \end{aligned}$$
(114)

For constant charge Q, the First Law and heat capacity lead to

$$\begin{aligned} M= & {} \frac{2 \pi r_+}{3}+\frac{8 \pi q^2 r_+}{3 \left( 2 q^2+r_+^2\right) }+\frac{4 \pi q^2}{r_+}\nonumber \\&+\frac{8}{3} \pi \sqrt{2} q \arctan \left( \frac{r_+}{\sqrt{2} q}\right) , \end{aligned}$$
(115)
$$\begin{aligned} C_Q= & {} -\frac{16 \pi ^2 r_+^2 \left( r_+^2-2 q^2\right) \left( 12 q^4+4 q^2 r_+^2+r_+^4\right) }{3 \left( r_+^2-6 q^2\right) \left( 2 q^2+r_+^2\right) ^2}, \end{aligned}$$
(116)

where

$$\begin{aligned} r_+=m+\sqrt{m^2-2 q^2}. \end{aligned}$$
(117)

For neutral case, we have

$$\begin{aligned} M=\frac{2 \pi }{3}r_+=\frac{4\pi m}{3}, \quad C_Q=-\frac{16\pi ^2 r_+^2}{3}=-\frac{64\pi ^2 m^2}{3}. \end{aligned}$$
(118)

Although the metric function looks similar with RN black hole, however the mass M of the black hole can not be described only by the model parameter m. In other words, the real mass of the black hole is contributed by both model parameter m and charge parameter q due to the nonlinearity of f(R). The expression (116) clearly shows that the heat capacity becomes zero at the extremal case \(q=r_+/\sqrt{2}\) and divergent with a smaller charge \(q=r_+/\sqrt{6}\), similar with the RN case in Einstein gravity. To compare with the RN black holes in Einstein gravity, we plot the thermodynamic quantities of both RN black hole in Einstein gravity and our black hole in f(R) gravity in \((3+1)\)-dimensions in Fig. 4.

The Hawking temperature always decreases with the increase of the radius of the event horizon for the neutral case, indicating that neutral large black holes have lower Hawking temperature. While for the charged case the Hawking temperature goes up from zero (extremal case) to a maximum value then falls down to zero at infinity, where the electric charge can protect the black holes from the violent Hawking evaporation for small black holes. For black holes carrying the same charge, the black holes in f(R) gravity always have lower temperatures than their Einstein cousins.

The Bekenstein–Hawking entropy in Einstein gravity is proportional to area, while in f(R) gravity this relation is modified and leads to much lower entropy though charge can increase the entropy.

On the other side, the mass of RN black hole in Einstein gravity can be described linearly by a single parameter m, however in f(R) gravity the real thermodynamic mass of the black hole are decided by both charge parameter q and model parameter m or \(c_2\). In other words, this kind of f(R) black hole can carry the information the model parameters. From the figure we can see that for fixed charge, the relation between M and parameter m is still asymptotically linear. We can check the derivative of M(m)

$$\begin{aligned} \lim _{q\rightarrow 0} M'(m)=\frac{4\pi }{3}, \quad \lim _{m\rightarrow \infty } M'(m)=\frac{4\pi }{3}. \end{aligned}$$
(119)

Finally the heat capacity is always negative in neutral case for both Schwarzschild black hole and f(R) black hole, which indicates that the absorption of energy cools the black hole while the emission of energy heats up the black hole and makes it unstable through Hawking radiation. In addition, the presence of charge makes heat capacity divergent at some critical points as we have shown and positive branches of heat capacity appear in front of the divergent points, meaning small black hole (small radius of the event horizon) has positive heat capacity like ordinary objects. For the f(R) black hole, the divergence of heat capacity happens at black hole with larger radius of event horizon, and its heat capacity has smaller absolute value, which means that its ability to absorb and emit energy are both weaker than RN black hole.

8 Conclusions

In this work we obtained an exact charged black hole solution with dynamic curvature in D-dimensions in Maxwell-f(R) gravity. Without specifying the form of f(R) we solved the Einstein–Maxwell equations under a metric ansatz with \(g_{tt}g_{rr}=-1\). The general black hole solution we found, depending on the choices of the parameters, can reduce to the Reissner–Nordström black hole in D-dimensions in Einstein gravity and to the known charged black hole solution with constant curvature in f(R) gravity. We also obtained new charged D-dimensional solutions in the case of \(c_1=-1\). All of our general solutions in various dimensions consist of only polynomials and logarithmic terms, and with the constraints they reveal interesting properties when compared to RN black holes.

In \((3+1)\)-dimensions the form of f(R) can be solved explicitly and the found polynomial solution with dynamic curvature was compared with the usual \((3+1)\)-dimensions RN black hole in the Einstein gravity. The main characteristics of our solutions are the presence of a dynamic curvature R(r) and a non-zero gravitational action F(r), while the RN black hole has a constant curvature and zero gravitational action. This fact gives a rich spectrum of thermodynamical properties of our charge black hole solution.

We studied analytically the thermodynamics of the charge black hole in \((3+1)\)-dimensions and compared with the RN black holes in Einstein gravity, calculating the thermodynamical mass, Hawking temperature, Bekenstein–Hawking entropy and heat capacity. Firstly, the thermodynamical mass of the black hole we obtained via the First Law reveals the entanglement of the parameter m and q when they contribute to the black hole mass. In Einstein gravity, the parameter m and q represent the mass and charge respectively, while in the black hole solution in f(R) gravity, the real mass is a complicated combination of parameter m and charge q due to the nonlinear of the f(R) gravity. Then for the other thermodynamical quantities the behaviors of the black holes in f(R) gravity are similar with the RN black holes in Einstein gravity in general, but the former ones possess lower Hawking temperature, lower Bekenstein–Hawking entropy and lower absolute value of the heat capacity.