Solution (source code)

= Solution

The capacitor-charge <complex amplitude> is
$$
q_0=\frac{V_0/L}{1/(LC)-\omega^2+i(R/L)\omega}.
$$
For fixed driving-voltage <amplitude>, maximizing $|q_0|$ minimizes
$$
D(\omega)=\left(\omega_0^2-\omega^2\right)^2+\gamma^2\omega^2,\qquad
\omega_0^2=\frac1{LC},\quad\gamma=\frac RL.
$$
Differentiate:
$$
\frac{dD}{d\omega}=2\omega[-2(\omega_0^2-\omega^2)+\gamma^2].
$$
The positive-frequency minimum therefore has
$$
\boxed{\omega_{\rm res}=\sqrt{\frac1{LC}-\frac{R^2}{2L^2}}},\qquad
R^2<\frac{2L}{C}.
$$
This is the <resonance> of charge, or capacitor voltage. If the stated inequality fails, their maximum is at zero <frequency>, and no positive displacement-resonance peak exists. The <electric current> has the additional factor $\omega$, and instead peaks exactly at $\omega_0=1/\sqrt{LC}$ for every $R>0$.