The electric energy stored in a system of two point charges $Q_1$ and $Q_2$ is simply $$W = \frac{1}{4\pi\epsilon_0}\frac{Q_1Q_2}{a}$$ where $a$ is the distance between them.
However, the total energy can also be calculated through the volume integral of magnitude squared of the electric over all space: $$W = \frac{\epsilon_0}{2}\int_{\mathbb{R}^3} E^2\,dV$$
Suppose that $Q_1$ sits on the origin and $Q_2$ a distance $a$ away on the $z$-axis. Then the electric field is $$\vec{E}(x,y,z) = \frac{1}{4\pi\epsilon_0}\left[\left(\frac{Q_1}{r^3} + \frac{Q_2}{d^3}\right)x\hat{x} +\left(\frac{Q_1}{r^3} + \frac{Q_2}{d^3}\right)y\hat{y} + \left(\frac{Q_1z}{r^3} + \frac{Q_2\left(z-a\right)}{d^3}\right)\hat{z}\right]$$ where \begin{align} r &= \sqrt{x^2+y^2+z^2} \\ d&= \sqrt{x^2+y^2+\left(z-a\right)^2} \end{align}
Calculating $W$ through $\int_{\mathbb{R}^3} E^2\,dV$ seems extremely difficult; Mathematica, for example, appears stumped. Yet its result should simply be $\frac{1}{4\pi\epsilon_0}\frac{Q_1Q_2}{a}$, correct? The integral formula still applies to point charges, correct?