# Trying to find the magnetic force applied by an infinite wire on a circuit both carrying different currents

The problem I'm trying to solve is:

#### We have:

• An infinite wire carrying the current I and creating the magnetic field: $$\vec{B}(M) = \frac{\mu_0I}{2\pi\rho}\vec{e}_{\phi}$$
• A square shaped loop carrying the current I'.
• I considered the point O to be the origin.

And I'm asked to find the force applied by the infinite wire on the loop.

So directly using Lorentz force: $$\vec{F} = I\cdot\int_{C} \vec{dl}\times\vec{B}$$. We have for this problem:

\begin{align} \vec{F} & = I^\prime\int_{QRSP} \vec{dl} \times \vec{B} \\ & = I^\prime\int_{QRSP}\vec{dl}\times\frac{\mu_0I}{2\pi\rho}\cdot \vec{e}_{\phi} \\ & = \frac{\mu_0II^\prime}{2\pi}\int_{QRSP}\vec{dl}\times\frac{1}{\rho}\cdot \vec{e}_{\phi} \\ & = \frac{\mu_0II^\prime}{2\pi}\left( \underbrace{(\int_b^{b+a}d\rho\vec{e}_{\rho} \times \frac{1}{\rho} \vec{e}_{\phi})}_{\vec{F}_{QR}} + \underbrace{(\int_a^{0}-dz\vec{e}_{z} \times \frac{1}{a+b} \vec{e}_{\phi})}_{\vec{F}_{RS}} + \underbrace{(\int_{b+a}^{b}-d\rho\vec{e}_{\rho} \times \frac{1}{\rho} \vec{e}_{\phi})}_{\vec{F}_{SP}} + \underbrace{(\int_0^{a}dz\vec{e}_{z} \times \frac{1}{b} \vec{e}_{\phi})}_{\vec{F}_{PQ}} \right) \\ \\ & \textrm{Switching the bounds of the second and third integrals gives:} \\ \\ & = \frac{\mu_0II^\prime}{2\pi}\left( (\int_b^{b+a}d\rho\vec{e}_{\rho} \times \frac{1}{\rho} \vec{e}_{\phi}) + (\int_0^{a}dz\vec{e}_{z} \times \frac{1}{a+b} \vec{e}_{\phi}) + (\int_{b}^{b+a}d\rho\vec{e}_{\rho} \times \frac{1}{\rho} \vec{e}_{\phi}) + (\int_0^{a}dz\vec{e}_{z} \times \frac{1}{b} \vec{e}_{\phi}) \right) \\ & = \frac{\mu_0II^\prime}{2\pi}\left( (\int_b^{b+a}\frac{d\rho}{\rho}\vec{e}_z) + (\int_0^a-\frac{dz}{b+a}\vec{e}_{\rho}) + (\int_b^{b+a}\frac{d\rho}{\rho}\vec{e}_z) + (\int_0^a-\frac{dz}{b}\vec{e}_{\rho}) \right) \\ & = \frac{\mu_0II^\prime}{2\pi}\left( 2\cdot(\int_b^{b+a}\frac{d\rho}{\rho}\vec{e}_z) - \int_0^a ( \frac{1}{b} + \frac{1}{a+b} )dz\vec{e}_{\rho} \right) \\ \vec{F} & = \frac{\mu_0II^\prime}{2\pi}\left( 2\ln(\frac{b+a}{b})\vec{e}_z - a\cdot\frac{2b +a}{b(b+a)}\vec{e}_{\rho} \right) \end{align}

But according to the solution given to us $$\vec{F}=-\frac{\mu_0II^\prime a^2}{2\pi(a+b)}\vec{e}_{\rho}$$ or by using logic we can observe that the two forces, the one applied on QR and the one applied on SP are opposite and their sum is $$\vec{0}$$.

But the above calculation I did doesn't lead to that and I'm wondering where is the error.

I think while taking the line integral along SP and RS. There is no need to switch the bounds of integration cause we are just adding up the dl's. The direction is already included in the cross product Instead the bounds of integration should be the same for both directions. That way $$\vec{F_{QR}}=-\vec{F_{SP}}$$ And they cancel out. Also there is need to parametrize but in this case, it would work out.

• You are absolutely right!, I get it now, because dl in SP is already in the opposite direction, so no need to switch the bounds cause we are just taking the sum of dl x B across SP, so the bounds should stay the same for both directions. Thank you @Alv. Jun 3, 2023 at 16:54
• I get it now, the important thing is that the bounds of the line integral across QR and SP should be the same and not one the opposite of the other. ( Same thing for RS and PQ ). Btw you saved me a lot of headache for the past hours. Thanks again. Jun 3, 2023 at 17:04
• The bounds worked out because out it was a simple case. Usually it is better to parametrize the curve.:)
– Alv
Jun 3, 2023 at 17:59