Magnetostatic energy density -- derivation without introducing inductance? I was looking for a derivation of the expression for the energy density at any point in a static magnetic field. I do know that it is 
$$u_B=\dfrac {1}{2 \mu_0}\left|\mathbf{B}\right|^2,$$
I was just wondering if there was a derivation that could be built up the way one derives the energy density,
$$u_E=\dfrac {\epsilon_0}{2}\left|\mathbf{E}\right|^2$$
at any point in an electric field, by considering the energy needed to build up a 'source' charge bit by infinitesimal bit.
Whatever proof I have come across seems to bring inductance into the picture -- is there a way of doing it without that? I ask because the corresponding proof for the electric field does not seem to need the definition of capacitance anywhere.
 A: It's a reasonable question, and the answer is: one can't prove it, without introducing induction.
Consider a conducting loop with no current. Then someone starts creating a current in it, using, for example, a battery. The question is: why should we perform work to create this current, if we know that magnetic force $$ \mathbf {F} = \frac{q}{c}[\mathbf{v},\mathbf{B}]$$ is always perpendicular to the charge's displacement (thus it doesn't perform work at all)? The answer for this is  that when current appears, magnetic field changes, thus electric field is created. Electric field acts upon charges with the force $$ \mathbf {F} = q\mathbf{E}$$ and because of that we must take an effort to create the current.
Moreover, it holds true in general case. We must $\textit {always}$ work against electric field in order to create magnetic field. In some sense, it is meaning of magnetic energy.
The best way to introduce magnetic and electric energy is Poynting theorem. It states:
$$\mathbf{E}\cdot\mathbf{j}+\frac{\partial u}{\partial t}=-\triangledown\mathbf{S}$$ where $u=\frac{E^2}{8\pi}+\frac{B^2}{8\pi}$, $\mathbf{j}$ is current density and $\mathbf{S}$ is Poynting vector.
I strongly recommend you to read a corresponding Feynman's lecture, you will defenetly get the sense of these things.  
$\textbf{PS:}$ I used CGS system here, I hope it didn't bug you very much.
A: You can certainly do the derivation without resorting to the inductance. When it comes about to consider the contributions of induced electromotive forces $V_i$ you can consider that
$$
V_i=-\frac{d\Phi}{dt}
$$
where $\Phi$ is the flux of the magnetic field $B$ through the surface of the circuit you're considering.
You can find a derivation according to this line of reasoning in the text from Stratton.
A: Have you considered Poynting's theorem? It originates from the general derivation of the energy density contained in the electric and magnetic fields (starting from the Lorentz force and the definition of work).
A: Magnetic Field



We set $$|\textbf{B}|=B$$ to simplify the notation and assume $$\textbf{B}=\mu_0\textbf{H}$$



Energy density contained in magnetic field: $$\begin{aligned}du_B&=H{\cdot}dB\\&=\frac{1}{\mu_0}B{\cdot}dB\end{aligned}$$



We build magnetic source bit by infinitessimal bit then the field $B$ is increased bit by infinitessimal bit $dB$ until $B$ (from $0$ to $B$), then the energy density contained in the field is



$$\begin{aligned}u_B&=\frac{1}{\mu_0}\int_0^B{B}{\cdot}dB\\&=\frac{1}{2\mu_0}B^2\\&=\frac{1}{2\mu_0}|\textbf{B}|^2\end{aligned}$$



Hope this will answer your question

A: Actually the energy cannot come out of nowhere.In case of electrostat the energy was in the form of"BINDING ENERGY" that holds the system together, rather the charge configuration although the charges repel each other with tremendous amount of force. But in case of magnetic field there is no such thing. So where is the energy coming from? 
Now the magnetic field must grow in time to its final value from 0 along with the current. Now notice there will be a time varying magnetic field which will generate an non conservative electric field. This will perform negative work on moving charges in the current. This work done against the motion of charges trying to oppose the growth of current will be stored in the form of energy in the magnetic field. Remember the negative work would only be done by the "NON CONSERVATIVE " electric field (not by the conservative as the conservative field drives the charges) only on the "FREE CHARGES" against the free current (NOT ON THE BOUND CURRENT BECAUSE BOUND CURRENT ISNT CARRIED BY CHARGES)
So the energy growing in small time dt in a small elemental volume dv is given by 
Now this is for some volume and enclosed surface area for it. Now as we increase the volume towards infinity then all the E and H fields will tend to 0. So for all space integral the surface integral goes to 0. So this is what remains.
Therefore we may consider energy stored per unit volume as H.dB integral over its time growth.Look, that this depends on how B has grown with H.
In free space since there is no magnetization B=uoH and so energy density is B^2/2uo. But for linear isotopic homogeneous diamagnetics it is B^2/2u and for magnetic core it is the AREA UNDER H-B HYSTERESIS CURVE.
The energy may be "stored" in "free" as well as "bound" current distribution although it is generated by the negative work on "free" currents only. BUT, when all currents are removed or diminished the energy is gradually or quickly LOST AS HEAT.this results in hysterisis loss and heat generated in RL DECAY CIRCUIT.
