Electrodynamics/Electric Energy

Introduction
Many objects in this universe are conservative, the charge of the universe for instance always remains constant. This is called Global Conservation of Charge. But also, if you take a defined area, then the charge in that also remains constant unless some is leaving through its boundary. And if some charge is moving through the boundary, then it must be equal to the change in charge in the volume. Just like if you and your friends are in a room, you cannot just not be in the room, you must go out the door.

This is called Local Conservation of Charge.

Charge Conservation
Let's look at the total charge enclosed by a volume V:


 * $$ Q_{enc}(t) = \int_V \rho (\mathbf{r}) dV $$

We'll say that the charge inside V changes according to the equation


 * $$ \frac{dQ_{enc}}{dt} = \int_V \frac{\partial \rho (\mathbf{r})}{\partial t} dV $$

We could consider a current through a closed service, the boundary of V ( $$ \partial V $$ ) for example, which would be


 * $$ I = \int_{ \partial V } \mathbf{J} \cdot \mathbf{\hat{n}} dS $$

We can now bring in the equation $$ I = \frac{dQ}{dt} $$ and relate it to the enclosed charge. We see that the corresponding equation is


 * $$ - \frac{dQ_{enc}}{dt} = \int_{ \partial V } \mathbf{J} \cdot \mathbf{\hat{n}} dS $$

Because there positive flux of the current density (charge leaving V) when the enclosed charge is decreasing.

We see that


 * $$ - \int_V \frac{\partial \rho (\mathbf{r})}{\partial t} dV = \int_{ \partial V } \mathbf{J} \cdot \mathbf{\hat{n}} dS $$

Then by using the divergence theorem on the right hand side, we get the law of local conservation of charge or the continuity equation.


 * $$ \frac{d\rho}{dt} + \nabla \cdot \mathbf{J} = 0 $$

Conservation of Energy

 * $$\frac{\partial}{\partial t} (u_{mechanical} + u_{electro magnetic}) = - \nabla \cdot \mathbf S$$

Where


 * $$ \mathbf S = \frac{1}{\mu_0} (\mathbf{E} \times \mathbf{b})$$