When we derive equation for energy of electric field, we end up below during the process $$U=\frac{\epsilon_0}{2}\left[\int (\nabla\phi)\cdot(\nabla\phi)dV-\int\nabla\cdot(\phi\nabla\phi)dV\right]$$ and then, $$U=\frac{\epsilon_0}{2}\left[\int (\nabla\phi)\cdot(\nabla\phi)dV-\oint(\phi\nabla\phi)\cdot d\mathbf a\right]$$ I think I can quiet grasp the idea that when we integrate over the entire space, the second term will be calculated to have $r^{-1}$ term which leads to zero, thus negligible.
But my question is, do we always pretend that second term is zero? Is there any situation where we need to account the second term?
Such as when we are dealing with parallel plate condenser, especially the infinite sized case, second term doesn't seem like to go zero at all in that case.
And what about the case of energy density? though we write $$u=\frac{\epsilon_0 E^2}{2}$$ when electric field is close to the source or where electric field is strong enough, the second term seemingly no longer obsolete thus I thought maybe there's a case where we calculate energy density of electric filed by $$u=\frac{\epsilon_0 E^2}{2}+\frac{\epsilon_0}{2}\nabla\cdot(\phi \mathbf E)$$
If we never use the second term, why is that? Is there any way to prove that second term is always negligible?