1 Introduction

Since its discovery by Bardeen, Bekenstein, and Hawking [13] in the 1970s, the relationship between black hole physics and thermodynamics has been generally accepted by physicists. Decades of research show that the formula of the black hole entropy \(S=A/4\) where A is the area of the horizon and the temperature \(T=|\kappa |/(2\pi )\) where \(\kappa \) is the surface gravity has a certain universality. In 1995, Jacobson [4] argued that the Einstein equation could be derived from the relation of thermodynamics (Clausius relationFootnote 1) and pointed out that the Einstein equation is an equation of state. It was an important discovery that there exists a deep connection between Einstein gravity theory and thermodynamics. Besides, in a 4-dimensional de Sitter space, the analysis of quantum field theory shows that the temperature of the horizon of spacetime is \(T=\kappa /(2\pi )=1/(2\pi R)\) and the total entropy is \(S=\pi R^{2}\) where R is the radius of the horizon [7]. This implies that there exists a closed relationship between the horizon of spacetime and thermodynamics. Based on the above research results, we know that thermodynamics has a certain universality in describing the horizons of spacetime.

For the dynamic black hole, Hayward [810] introduced the notion of trapping horizon in the 4-dimensional Einstein gravity and showed that the Einstein equation is equivalent to the unified first law. Based on these facts, the authors of [11, 12] generalized these concepts to the FRW universe and investigated the relationship between the unified first law and thermodynamics of the horizon in the FRW universe. Especially, in Ref. [11], they considered the FRW universe as a dynamical spherically symmetric spacetime and defined a trapping horizon. In this way, they showed the equivalence between the unified first law and thermodynamics of the apparent horizon in the FRW universe.

In addition, regarding thermodynamics of the horizon, Padmanabhan [13, 14] has shown that the field equations in Einstein gravity and Lanczos–Lovelock gravity for a spherically symmetric spacetime can be expressed as the thermodynamic identity \(\mathrm{d}E=T\mathrm{d}S-P\mathrm{d}V\), where the quantities E, T, S, and V are related to the horizon and have the interpretation of energy, temperature, entropy, and volume. So the Clausius relation \(\delta Q=T\mathrm{d}S\) holds on the horizon. On the other hand, in cosmology, there exists an event horizon since the universe is in accelerated expansion according to astronomical observations. Indeed, Li [15] predicted the equation of state of the dark energy and resolved the cosmic coincidence problem by introducing the event horizon in the model of holographic dark energy. Besides, the event horizon of the universe is the largest comoving distance from which light emitted now can ever reach the observer in the future and very similar to the event horizon of the black hole whose thermodynamics has been accepted generally. Therefore, it is natural and interesting to investigate the laws of thermodynamics related to the event horizon in the FRW universe.

For the research as regards the thermodynamics on the event horizon, though Wang et al. [16] claimed the event horizon is unphysical from the point of view of the laws of thermodynamics, Chakraborty [6] concluded that the universe bounded by the event horizon may be a Bekenstein system by redefining the Hawking temperature. Based on the temperature defined in Ref. [6], we [17] investigated the thermodynamics of the universe bounded by the event horizon and dominated by a tachyon fluid and found that there exists a good thermodynamic description in such a universe. However, the definition of the temperature on the event horizon is not general in Refs. [6, 17], and the thermodynamical description is reasonable just in the flat universe and some models. So does there exist a general thermodynamic description of the event horizon in the FRW universe with any spatial curvature? Indeed, we obtain the first law of thermodynamics on the event horizon by redefining the Hawking temperature in Einstein gravity.

Now we can ask the question whether the first law of thermodynamics can hold on the event horizon in other gravity theories such as f(R) gravity. In fact, in f(R) gravity, Eling et al. [18] have shown that the correct equation of motion cannot be obtained if one uses the Hawking temperature, the entropy assumption \(S=\alpha Af'(R)\), and the first law of thermodynamics. An entropy production term has to be added to the first law of thermodynamics in order to obtain the correct equation. Thus f(R) gravity is described by the nonequilibrium thermodynamics of spacetime. So the above question turns into the question whether the first law of thermodynamics on the event horizon which is obtained by redefining the Hawking temperature in Einstein gravity can hold in f(R) gravity. In other words, can the thermodynamics of the spacetime in f(R) gravity be described by the equilibrium thermodynamics? Through the investigation, we find that the first law of thermodynamics on the event horizon is also held in f(R) gravity. Therefore, we may conclude that the first law of thermodynamics on the event horizon has a general description in respect of the evolution of the FRW universe.

The present paper is organized as follows. In Sect. 2, we show that the first law of thermodynamics on the event horizon holds by redefining the Hawking temperature. In Sect. 3, we derive the evolution equations of the universe based on the first law of thermodynamics on the event horizon where the quantum correction of the entropy is included. These evolution equations of the universe cannot be obtained just by the Einstein equation, so the method of the thermodynamical description is more general. In Sect. 4, we study the evolution of the universe based on the first law of thermodynamics on the event horizon in f(R) gravity. In Sect. 5, we investigate the generalized second law of thermodynamics of the universe bounded by the event horizon in Einstein gravity and f(R) gravity. We end our paper with the conclusion in Sect. 6. Throughout the paper, the Greek indices, \(\mu ,\nu ,\ldots ,\) etc. run over 0, 1, 2, 3 and the units are chosen with \(c=\hbar =k_{B}=1\); the signature of the spacetime is taken as \((-,+,+,+)\).

2 Redefinition of the Hawking temperature on the event horizon

In a homogeneous and isotropic universe, the metric can be expressed as

$$\begin{aligned} \mathrm{d}s^{2}=h_{ij}\mathrm{d}x^{i}\mathrm{d}x^{j}+R^{2}\mathrm{d}\varOmega _{2}^{2}, \end{aligned}$$
(1)

where i, j can take the values 0 and 1, \(R=a(t)r\) in which a(t) is the scale factor and the 2-dimensional metric is \(h_{ij}=\hbox {diag}(-1,a^{2}/(1-kr^{2}))\), in which k is the spatial curvature constant. A scalar quantity is defined as

$$\begin{aligned} \chi =h^{ij}\partial _{i}R\partial _{j}R. \end{aligned}$$
(2)

The apparent horizon is defined by the scalar quantity \(\chi =0\), which gives \(R_{A}=\frac{1}{\sqrt{H^{2}+\frac{k}{a^{2}}}}\). Then the surface gravity on the apparent horizon is defined as [5, 6, 19, 20]

$$\begin{aligned} \kappa _{A}=-\frac{1}{2}\frac{\partial \chi }{\partial R}\Big |_{R=R_{A}}=\frac{1}{R_{A}}, \end{aligned}$$
(3)

and the corresponding Hawking temperature is

$$\begin{aligned} T_{A}=\frac{|\kappa _{A}|}{2\pi }=\frac{1}{2\pi R_{A}}. \end{aligned}$$
(4)

The study of the thermodynamics of the apparent horizon has made great progress in the FRW universe [11, 12, 16, 2124]. In Refs. [11, 12], it was shown that the function of the surface gravity for any horizon of the FRW universe depends on these variablesFootnote 2 \(R_{A}\) and \(\dot{R}_{A}\) and is related to the ratio \(\dot{R}_{A}/R_{A}\) in the framework of the unified first law. On the other hand, Bousso [25] pointed out that a thermodynamic description of the horizon would be approximately valid and it does not matter whether one uses the apparent or the event horizon in the quintessence dominated spacetime (Q-spacetime). Therefore, we assume that the surface gravity on the event horizon (with the radius \(R_{E}\)) should have the following form:

$$\begin{aligned} \kappa _{E}=-\frac{1}{2}\frac{\partial \chi }{\partial R}\Big |_{R=R_{E}}\frac{\dot{R}_{A}}{R_{A}}g(R_{E}), \end{aligned}$$
(5)

where \(g(R_{E})\) is a function which is related to the variable \(R_{E}\).

Now let us determine the form of the function \(g(R_{E})\). In the model of the flat Q-spacetime (the scale factor a(t) is \(t^{\alpha }(\alpha >1)\) and the spatial curvature constant k is 0), the radius of the apparent horizon is \(R_{A}=\frac{t}{\alpha }\) and the radius of the event horizon is \(R_{E}=\frac{t}{\alpha -1}\), and the surface gravity on the event horizon can be reduced to the following form [6]:

$$\begin{aligned} \kappa _{E}=-\frac{1}{2}\frac{\partial \chi }{\partial R}\Big |_{R=R_{E}}. \end{aligned}$$
(6)

So the simplest form of the function \(g(R_{E})\) is

$$\begin{aligned} g(R_{E})=\frac{R_{E}}{\dot{R}_{E}}. \end{aligned}$$
(7)

Up to now, we obtain the surface gravity on the event horizon

$$\begin{aligned} \kappa _{E}=-\frac{1}{2}\frac{\partial \chi }{\partial R}\Big |_{R=R_{E}}\frac{\dot{R}_{A}}{R_{A}}\frac{R_{E}}{\dot{R}_{E}}. \end{aligned}$$
(8)

According to the relation between Hawking temperature and the surface gravity on spacetime horizons, we get the temperature on the event horizon

$$\begin{aligned} T_{E}=\frac{|\kappa _{E}|}{2\pi }=\frac{H}{2\pi } \left( \frac{k}{a^{2}}-\dot{H}\right) \frac{R_{E}^{2}}{\dot{R}_{E}}. \end{aligned}$$
(9)

Now we would like to show the universality of this temperature on the event horizon. The energy flux across the event horizon during an infinitesimal time interval dt can be calculated as [6, 16, 24, 25]

$$\begin{aligned} \delta Q=AT_{\mu \nu }k^{\mu }k^{v}\mathrm{d}t\mid _{r=R_{E}}, \end{aligned}$$
(10)

where \(k^{\mu }\) is a null vector and \(T_{\mu \nu }=(\rho +p)u_{\mu }u_{\nu }+pg_{\mu \nu }\) is the energy-momentum tensor. Thus, we can get the energy flux

$$\begin{aligned} \delta Q=4\pi R_{E}^{3}H(\rho +p)\,\mathrm{d}t. \end{aligned}$$
(11)

Using the Friedmann equation \(\dot{H}-\frac{k}{a^{2}}=-4\pi G(\rho +p)\), the energy flux turns into

$$\begin{aligned} \delta Q=\frac{HR_{E}^{3}}{G}\left( \frac{k}{a^{2}}-\dot{H}\right) \mathrm{d}t. \end{aligned}$$
(12)

On the other hand, we use the Bekenstein entropy–area relation and get

$$\begin{aligned} T_{E}\mathrm{d}S_{E}= & {} \frac{H}{2\pi }\left( \frac{k}{a^{2}}-\dot{H}\right) \frac{R_{E}^{2}}{\dot{R}_{E}}\cdot 2\pi R_{E}\mathrm{d}R_{E}\nonumber \\= & {} \frac{HR_{E}^{3}}{G}\left( \frac{k}{a^{2}}-\dot{H}\right) \mathrm{d}t. \end{aligned}$$
(13)

From Eqs. (12) and (13), we can see the first law of thermodynamics, \(\delta Q\mid _{R_{E}}=T_{E}\mathrm{d}S_{E}\), holds on the event horizon. In turn, we can also obtain the Friedmann equation in the FRW universe with any spatial curvature based on the first law of thermodynamics. This is an important result describing the event horizon of the universe.

There are some comments we would like to make regarding the thermodynamic description on the event horizon. First of all, obtaining Eq. (8) is based on the following clues: (i) The FRW universe is a dynamic spherically symmetric spacetime, so the horizon of its spacetime should be related to the trapping horizon (analogous to the dynamic black hole). (ii) Furthermore, the surface gravity defined under the frame of the unified first law [11, 12] is related to the ratio \(\dot{R}_{A}/R_{A}\), so it is reasonable that we assume the surface gravity on the event horizon is related to the ratio \(\dot{R}_{A}/R_{A}\) in the frame of Clausius relation. (iii) The concept of the event horizon of the FRW universe is similar to that of the black hole whose thermodynamics has been accepted generally, so the event horizon of the universe should be described by thermodynamics.

Second, the form of Eq. (8) is simple and can be reduced to the form which has been obtained in Ref. [8] in the model of the flat Q-spacetime, so Eq. (8) is the correct choice and has the physical explanation of the surface gravity.

Third, we get the conclusion that the first law of thermodynamics holds on the event horizon based on Eq. (8). This is an important result which shows the equivalence between the first law of thermodynamics on the event horizon and the Einstein equation in Einstein gravity. Because of the conceptual similarity between the black hole horizon and the event horizon of the universe, if we accept the thermodynamic description of the black hole horizon, then we should agree with the thermodynamic description of the event horizon of the universe. What is more, we have successfully constructed the Hawking temperature and shown the validity of the first law of thermodynamics on the event horizon in the FRW universe.

3 Evolution of the universe based on the first law of thermodynamics on the event horizon including the quantum correction

By redefining the Hawking temperature (Eq. (9)), we confirm the validity of the first of thermodynamics on the event horizon in the above section. In the following sections, we take the first law of thermodynamics \(\delta Q=T\mathrm{d}S\) on the event horizon as the fundamental starting point to derive the dynamic evolution equations of the universe.

In this section, we will consider the quantum correction of the entropy of the event horizon and derive these evolution equations of the universe including quantum correction effects.

As we have pointed out in the Introduction, the property of the event horizon of spacetime is similar to that of a black hole. Due to the similarity, we take the form of the quantum corrected entropy of a black hole as the entropy of the event horizon [2630],

$$\begin{aligned} S=\frac{A}{4L_{p}^{2}}+\alpha \ln \left( \frac{A}{4L_{p}^{2}}\right) , \end{aligned}$$
(14)

where \(\alpha \) is a constant and \(L_{p}=\sqrt{\hbar G/c^{3}}\) is the Planck length. According to Ref. [26], \(\alpha \sim O(1)\). Thus we obtain

$$\begin{aligned} T\mathrm{d}S=\frac{HR_{E}^{3}}{G}\left( 1+\frac{\alpha L_{p}^{2}}{\pi R_{E}^{2}}\right) \left( \frac{k}{a^{2}}-\dot{H}\right) \mathrm{d}t, \end{aligned}$$
(15)

and the energy flux is

$$\begin{aligned} \delta Q=4\pi R_{E}^{3}H(\rho +p)\mathrm{d}t. \end{aligned}$$
(16)

Based on the first law of thermodynamics \(\delta Q=T\mathrm{d}S\), we get

$$\begin{aligned} \left( \frac{k}{a^{2}}-\dot{H}\right) \left( 1+\frac{\beta }{R_{E}^{2}}\right) =4\pi L_{p}^{2}(\rho +p), \end{aligned}$$
(17)

where \(\beta =\frac{\alpha L_{p}^{2}}{\pi }\) is a constant. This is the Friedmann equation with a quantum correction describing the evolution of the universe (we will discuss it later).

Now, in order to see the evolution properties of the universe clearly, we take the scale factor \(a(t)=t^{c}(c>1)\) and employ G to denote \(L_{p}^{2}\). Thus, the radius of the event horizon turns into \(R_{E}=\frac{c}{c-1}H^{-1}\) and Eq. (17) turns into

$$\begin{aligned} \left( \frac{k}{a^{2}}-\dot{H}\right) (1+\lambda H^{2})=4\pi G(\rho +p), \end{aligned}$$
(18)

where \(\lambda =\beta (\frac{c-1}{c})^{2}\) is a constant. Compared with the standard Friedmann equation, we see that this equation has an extra term \(\lambda H^{2}\), which is caused by the quantum correction. At present, this term is very small, that is, \(\lambda H^{2}\ll 1\), so we can obtain

$$\begin{aligned} \frac{k}{a^{2}}-\dot{H}=4\pi G(\tilde{\rho }+\tilde{p}), \end{aligned}$$
(19)

where we redefine the effective energy density \(\tilde{\rho }\) and the effective pressure \(\tilde{p}\),

$$\begin{aligned} \tilde{\rho }=(1-\lambda H^{2})\rho \end{aligned}$$
(20)

and

$$\begin{aligned} \tilde{p}=(1-\lambda H^{2})p, \end{aligned}$$
(21)

respectively. On the other hand, the continuity equation for the effective perfect fluid is

$$\begin{aligned} \dot{\tilde{\rho }}+3H(\tilde{\rho }+\tilde{p})=0. \end{aligned}$$
(22)

Substituting Eqs. (20)–(22) into Eq. (19) and integrating the resulting equation, we finally obtain

$$\begin{aligned} H^{2}+\frac{k}{a^{2}}=\frac{8\pi G}{3}(1-\lambda H^{2})\rho . \end{aligned}$$
(23)

This is another Friedmann equation under the quantum correction. In order to see the properties of the accelerated expansion of the universe clearly, we combine Eqs. (19) and (23) and get the result

$$\begin{aligned} \frac{\ddot{a}}{a}= & {} -\frac{4}{3}\pi G(\rho +3p)(1-\lambda H^{2})\nonumber \\= & {} -\frac{4}{3}\pi G(\rho +3p)+\frac{4}{3}\pi G(\rho +3p)(\lambda H^{2}). \end{aligned}$$
(24)

Comparing with the equation \(\frac{\ddot{a}}{a}=-\frac{4}{3}\pi G(\rho +3p)\), which can be obtained by the Einstein equation, we find that Eq. (24) has an extra term, \(\frac{4}{3}\pi G(\rho +3p)(\lambda H^{2})\). From the above derivation, we know \(\lambda \sim O(L_{p}^{2})\), so the extra term contains the factor \(L_{p}^{2}H^{2}\), which represents quantum correction effects.

It should be noticed that the equation describing the evolution of the universe in the whole history is Eq. (17). From this equation, we know that the evolution of the universe depends on the event horizon \(R_{E}\), and the term \(\beta /{R_{E}^{2}}\) cannot be ignored at the early time. So this equation does not only show physical consistency with the classical limit but it also describes quantum effects which are described by the event horizon. Hence we can conclude that the thermodynamical description based on the event horizon under the redefinition of Hawking temperature is more general than the Einstein equation in describing the dynamic evolution of the universe.

4 Evolution of the universe based on the first law of thermodynamics on the event horizon in the f(R) theory

In this section, we will investigate the evolution property of the universe in the theory of f(R) gravity. According to Eq. (10), the energy flux is

$$\begin{aligned} \delta Q=4\pi R_{E}^{3}H(\bar{\rho }+\bar{p})\mathrm{d}t, \end{aligned}$$
(25)

where \(\bar{\rho }=\rho +\rho _{g}\) is the total energy density of the matter energy density \(\rho \) and the effective gravity energy density \(\rho _{g}\), and \(\bar{p}=p+p_{g}\) is the total pressure of the matter pressure p and the effective gravity pressure \(p_{g}\). In this gravity theory the relation of entropy–area [5, 31] is

$$\begin{aligned} S=\frac{Af'(R)}{4G}. \end{aligned}$$
(26)

Hence

$$\begin{aligned} T\mathrm{d}S=f'(R)H\left( \frac{k}{a^{2}}-\dot{H}\right) \frac{R_{E}^{3}}{G}\mathrm{d}t. \end{aligned}$$
(27)

Based on the first law of thermodynamics, we get the following equation:

$$\begin{aligned} \left( \frac{k}{a^{2}}-\dot{H}\right) f'(R)=4\pi G(\bar{\rho }+\bar{p}). \end{aligned}$$
(28)

However, \(\bar{\rho }\) and \(\bar{p}\) cannot be determined just by the first law of thermodynamics. So this evolution equation of the universe also cannot be determined just by thermodynamics alone.

In order to determine the total energy density \(\bar{\rho }\) and the total pressure density \(\bar{p}\), we employ the variational principle. In f(R) gravity, the Einstein–Hilbert action can be written as

$$\begin{aligned} S=\int \mathrm{d}^{4}x\sqrt{-g}(f(R)+2\kappa ^{2}L_{m}), \end{aligned}$$
(29)

where \(\kappa ^{2}=8\pi G\). We employ f to denote the function f(R) in the following content. Using the variational principle \(\delta S=0\), we obtain

$$\begin{aligned} G_{\mu \nu }=\kappa ^{2}\left( \frac{1}{f'}T_{\mu \nu }^{(m)}+\frac{1}{8\pi G}T_{\mu \nu }^{(g)}\right) \equiv \kappa ^{2}T_{\mu \nu }, \end{aligned}$$
(30)

where \(G_{\mu \nu }=R_{\mu \nu }-\frac{1}{2}g_{\mu \nu }R\) is the Einstein tensor, \(T_{\mu \nu }^{(m)}=(\rho +p)u_{\mu }u_{\nu }+pg_{\mu \nu }\) is the energy-momentum tensor of the matter, and

$$\begin{aligned} T_{\mu \nu }^{(g)}=\frac{1}{f'}\left[ \frac{f-Rf'}{2}g_{\mu \nu }+ \nabla _{\mu }\nabla _{\nu }f'-g_{\mu \nu }\nabla ^{2}f'\right] \end{aligned}$$
(31)

is the energy-momentum tensor of the gravity. Then we get the effective gravity energy density \(\rho _{g}\) and the effective gravity pressure \(p_{g}\),

$$\begin{aligned} \rho _{g}=\frac{1}{8\pi G}\left( \frac{Rf'-f}{2}-3Hf''\dot{R}\right) \end{aligned}$$
(32)

and

$$\begin{aligned} p_{g}=\frac{1}{8\pi G}\left( \frac{f-Rf'}{2}+f'''\dot{R}^{2}+f''\ddot{R}+2Hf''\dot{R}\right) ,\nonumber \\ \end{aligned}$$
(33)

respectively.

Thus, substituting Eqs. (32) and (33) into Eq. (28), we finally get the Friedmann equation in the FRW universe,

$$\begin{aligned} \left( \frac{k}{a^{2}}-\dot{H}\right) f'+\frac{1}{2} (Hf''\dot{R}-f'''\dot{R}^{2}-f''\ddot{R})=4\pi G(p+p).\nonumber \\ \end{aligned}$$
(34)

On the other hand, the continuity equation for the effective perfect fluid in f(R) gravity is

$$\begin{aligned} \dot{\bar{\rho }}+3H(\bar{\rho }+\bar{p})=0. \end{aligned}$$
(35)

Combining Eqs. (34) and (35), we obtain another Friedmann equation,

$$\begin{aligned} H^{2}+\frac{k}{a^{2}}=\frac{8\pi G}{3f'}\left[ \rho +\frac{1}{8\pi G}\left( \frac{Rf'-f}{2}-3Hf''\dot{R}\right) \right] .\nonumber \\ \end{aligned}$$
(36)

These Friedmann equations, Eqs. (34) and (36), are the same as those of Refs. [5, 32], which describe the evolution of the universe in other ways. Therefore, the equivalence between the first law of thermodynamics on the event horizon and Friedmann equations of the FRW universe with any spatial curvature holds not only in Einstein gravity but also in f(R) theory. This implies that the thermodynamical description is general in describing the evolution of the universe. Besides, it is also indicated that the FRW universe can be described by the equilibrium thermodynamics on the event horizon in f(R) gravity.

5 Generalized second law of thermodynamics of the universe bounded by the event horizon

The generalized second law of thermodynamics of the universe bounded by the event horizon in Einstein gravity has been investigated in Ref. [33], in which the authors assume that the universe can be described by the equilibrium thermodynamics. But in this paper, we have shown the validity of the first law of thermodynamics on the event horizon in Sect. 2, namely the universe bounded by the event horizon can be described by the equilibrium thermodynamics. This conclusion is particularly important for f(R) gravity, because it has been pointed out that the spacetime in f(R) gravity is described by the nonequilibrium thermodynamics if one uses the usual Hawking temperature [18]. Next, using the method of Ref. [33], we will present the generalized second law of equilibrium thermodynamics of the universe bounded by the event horizon in Einstein gravity and f(R) gravity.

For the holographic dark energy (DE) model [15] the density of holographic DE of the universe bounded by the event horizon is

$$\begin{aligned} \rho _{D}=\frac{3c^{2}}{8\pi G}R_{E}^{-2}, \end{aligned}$$
(37)

where c is a numerical constant. The equation of state of holographic DE can be written as

$$\begin{aligned} p_{D}=\omega _{D}\rho _{D}, \end{aligned}$$
(38)

where \(p_{D}\) is the thermodynamic pressure of the holographic DE and \(\omega _{D}\) is not necessarily a constant.

The two components in the matter system are non-interacting, so they satisfy the energy conservation equations

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

and

$$\begin{aligned} \dot{\rho }_{D}+3H(\rho _{D}+p_{D})=0 \end{aligned}$$
(40)

separately, where \(\rho _{d}\) is the energy density of dust matter (for dust matter, its pressure \(p_{d}\) is 0).

According to Eq. (10), the energy flux is

$$\begin{aligned} \delta Q=4\pi R_{E}^{3}H(\rho _{d}+\rho _{D}+p_{D})\mathrm{d}t. \end{aligned}$$
(41)

In Sect. 2, we have shown the validity of the first law of thermodynamics on the event horizon, so we have equilibrium thermodynamics, and the effective temperature of the matter (dust matter and DE) distribution can be considered to be the same as that of the event horizon [3335]. Thus we can use the following Gibbs relation [3436]:

$$\begin{aligned} T_{E}\mathrm{d}S_{m}=\mathrm{d}E_{m}+p_{D}\mathrm{d}V, \end{aligned}$$
(42)

where \(S_{m}\) and \(E_{m}\) are the entropy and energy of the matter distribution. We obtain the following equation:

$$\begin{aligned} \mathrm{d}S_{m}=\frac{4\pi R_{E}^{2}}{T_{E}}(\rho _{d}+\rho _{D}+p_{D})\mathrm{d}R_{E}+ \frac{HR_{E}^{3}}{T_{E}}\left( \dot{H}-\frac{k}{a^{2}}\right) \mathrm{d}t,\nonumber \\ \end{aligned}$$
(43)

where the relations \(E_{m}=\frac{4}{3}\pi R_{E}^{3}(\rho _{d}+\rho _{D})\) and \(V=\frac{4}{3}\pi R_{E}^{3}\) are used. Substituting Eqs. (37) and (38) into Eq. (40), we get

$$\begin{aligned} \mathrm{d}R_{E}=\frac{3}{2}R_{E}H(1+\omega _{D})\mathrm{d}t. \end{aligned}$$
(44)

Hence the change of the total entropy \(S_{\mathrm{tot}}=S_{m}+S_{E}\), where \(S_{E}\) is the entropy of the event horizon, which is determined by Eq. (13), is

$$\begin{aligned} \frac{\mathrm{d}S_{\mathrm{tot}}}{\mathrm{d}t}=\frac{6\pi R_{E}^{3}H}{T_{E}}(\rho _{d}+\rho _{D}+p_{D})(1+\omega _{D}). \end{aligned}$$
(45)

We see that the result is the same as that of Ref. [33]. When the holographic DE satisfies the weak energy condition

$$\begin{aligned} \rho _{D}+p_{D}=(1+\omega _{D})\rho _{D}\ge 0, \end{aligned}$$
(46)

the generalized second law of thermodynamics will be valid for the universe bounded by the event horizon.

For f(R) gravity, as we have shown in Sect. 4, the first law of thermodynamics holds on the event horizon, so Gibbs’ relation (42) can be used. Thus we obtain

$$\begin{aligned} \mathrm{d}S_{m}=\frac{4\pi R_{E}^{2}}{T_{E}}(\rho _{d}+ \rho _{g}+p_{g})\mathrm{d}R_{E}+\frac{HR_{E}^{3}}{T_{E}} \left( \dot{H}-\frac{k}{a^{2}}\right) \mathrm{d}t,\nonumber \\ \end{aligned}$$
(47)

where we employ the dust as the matter. According to the definition of the event horizon, \(R_{E}=a(t)\int _{t}^{\infty }\frac{\mathrm{d}t'}{a(t')}\), we get

$$\begin{aligned} \mathrm{d}R_{E}=(HR_{E}-1)\mathrm{d}t, \end{aligned}$$
(48)

so the change of the total entropy is

$$\begin{aligned} \frac{\mathrm{d}S_{\mathrm{tot}}}{\mathrm{d}t}= & {} \frac{4\pi R_{E}^{2}}{T_{E}} (\rho _{d}+\rho _{g}+p_{g})(HR_{E}-1)\nonumber \\&+\,(1-f')\frac{HR_{E}^{3}}{GT_{E}}\left( \dot{H}-\frac{k}{a^{2}}\right) . \end{aligned}$$
(49)

Substituting Eqs. (32) and (33) into Eq. (49), we get

$$\begin{aligned} \frac{\mathrm{d}S_{\mathrm{tot}}}{\mathrm{d}t}= & {} \frac{R_{E}^{2}}{2GT_{E}} (\rho _{d}+f'''\dot{R}^{2}+f''\ddot{R}-Hf''\dot{R})(HR_{E}-1)\nonumber \\&+\,(1-f')\frac{HR_{E}^{3}}{GT_{E}}\left( \dot{H}-\frac{k}{a^{2}}\right) . \end{aligned}$$
(50)

So the generalized second law of thermodynamics can be satisfied as long as the above expression is not less than 0.

Now we would like to make some remarks regarding the generalized second law of thermodynamics. (i) From the above derivation, we know that the Gibbs relation (42) is important in order to obtain the change of the total entropy. Indeed, we have established the Gibbs relation on the event horizon in Sect. 2, i.e. the first law of thermodynamics on the event horizon. By contrast, the authors in Ref. [33] just assumed the validity of the first law of thermodynamics on the event horizon and a temperature of the event horizon whose expression is unknown. (ii) For f(R) gravity, if one does not redefine the Hawking temperature, then the horizon is described by the nonequilibrium thermodynamics [11, 18]. As we know, the Gibbs relation (42) cannot be used for the nonequilibrium thermodynamics, so the method in Ref. [33] is invalid. However, the first law of thermodynamics on the event horizon holds and the Gibbs relation (42) can be used in this paper. (iii) For f(R) gravity, the form of the change of the total entropy is analytical, so it is convenient to discuss the generalized second law of thermodynamics if some physical quantities are given.

6 Conclusion

So far, the study of thermodynamics of the event horizon is rare, while the research of thermodynamics of the apparent horizon has made great progress in the FRW universe. However, there exists an event horizon since the universe is in accelerated expansion. What is more, the concept of the event horizon of the universe is very similar to the horizon of the black hole whose thermodynamics has been accepted generally. Hence it is natural and important to study thermodynamics of the event horizon in the FRW universe. As far as we know, the difficulty of studying thermodynamics on the event horizon is the definition of the temperature. For example, in Ref. [16] the authors employed the temperature on the event horizon \(T_{E}=1/(2\pi R_{E})\), whose form is similar to that of the apparent horizon, and they showed that the first law of thermodynamics on the event horizon is invalid. In Ref. [6], the author redefined the Hawking temperature but the Hawking temperature is not general, and his conclusions are only suitable for the flat spacetime and some models.

In order to solve these difficulties, we redefine the surface gravity and the corresponding Hawking temperature on the event horizon. Subsequently, we show the equivalence between the first law of thermodynamics on the event horizon and the Friedmann equations of the FRW universe with any spatial curvature in Einstein gravity. That is to say, the first law of thermodynamics on the event horizon holds in the FRW universe with any spatial curvature in Einstein gravity. This is a very important property, which indicates that the event horizon can be described by equilibrium thermodynamics.

Then, starting with the first law of thermodynamics on the event horizon, we obtain the Friedmann equation including the quantum correction and show that the evolution of the universe is related to the event horizon. As an example, we present the evolution of the universe at present and get the corresponding quantum corrected Friedmann equations, which are consistent with the standard Friedmann equations under the classical limit. Furthermore, we obtain the Friedmann equations of the FRW universe with any spatial curvature in f(R) gravity based on the first law of thermodynamics. Subsequently, we explore the generalized second law of thermodynamics of the universe bounded by the event horizon and get the conditions which satisfy the generalized second law of thermodynamics in Einstein gravity and f(R) gravity. In summary, we conclude that the first law of thermodynamics on the event horizon has a general description in respect of the evolution of the FRW universe.