# Energy density what volume?

In a derivation of energy density for an electric field (see here) We get rid of the $$\epsilon_0\oint(V \vec E \cdot d\vec a)$$ term by choosing a surface sufficiently far away so that this term vanishes. This leaves us with the expression: $$W=\int\frac{\epsilon_0}{2}E^2d\tau$$ And then we can conclude that the energy density is: $$u_E=\frac{\epsilon_0}{2}E^2$$ But let us say we did not chose a surface at infinity, but rather one relative close to the charge distribution. Would we still get the energy density? Or would we get an energy density that when integrated over the smaller volume (enclosed by the new surface) gives us the total energy $W$. i.e. Does the energy density depend on the surface that we use, in either case please can you explain why?

• you still have density given by $u_E$, so that the energy in a volume $V$ is the integral over $V$ of $u_E$, but the work done to assemble this configuration needs the flow term that becomes negligible at infinity, otherwise you would get the wrong result. – Phoenix87 Feb 10 '15 at 14:43
• I think you are misunderstanding the statement. It is doing a simple substitution: $W=\int\frac{\epsilon_0}2E^2d\tau=\int u_Ed\tau$, which requires the definition $u_E=\epsilon_0E^2/2$. – Kyle Kanos Feb 10 '15 at 15:06

I understand that in fact, your problem is

Does the energy density depend on the surface that we use? In either case please can you explain why?

I followed the text that you indicate, and the answer is yes, the energy depends on that surface. After deriving the formula

$$W = \frac {1}{2} \sum _i q_i \left( \sum_{j \ne i, j=1} ^n \frac {1}{4 \pi \epsilon_0} \frac {q_j}{r_{i,j}}\right) \, ,$$

the author of the text said "We can now pull the charge $q_i$ out of the sum", and he pushes this charge to the distance $r_{i,j} = |\vec r_i - \vec r_j|$, where $\vec r_i$ is fix and $\vec r_j$ runs over the rest of the charges.

Then the author says that the expression inside the round parentheses is a potential $V_i$ that acts on the charge(s) $q_i$, i.e. at the location of the charge(s) that he pulled out from the bulk of charges $q_j$,

$$W = \frac{1}{2} \sum _i q_i \ V(r_i),$$

and he transform the sum into an integral. The integral is over the volume occupied by the removed charges. This is why the work depends on the radius of this volume, and ultimately the energy inside. Because with the radius, i.e. with how far you move the charges, changes also the invested work.