Why do I get the wrong answer when determining the charge in a capacitor using definition of voltage?
May as well document what Chu pointed out:

$$\begin{align*}
\textrm{d} w &amp;= v\:\textrm{d} q&amp;  Q&amp;=C\: V\\
&amp;\therefore\\
\int \textrm{d} w &amp;= \int_0^Q v\:\textrm{d} q\\\\
W &amp;= \int_0^Q v\:\textrm{d} q &amp;
 &amp;=\int_0^Q \frac{q}{C}\:\textrm{d} q\\\\
&amp;= \frac{1}{C} \int_0^Q q\:\textrm{d} q &amp;
&amp;= \frac{1}{C} \left[\frac{1}{2}q^2\right]\bigg|_0^Q\\\\
&amp;= \frac{1}{C} \left[\frac{1}{2}Q^2\right] &amp;
&amp;= \frac{1}{C} \left[\frac{1}{2}C^2V^2\right]\\\\
&amp;= \frac{1}{2} C \: V^2
\end{align*}$$

That's the work/energy stored on a capacitor.