Poynting's theorem - energy conservation Poynting's theorem:
$$\int_V\left(\vec{E}\cdot\vec{J}\right)\,\mathrm dV = -\dfrac{\partial}{\partial t}\int_V\dfrac{1}{2}\left(\epsilon_0 E^2 + \dfrac{1}{\mu_0}B^2\right)\,\mathrm dV - \dfrac{1}{\mu_0}\oint_S \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S}$$
My question is with regards to how this proves conservation of energy?
The first integral gives the power gained by charges in a volume. The second integral gives the power lost in the electric and magnetic fields. It can be shown independently that these interpretations for these mathematical terms makes sense. It's the third integral that bothers me.
I've looked at proofs online... and they all make the step of simply "interpreting" the last term as the power entering the surface of the volume. So they make the assumption that energy is conserved and hence interpret the last term accordingly.
But this is not a proof of conservation of energy. A proof would require independent reasons to consider the last term as the power flux entering the volume.
Contrast this with conservation of charge within electromagnetism. Conservation of charge is a consequence of Maxwell's equations, it does not have to be assumed independently.
Basically I want to find out... is energy conservation a consequence of Maxwell's equations or something assumed independently from it?
 A: Let the electromagnetic field has $u$ as its energy density (amount of energy per unit volume in the field) and let $\bf S$ represents the energy flux- the amount of energy per unit time flowing across a unit area perpendicular to the flow).
Now electromagnetic field can interact with matter and do work on them; so this energy interaction must be considered when discussing energy conservation.
The field energy inside a volume $V$ is $\displaystyle \int_V u\,\mathrm dV\;.$ Amount of energy flowing out of the volume $V$ is given by $\displaystyle \int_\Sigma \mathbf S\cdot n\,\mathrm da \;.$
Now, the work done per unit time by the field on the matter inside the volume $V$ is given by $\displaystyle \int _V Nq(\mathbf E + \mathbf v\times \mathbf B)\cdot \mathbf v\,\mathrm dV$ where $N$ is the number of particles per unit volume; this can be written as \begin{align}\int _V Nq(\mathbf E + v\times \mathbf B)\,\mathrm dV& = \int_V Nq\mathbf E\cdot v\,\mathrm dV\\ &= \int_V \mathbf E\cdot \underbrace{(Nq\mathbf v)}_\textrm{current-density}\,\mathrm dV\\ &= \int_V E\cdot \mathbf J\,\mathrm dV \end{align}
So, the continuity equation is written thus: $$\underbrace{-\frac{\partial}{\partial t}\int_V u\,\mathrm dV}_\textrm{rate of change of energy inside volume $V$}=\underbrace{\int_\Sigma \mathbf S\cdot \mathbf n\,\mathrm da}_\textrm{amount of $\mathbf{field\, energy}$ flowing out of volume $V$ per unit time} + \underbrace{\int_V \mathbf E\cdot \mathbf J\,\mathrm dV}_\textrm{work done per unit time by the field on the matter inside volume $V$} \;. $$ This definitely implies the conservation of energy and moreover, the equation which OP wrote in his query is the offshoot of this same continuity equation.
Energy density and Poynting Vector:
We can write the differential form of the continuity equation above as:
$$-\frac{\partial u}{\partial t}= \textrm{div}\,\mathbf S + \mathbf E\cdot \mathbf J$$ (since, all the derivation is done in Cartesian coordinates, then $\textrm{div}\equiv \mathbf \nabla$).
Or, we can write $$\mathbf E\cdot \mathbf J= -\frac{\partial u}{\partial t}-\mathbf E\cdot \mathbf J\tag 1$$
In order to find out what $u$ and $\bf S$ actually are, it is assumed that they solely depend on the fields $\bf E$ and $\bf B\;.$
Now, using $$\mathbf J = \epsilon_oc^2\,\mathbf \nabla\times\mathbf B- \epsilon_0\frac{\partial\mathbf E}{\partial t}\,,$$ we can write $\mathbf E\cdot \mathbf J$ as $$\mathbf E\cdot \mathbf J= \epsilon_oc^2\,\mathbf E\cdot (\mathbf \nabla\times\mathbf B)- \epsilon_0\mathbf E\cdot\frac{\partial\mathbf E}{\partial t}\;.$$
Now, \begin{align}\mathbf E\cdot (\mathbf \nabla\times\mathbf B)&= (\mathbf \nabla\times\mathbf B)\cdot \mathbf E\\ &= \mathbf \nabla\cdot (\mathbf B\times\mathbf E)+ \mathbf B\cdot (\mathbf \nabla \times \mathbf E)\;.\end{align}
Therefore, \begin{align}\mathbf E\cdot \mathbf J&=\epsilon_oc^2\,\mathbf \nabla\cdot (\mathbf B\times\mathbf E)+\epsilon_oc^2\,\mathbf B\cdot (\mathbf \nabla \times \mathbf E)-\epsilon_0\mathbf E\cdot\frac{\partial\mathbf E}{\partial t}\\ &=\epsilon_oc^2\,\mathbf \nabla\cdot (\mathbf B\times\mathbf E)+\epsilon_oc^2\,\mathbf B\cdot (\mathbf \nabla \times \mathbf E)-\frac{\partial}{\partial t}\,\left(\frac12 \epsilon_0\,\mathbf E\cdot \mathbf E\right)\\ &=\mathbf \nabla\cdot (\epsilon_oc^2\,\mathbf B\times\mathbf E)+ \epsilon_oc^2 \mathbf B\cdot \left(-\frac{\partial\mathbf B}{\partial t}\right)-\frac{\partial}{\partial t}\,\left(\frac12 \epsilon_0\,\mathbf E\cdot \mathbf E\right)\\ &=\mathbf \nabla\cdot (\epsilon_oc^2\,\mathbf B\times\mathbf E) - \frac{\partial}{\partial t}\left(\frac{\epsilon_oc^2}{2}\,\mathbf B\cdot \mathbf B+ \frac{\epsilon_0}2 \,\mathbf E\cdot \mathbf E\right) \tag 2\end{align}
Comparing $(1)$ and $(2)\,,$ we get $$u = \frac{\epsilon_0}2 \,\mathbf E\cdot \mathbf E+\frac{\epsilon_oc^2}{2}\,\mathbf B\cdot \mathbf B\\ \mathbf S=\epsilon_oc^2\,\mathbf E\times\mathbf B \;.$$
This vector $\bf S\,,$ that is the energy flux vector we considered at the beginning of the making up of the continuity equation, is called the Poynting Vector.
The whole derivation is based on the continuity equation, which is the mathematical expression of conservation of energy.
OP can conclude the equation he wrote in the question by converting the differential form of equation $(2)$ into integral form; using the definition of $u$ and $\bf S$ derived above and lastly using Gauss's theorem.
References:
$\bullet$ Lectures on Physics by Feynman, Leighton, Sands.


you're saying that energy conservation is needed as an independent equation, in order to deduce that the Poynting vector gives energy flux. I don't think this is true. I think the energy continuity equation can be shown as a consequence of Maxwell's equations.

No! Never, ever I've made such statement. I've answered to your query I know the books say it represents energy flux, but how do you prove it represents energy flux?; that's it. What I've done is to clearly present the continuity equation before OP and have tried to clearly interpret each term and how they together imply conservation of energy. The continuity equation can indeed be derived from Maxwell's equation and this is what I've done to define $u$ and $\bf S\;.$ I'm really pretty upset on the allegation OP made.

But this is not a proof of conservation of energy.

It's indeed a proof of conservation of energy.

Contrast this with conservation of charge within electromagnetism. Conservation of charge is a consequence of Maxwell's equations, it does not have to be assumed independently.

Okay, let's fix this thing. Conservation of charge implies this continuity equation(this can be derivable from Maxwell's equations):
$$-\frac{\partial \rho_V}{\partial t}= \mathbf \nabla \mathbf J\;.$$
This suggests conservation of energy would look like:
$$-\frac{\partial u}{\partial t}= \mathbf \nabla \mathbf S\;.$$
But that is incomplete as it is the total energy and not just field energy which is conserved; the interaction of field with matter has to be taken into consideration.

is energy conservation a consequence of Maxwell's equations or something assumed independently from it?

Yes. The continuity equation meant for conservation of energy is derived from Maxwell's equation; that's how the definition of $u$ and $\bf S$ have been computed. OP must be confused to see in my answer first the continuity equation as if I'm saying continuity equation should be considered independently in order to consider conservation of energy. No! That was intentionally done in order to conceive that the Poynting Theorem indeed implies conservation of energy.
A: Poynting's theorem is the work-energy theorem in electrodynamics. The equation tells us that the total power (or energy) carried by an electromagnetic wave is equal to the decrease in the energy stores in the field (first term) minus the energy radiated out from the filed (second term). The radiated energy will never come back. It's gone. The radiated energy is nothing but some part of the energy carried by the EM wave. So energy radiation means there is a decrease in energy in the filed. This is as required by the conservation of energy. It makes sense. If no energy is radiated out, then the energy carried by the filed will be equal to the energy stored in the field. If all the energy radiates out, then the wave attenuates as no energy is left within the filed.
The EM wave is created by oscillating charges. So there will be acceleration. So the field generated by such a charge contains acceleration dependent term and velocity dependent term. It's the former that causes radiation. The latter is the energy stored in the field.
A: I'll try to show here that energy conservation (the energy continuity equation), as well as the interpretation of the Poynting vector as the energy flux, are consequences of Maxwell's equations.
Poynting's theorem:
$$\int_V\left(\vec{E}\cdot\vec{J}\right)\,\mathrm dV = -\dfrac{\partial}{\partial t}\int_V\dfrac{1}{2}\left(\epsilon_0 E^2 + \dfrac{1}{\mu_0}B^2\right)\,\mathrm dV - \dfrac{1}{\mu_0}\oint_S \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S}$$
The definition of
$P_E = \int_V\dfrac{1}{2}\epsilon_0 E^2 \,\mathrm dV$ as electrical potential energy and
$P_M = \int_V\dfrac{1}{2\mu_0} B^2 \,\mathrm dV$ as magnetic potential energy
comes from electrostatics and magnetostatics.
Kinetic energy, $K = \int_V\left(\vec{E}\cdot\vec{J}\right)\,\mathrm dV $
So Poynting's theorem can be written simply as:
$$\dfrac{\mathrm d}{\mathrm dt}\left(K+P_E+P_M\right) = - \dfrac{1}{\mu_0}\oint_S \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S}$$
Now suppose space is split up into 2 regions (one may be a closed region, the other may be open, or both may be open), divided by a surface S (S1 encloses region 1, S2 encloses region 2. same surface with opposite normals).
Write Poynting's theorem for each surface:
$$\dfrac{\mathrm d}{\mathrm dt}\left(K_1+P_{E_1}+P_{M_1}\right) = - \dfrac{1}{\mu_0}\oint_{S_1} \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S}$$
$$\dfrac{\mathrm d}{\mathrm dt}\left(K_2+P_{E_2}+P_{M_2}\right) = - \dfrac{1}{\mu_0}\oint_{S_2} \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S}$$
$$\dfrac{1}{\mu_0}\oint_{S_1} \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S} = - \dfrac{1}{\mu_0}\oint_{S_2} \left(\vec{E}\times\vec{B}\right)\cdot\,\mathrm {d\vec S}$$
So
$$\dfrac{\mathrm d}{\mathrm dt}\left(K_1+P_{E1}+P_{M1}\right) = - \dfrac{\mathrm d}{\mathrm dt}\left(K_2+P_{E2}+P_{M_2}\right)$$
$$\dfrac{\mathrm d}{\mathrm dt}\left(K_1+P_{E_1}+P_{M_1}+K_2+P_{E_2}+P_{M_2}\right) = 0$$
So since total energy in the two regions does not change (implying energy conservation directly from Maxwell's equations), we may interpret the net loss in energy in a particular region, as energy leaving the region... hence we can interpret it as the Poynting vector.
It's the same idea no matter how many regions we split up space into.
