TLDR
The energy lost in one cycle is the average of \$p(t)\$ from \$0\$ to \$2\pi\$. Since there are \$f\$ cycles in a second and real power is energy lost per second, shouldn't real power be \$ f \times \dfrac{\int_0^{2\pi} p(t) dt}{2\pi}\$?
Explanation
Real power is the amount of energy lost or consumed by the circuit in a second. If we consider a single-phase \$50 \,hz\$, power supply connected to an RC circuit with power factor \$\cos \phi\$
simulate this circuit – Schematic created using CircuitLab
The instantaneous voltage and current, $$v(t)= V_m\,\sin \omega t \\ i(t) = I_m \,\sin(\omega t +\phi)$$
The instantaneous power is the product of these two,
$$p(t) = v(t)i(t) =V_m I_m\,\sin \omega t \,\sin(\omega t +\phi)$$
In one cycle (\$20ms\$, from \$0\$ to \$2\pi\$).
- Positive value for \$p(t)\$ implies power is drawn from the source
- Negative value for \$p(t)\$ implies power is given to the source
- Area under \$p(t)\$ represents the energy lost or gained.
Therefore,
1. From \$\omega t =0\$ to \$\dfrac{3 \pi}{4}\$, the circuit consumes energy since the power is positive. The area under \$p(t)\$ in this interval will give the exact value of energy consumed. Suppose the energy given to the circuit is \$20 J\$ (a random number for illustration).
2. From \$\omega t =\dfrac{3 \pi}{4}\$ to \$\pi\$, some energy is given back to the source, again, calculate the area under \$p(t)\$ to obtain the value, let me assume \$5J\$ of energy is given back.
The same two things happen again from \$\omega t =\pi\$ to \$2\pi\$
Hence from \$\omega t =0\$ to \$\pi\$, the energy
- Given to the circuit is \$20J\$
- Returned to the circuit is \$5J\$
- Consumed by the circuit is \$ 20J - 5J = 15J\$
The \$15J\$ consumed is lost forever but the \$5J\$ returned is once going to be given the circuit in the next cycle. So from \$\omega t =0\$ to \$ 2\pi \, \$,\$ 30J\$ are consumed and \$10J\$ are returned.
That is, the net energy consumed would be the difference between the positive and negative areas, which is $$\text{Real Energy Consumed per cycle} = \dfrac{\int_0^{2\pi} p(t) dt}{2\pi}$$ So shouldn't the energy consumed in \$50\$ cycles ( since \$f = 50hz\$) be \$ f \times\dfrac{\int_0^{2\pi} p(t) dt}{2\pi}\$?
I've probably made a silly mistake somewhere but I'm not able to spot it.