I'm facing a doubt in the derivation of the magnetic field inside an infinitly long solenoid of radius $R$.

To derive $B$ all the loops in the solenoid are considered: in a lenght $dx$ there are $n\,dx$ loops, each producing a magnetic field, so we have:

$$d B= \frac{\mu_0}{4 \pi} \frac{R^2}{(R^2+x^2)^{\frac{3}{2}}} n \,dx$$

In order to get $B$, consider separately cases $1$ and $2$ as in picture. In the two cases the current flows as indicated ($\times$ is entering the screen, $\odot$ goes out of the screen), but the angles (in case $1$ $\theta$, in case $2$ $\phi$) are measured from the two opposites sides of the solenoid.

enter image description here

Case $1$:

$$\sqrt{R^2+x^2} \,\,\mathrm{sin \theta}=R$$

$$x-x_0=R \mathrm{cotg \theta} \to dx=-\frac{R}{\mathrm{sin^2 \theta}} d\theta$$

$$B(x_0)=\frac{\mu_0 n i }{2} \int_{\theta_1}^{\theta_2} -\mathrm{sin{\theta}} \,\,\,d\theta =\frac{\mu_0 n i }{2} (\mathrm{cos\theta_2}-\mathrm{cos\theta_1})$$

Case $2$:

$$\sqrt{R^2+x^2} \,\,\mathrm{sin \phi}=R$$

$$x-x_0=-R \mathrm{cotg \phi} \to dx=\frac{R}{\mathrm{sin^2 \phi}} d\theta$$

$$B(x_0)=\frac{\mu_0 n i }{2} \int_{\phi_1}^{\phi_2} \mathrm{sin{\phi}} \,\,\,d\theta =\frac{\mu_0 n i }{2} (\mathrm{cos\phi_1}-\mathrm{cos\phi_2})$$

Here is the problem: in both cases the limit condition of infinitely long solenoid is that the first angle ($\phi_1$ or $\theta_1$) is $0$ and the second angle ($\phi_2$ or $\theta_2$) is $\pi$.

Nevertheless making substituition in case $1$ I get

$$B=-\mu_0 n i$$

while in case $2$ I get

$$B=+\mu_0 i n $$

which is the correct result.

Is there a particular reason why the angle measurement must be done as in case $2$ and not as in case $1$ to get the correct result? Or are both method valid? If so, how is it possible to get a different result just because orientation of angle measurement?

  • $\begingroup$ -1. I don't consider this to be a useful question. The 2 diagrams are the same, just reversed. This is a trivial confusion over mathematics. No useful physics here, in my opinion. $\endgroup$ Jan 6, 2017 at 2:04

1 Answer 1


Since the only difference is a sign change, you really have to be very careful about conventions along the way. You didn't actually specify in your second integral whether you want to integrate from $\phi_1$ to $\phi_2$, or the other way around - and that will obviously affect your result.

Usually in cases like this you can make your life simpler by using a diagram to determine the direction (sign) of B, and then forgetting about signs until right at the end, when you can add a minus sign if needed...

I realize that is the pragmatic approach. If you want the careful approach, I recommend that you ask yourself about the order of integration. When you changed how you measured $\phi_1$, its complement was labeled as $\theta_2$... meaning you reversed the "start" and "stop" angles. Which will give you a sign change.

  • 1
    $\begingroup$ Thanks for the answer, I'm sorry I fixed the order of integration also in the second integral which is from $\phi_1$ to $\phi_2$ $\endgroup$
    – Sørën
    Jan 6, 2017 at 1:35
  • 1
    $\begingroup$ OK - so you are changing the direction of integration - anti-clockwise in $\theta$, clockwise in $\phi$. So of course you will get a sign change. $\endgroup$
    – Floris
    Jan 6, 2017 at 1:36
  • $\begingroup$ Exactly, the directions of integration are opposite, but I don't understand how this could affect the sign of the result since I'm just "summing" the magnetic field of each loop in a different order.. Would you be so kind as to say a bit more on this point? $\endgroup$
    – Sørën
    Jan 6, 2017 at 1:51
  • $\begingroup$ The integral of $\int_0^1 dx = 1$, but $\int_1^0 dx = -1$. That's just how integrals work... $\endgroup$
    – Floris
    Jan 6, 2017 at 2:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.