$$\require{cancel}$$
So far, we have modeled how current propagates through a resistor under a constant potential difference, $$\Delta V$$. This is called “direct current” (DC) as the charges move in a constant direction through the resistor. Batteries supply fixed voltages, and circuits with batteries will almost always have DC current. The voltage that is supplied between two of the sockets in a household electrical outlet is “alternating”, and leads to “alternating current” (AC), where charges move back and forth, with no net displacement.
The potential difference across a household outlet varies sinusoidally: \begin{aligned} \Delta V (t) = \Delta V_0 \sin(\omega t)\end{aligned} where $$\Delta V_0$$ is the maximal amplitude of the voltage ($$120\text{V}$$ in North America, $$220\text{V}$$ in Europe), and $$\omega = 2\pi f$$, is the angular frequency of the voltage ($$f=60\text{Hz}$$ in North America, $$f=50\text{Hz}$$ in Europe). When a resistor with resistance, $$R$$, is connected to an AC voltage, the resulting current, given by Ohm’s Law, is also alternating: \begin{aligned} I(t)=\frac{\Delta V(t)}{R}=\frac{\Delta V_0}{R}\sin(\omega t)=I_0\sin(\omega t)\end{aligned} On average, the alternating current through a resistor is zero. However, this does not mean that zero energy is dissipated, since the electrons in the resistor will still collide with atoms as they oscillate back and forth. We can define the average power, $$\bar P$$, that is dissipated in the resistor as the power that is dissipated over one oscillation cycle (with period, $$T$$). To obtain the latter, we calculate the total energy, $$E$$, dissipated in the resistor over one cycle so that the power is simply given by $$E/T$$. We divide the interval of time, $$T$$, into infinitesimally small intervals, $$dt$$, so that the infinitesimal energy, $$dE$$, dissipated in an infinitesimal time, $$dt$$, is given by: \begin{aligned} dE=P(t) dt\end{aligned} The total energy dissipated in one period is then given by: \begin{aligned} E=\int dE = \int_0^T P(t)dt\end{aligned} so that the power dissipated in one cycle is given by: \begin{aligned} \bar P=\frac{E}{T}=\frac{1}{T}\int_0^T P(t)dt\end{aligned} The instantaneous power, $$P(t)$$, can be described in terms of the instantaneous current, $$P(t)=I^2(t)R$$, so that the average power can be written as: \begin{aligned} \bar P = \frac{1}{T}\int_0^TP(t)dt=\frac{1}{T}\int_0^TI(t)^2Rdt=RI_0^2\frac{1}{T}\int_0^T\sin^2(\omega t)dt=\frac{1}{2}RI_0^2\end{aligned} where we used the fact that $$T=\frac{2\pi}{\omega}$$ to evaluate the integral. In order to make the formula similar to the DC equivalent (without the additional factor of $$1/2$$), we can define the “root mean square” current, $$I_{rms}$$, as an average current, from which we can calculate the average power that is dissipated in a resistor: \begin{aligned} I_{rms}&=\frac{I_0}{\sqrt 2}\\ \therefore\bar P&=I_{rms}^2R\end{aligned} Similarly, one can define the “root mean square” voltage, $$\Delta V_{rms}$$, so that the average power dissipated with alternating current can be written in the same form as for the DC case: \begin{aligned} V_{rms}&=\frac{\Delta V_0}{\sqrt 2}\\ \therefore\bar P&=I_{rms}^2R =\frac{\Delta V_{rms}^2}{R}=I_{rms}\Delta V_{rms}\end{aligned}