Given an electric circuit composed of an inductor with inductance L and a capacitor with capacitance C, the Kirchhoff loop rule requires that the sum of the changes in potential must be zero, so
where I is the current through the inductor and Q is the charge on the capacitor.
CLR Circuit, Simple Harmonic Motion Eric Weisstein's World of Math