(N/A) The voltage equation for an $L-C-R$ series circuit is given by Kirchhoff's voltage law:
$L \frac{dI}{dt} + RI + \frac{q}{C} = V$
Substituting $V = V_m \sin \omega t$,we get:
$L \frac{dI}{dt} + RI + \frac{q}{C} = V_m \sin \omega t$ ... $(1)$
Since $I = \frac{dq}{dt}$,we have $\frac{dI}{dt} = \frac{d^2q}{dt^2}$. Substituting this into $(1)$:
$L \frac{d^2q}{dt^2} + R \frac{dq}{dt} + \frac{q}{C} = V_m \sin \omega t$
Dividing by $L$:
$\frac{d^2q}{dt^2} + \frac{R}{L} \frac{dq}{dt} + \frac{q}{LC} = \frac{V_m}{L} \sin \omega t$ ... $(2)$
This is the equation for a forced,damped oscillator. Let the solution be $q = q_m \sin(\omega t + \theta)$ ... $(3)$
Then $\frac{dq}{dt} = q_m \omega \cos(\omega t + \theta)$ ... $(4)$ and $\frac{d^2q}{dt^2} = -q_m \omega^2 \sin(\omega t + \theta)$ ... $(5)$
Substituting $(3), (4),$ and $(5)$ into $(2)$:
$-q_m \omega^2 L \sin(\omega t + \theta) + R q_m \omega \cos(\omega t + \theta) + \frac{q_m}{C} \sin(\omega t + \theta) = V_m \sin \omega t$
$q_m \omega [R \cos(\omega t + \theta) + (\frac{1}{\omega C} - \omega L) \sin(\omega t + \theta)] = V_m \sin \omega t$
Using $X_C = \frac{1}{\omega C}$ and $X_L = \omega L$,and impedance $Z = \sqrt{R^2 + (X_L - X_C)^2}$,we define $\cos \phi = \frac{R}{Z}$ and $\sin \phi = \frac{X_L - X_C}{Z}$.
This leads to the phase relation where the current $I = I_m \sin(\omega t + \phi)$ lags or leads the voltage by phase angle $\phi = \tan^{-1}(\frac{X_L - X_C}{R})$.