Answer
$L~\frac{d^2q}{dt^2}+\frac{q}{C} = 0$
Work Step by Step
We can write an expression for the potential difference across a capacitor:
$V_C = \frac{q}{C}$
We can write an expression for the potential difference across an inductor:
$V_L = -L~\frac{di}{dt}$
Suppose we go around the loop of a circuit such that we go up to a higher potential across the capacitor. As we continue around the loop across the inductor, we are going in the direction of increasing current. Therefore, as we cross the inductor, we are moving down to a lower potential:
Therefore, according to the loop rule:
$V_L+V_C = 0$
$-L~(-\frac{di}{dt})+\frac{q}{C} = 0$
$L~\frac{d^2q}{dt^2}+\frac{q}{C} = 0$