Solution (source code)

= Solution

The two stored <energies> follow directly by squaring the expressions for <electric charge> and <electric current>:
$$
E_C=\frac12CV_0^2e^{-2\gamma t}\left(\cos\omega_dt+\frac\gamma{\omega_d}\sin\omega_dt\right)^2,\qquad E_I=\frac{V_0^2}{2L\omega_d^2}e^{-2\gamma t}\sin^2\omega_dt.
$$
Both are nonnegative, with alternating maxima. Initially all stored <energy> is in the <capacitor>; at a zero of $q$ it is entirely in the <inductor>. The total is
$$
E=\frac{q^2}{2C}+\frac12L\dot q^2,\qquad \boxed{\frac{dE}{dt}=\dot q\left(\frac qC+L\ddot q\right)=-R I^2\leq0.}
$$
\b[The total <energy> decreases monotonically, with a horizontal tangent whenever the <electric current> is zero.] Its envelope decays on the $1/(2\gamma)=20\ \mathrm{ms}$ scale, but the exact total is not a featureless exponential: the resistor's instantaneous loss varies within each oscillation. The figure in part (a) shows this gradual modulation of the downward slope as well as the component <energies>.