[Physics] Derivation of magnetic field caused by a current carrying wire

magnetic fields

When we derive the equation of a magnetic field produced by a long straight current-carrying wire, we do something like this:

Imagine a wire carrying a constant current $I$. Take a point at a distance of $r$ from the wire, this is the point where we want to find the magnetic field. So, draw a circle with radius $r$ and center at the wire (from which the point's distance is $r$). Applying the Ampere's Law $$ \oint \mathbf{B} \cdot d\mathbf{l} = \mu_{0} ~I$$

enter image description here

Since the magnitude of $\mathbf{B}$ is constant at every line element of the loop (circle) and it dot product with the line element is $B~dl$ everywhere, therefore $$ \oint B~dl = \mu_0 ~I$$
$$ B~\oint dl = \mu_0 ~I$$
$$ B~ 2\pi r = \mu_0 ~I $$
$$ B = \frac{\mu_0}{2\pi r} ~I $$

Now, the problem is how do we know that the magnitude of B is going to be constant and its direction will be the same as a line element. I think it's this assumption that has really solved the problem and not the mathematics . Is it an experimental fact? How can we ever made such an assumption when the only thing that we have is Elcetrostatics (I mean that electrostatics was the precursor of magnetostatics and magnetostatics always takes the analogy of static charges in electrostatics) where the field varies with distance.

I want to state my problem once more: How do we know that magnetic field's strength gonna be constant all around the loop and always tangential to the loop? .

Thank you. Any help will be much appreciated.

EDIT: Following @Dale answer, we can do something like this
$$ d\mathbf{B} = \mu_0 /4\pi ~ I ~ \frac {d\mathbf{l} \times \mathbf{r}} {r^3} $$
Since, r can be written as $ \mathbf{r} = (rcos\theta, rsin\theta , z) $ and dl as $ d\mathbf{l} = ( dl,0,0) $
And now, if we take the cross product we would get $$ d\mathbf{l} \times \mathbf{r} = -z ~dl \hat j + rsin\theta \hat k$$ and therefore the magnitude of dB is equal to $$ dB = \mu_0/4\pi ~I~ |d\mathbf{l} \times \mathbf{r}| /r^3 = \mu_0/4\pi ~I ~ \sqrt{z^2+r^2sin^2\theta} dl/ r^3 $$

Thus, magnetic field is depending on $r, \theta, z$ . Please help.

Best Answer

how do we know that the magnitude of B is going to be constant and its direction will be the same as a line element

We know that the magnitude is constant by symmetry. Since there is cylindrical symmetry (axisymmetric) the magnitude can only depend on $r$, and therefore cannot depend on $\theta$ or on $z$.

For the direction, that is a little more complicated. If we break $\vec B$ into $\hat r$, $\hat \theta$, and $\hat z$ components, then we see that the $\hat z$ component must be zero because the Biot Savart law requires $\vec B$ to be perpendicular to $\vec I$. If the $\hat r$ component were nonzero then we would have a nonzero divergence which would violate Gauss’ law for magnetism. So only the $\hat \theta$ component can be nonzero. And its magnitude is determined by the integral you posted.