# Using Biot Savart law for magnetic field of a wire gives wrong results when integrating over angle

So, most of the documents on the internet use Biot Savart law and integrate over length of the wire (from minus infinity to infinity) for an infinite wire magnetic field, but I have tried to integrate over the angle.

Here is how I do it. The point P is placed at radius R away from the wire. The wire fragment $$dl$$ is at distance $$r$$ from this given point. The angle between $$r$$ and the wire itself is $$\theta$$.

I have decided to use this form of Biot Savart law: $$dB = \frac{\mu_0 I}{4 \pi} \frac{\vec{dl} \times \vec{r}}{|\vec{r}|^3}$$

So, I have started derivng all required variables.

First of all, for a change in angle $$d \theta$$, the $$dl$$ is equal $$dl = r(\theta) d \theta$$, where $$r(\theta)$$ is equal to $$\frac{R}{sin(\theta)}$$, so finally: $$dl = \frac{R d\theta}{sin(\theta)}$$

Now, the vector component of $$\vec{r}$$ which is perpendicular to the wire is always equal to $$R$$.

This means, that the cross product $$\vec{dl} \times \vec{r}$$ is simply equal to: $$\vec{dl} \times \vec{r} = \frac{R^2 d\theta}{sin(\theta)}$$

Now I just need the $${|\vec{r}|^3}$$ part which is simply equal to: $${|\vec{r}|^3}= \frac{R^3}{sin^3(\theta)}$$

Plugging all those values to my equation i get: $$dB = \frac{\mu_0 I}{4 \pi} \frac{sin^2(\theta)}{R} d\theta$$

Which I then tried to integrate over $$\theta$$ in range $$[0, \pi]$$, however the result was wrong. I think I'm somehow getting a $$sin^2(\theta)$$ where I just should have gotten $$sin(\theta)$$

Now I know that similar questions have been posted here before, but I know how I can do this so that I get the right result, but the right result isn't really important - I just want to know, why my approach is wrong.

I have also tried to sketch a picture of my "setup", here it is:

• This might help you: physics.stackexchange.com/questions/172894/… May 28, 2020 at 11:40
• This post is helpful, but sadly the poster has found dl in a slightly different way - he has actually differentiated l over theta, while I try to calculate dl using trigonometry May 28, 2020 at 12:26
• Why do you assume $dl =r d\theta$? If you want to integrate over $\theta = \pi - \alpha -\phi$, that should be $dl = r d\theta/\sin\theta$. May 28, 2020 at 13:37
• @JánLalinský I have just noticed, that I have used phi instead of theta in my image. I assume, that $rd\theta$ because alpha is equal to $d\theta$ so for small angle $dl$ is equal to $rd\theta$. I basically have a triangle of sides $r$, $r$, and $dl$ (the other leg is also $r$ because it's length isn't affected much by $d\theta$. May 28, 2020 at 13:46
• It is true that $d\alpha= - d\theta$, but $dl$ isn't $rd\theta$. Expression $rd\theta$ gives length of circle section at distance $r$. This section is a projection of $dl$ in the direction of $r$. May 28, 2020 at 13:50