Solution (source code)

= Solution

Assume a passive linear <electrical circuit> in sinusoidal steady state, with transients absent and $V_0$ the \i[peak] <voltage>. Write $Z=|Z|e^{i\phi}=R+iX$. The <electric current> is $I(t)=I_0\cos(\omega t-\phi)$, with $I_0=V_0/|Z|$. Average the instantaneous <electric power> $V(t)I(t)$ over a full period. The double-frequency term averages to zero, leaving
$$
\langle P\rangle=\frac{V_0I_0}{2}\cos\phi,\qquad |Z|^2=R^2+X^2,\qquad \cos\phi=\frac R{|Z|}.
$$
Therefore
$$
\boxed{\langle P\rangle=\frac{V_0^2R}{2(R^2+X^2)}=\frac12 I_0^2R.}
$$
Equivalently, <root mean square> values give $\langle P\rangle=V_{\rm rms}I_{\rm rms}\cos\phi$. The <reactance> exchanges stored <electric field> or <magnetic field> energy with the source, whereas the real part produces <Joule heating>. A purely imaginary <complex impedance> dissipates no mean <electric power> under these ideal assumptions.