# Derivation of force between two current carrying wires using interaction energy?

Consider the following derivation of the force between two current carrying wires:

The energy in a magnetic field is: $$dE_T=\frac{1}{2\mu_0} B^2dV$$ so the interaction energy between two fields $\vec B_1$ and $\vec B_2$ is: $$dE_I=\frac{1}{\mu} \vec B_1 \cdot \vec B_2dV$$ For two current carrying wires this becomes (working per unit length and in a plane): $$E_I=\frac{\mu_0I_1I_2}{(2\pi)^2} \int\frac{\hat \theta_1 \cdot \hat \theta_2}{r_1r_2}dA=\frac{\mu_0I_1I_2}{(2\pi)^2} \int\frac{\hat r_1 \cdot \hat r_2}{r_1r_2}dA$$ If the two wires are separated by $\vec R$ such that $\vec r_2=\vec R+\vec r_1$ this can be written as: $$E_I=\frac{\mu_0I_1I_2}{(2\pi)^2} \int\frac{r_1^2+Rr_1\cos(\theta)}{r_1^2(r_1^2+R^2+2r_2R\cos(\theta))}(r_1 dr_1 d\theta)$$ where $\theta$ is the angle between $\vec R$ and $\vec r_1$. Integrating over $r_1$ between $0$ and $a\rightarrow \infty$ gives: $$E_I=\frac{\mu_0I_1I_2}{(2\pi)^2}\left[- \int^{2\pi}_0 \ln(R) d\theta+\lim_{a\rightarrow \infty}\int^{2\pi}_0\ln(a^2+R^2+2aR\cos(\theta))d\theta\right]$$ We now differentiate with respect to $R$: $$\frac{dE_I}{dR}=\frac{\mu_0I_1I_2}{(2\pi)^2}\left[- \frac{2\pi}{R}+\lim_{a\rightarrow \infty}\int^{2\pi}_0\frac{2R+2a\cos(\theta)}{a^2+R^2+2aR\cos(\theta)}d\theta\right]$$ where the second intergral vanishes in the limit $a\rightarrow \infty$. Thus: $$\frac{dE_I}{dR}=-\frac{\mu_0I_1I_2}{2\pi R}$$ which gives a force (per unit length) of: $$F=\frac{\mu_0I_1I_2}{2\pi R}$$

Now I am confident that there are no obvious mistakes in this derivation (it has been checked numerous times and integrals done with numerical values). But although it gets the correct numerical value for the force - the sign is wrong. This seems to indicate an increase in the interaction energy with decreased separation and hence that parallel running currents would repel - which is not the case. What is going on here to make this derivation invalid, or if it is valid why do we get this variation in interaction energy.

(p.s. I am fully aware that this is by no means the easiest way to derive this equation - I am using it to derive an analogous expression for the force between vortexes in $He^4$ superfluids).

• I'm not exactly familiar with it, and I'd have to look it up again, but you do also have to take into account that the wires moving towards each other will result in a force on the charges inside the current, thus slowing it down. The Devices that do provide a steady current will have to use additional energy in Order for the current to maintain the same, and this results in the exact opposite sign for the force. – Quantumwhisp Aug 20 '17 at 9:09
• @Quantumwhisp I'm not sure - you never have to take account of these things when deriving the force using $\vec I \times \vec B$ which gives you the correct direction of force. – Quantum spaghettification Aug 20 '17 at 9:13
• Yes, but when you do it the way you proposed, you just look at the Force at the wire, which you want to derive from the Lorentz force. Nothing special there. In your Question, you want to derive the force from the Energy. What you implicitly do there is the assumption that the Energy is a conserved quantity, effectively an increase in potential energy (that would be what you calculate as Interaction energy) is a decrease in kinetic energy (which yields your force). If you do it that way, then you'll have to take into account all energies appearant. – Quantumwhisp Aug 20 '17 at 10:28
• I have to correct my self: The force on the charges inside the wires is not due to lorenz force, but instead due to an increasing magnetic field in the wire, which induces an electric field: If the wires move towards each other, they in that process create an electric field which will slow down the current. – Quantumwhisp Aug 20 '17 at 10:49
• In your interaction energy equation $dE_I=\frac{1}{\mu} \vec B_1 \cdot \vec B_2dV$ is the result positive when the two magnetic fields are in the same direction? – Farcher Aug 20 '17 at 11:08