Solution (source code)

= Solution

Use <phasors> with time dependence $e^{i\omega t}$. The <electrical impedance> $Z=\widetilde V/\widetilde I$ is the <complex number> relating the sinusoidal <voltage> and <electric current>: $|Z|$ is their <amplitude> ratio and $\arg Z$ is the <voltage> <phase> relative to the <electric current>. The component laws give
$$
V=RI\ \Longrightarrow\ \boxed{Z_R=R},\qquad
I=C\frac{dV}{dt}\ \Longrightarrow\ \boxed{Z_C=\frac1{i\omega C}},\qquad
V=L\frac{dI}{dt}\ \Longrightarrow\ \boxed{Z_L=i\omega L}.
$$
Thus the <resistor> has zero relative <phase>, the <capacitor> <voltage> lags its <electric current> by $\pi/2$, and the <inductor> <voltage> leads its <electric current> by $\pi/2$. The ideal <capacitor> and <inductor> store and return <energy>; the real <electrical impedance> of the <resistor> describes dissipation.