
We now have to balance the real space and reciprocal space summations, as the former converges rapidly for large values of α while the latter does for small values of α. It should be noted that the summation of the reciprocal term corresponds to the
term as defined earlier. However the sum of Gaussian functions in real space computes and includes the interaction of each Gaussian with itself, so this needs to be subtracted.

Finally a fourth correction term is also required. This terms is due to the effect of the surrounding medium on the boxes. For a perfect conductor no correction is needed, however for vacuum i.e with a relative permittivity of one, the following energy must be added:

So the total contribution from all the potential is equal to equations 30,32, 33 and 34
