PNC-24-160 – Ampere’s Law: infinite wire of current
Applying Ampere’s Law: magnetic field created by an infinite wire
Consider an infinite wire carrying a steady current $I$ as shown below. If the wire is infinite, the magnetic field lines that encircle it are concentric circles centered on the wire and the magnetic field should only depend on the distance $r$ from the wire in magnitude.

To determine the expression $B(r)$ of the magnetic field at a distance $r$, we choose a circle of radius $r$ as our Amperian contour.
Along this contour $B$ is constant and always parallel to the contour $\left(\theta =0{}^\circ \right)$ and the circulation of $\overrightarrow{B}$ around the closed contour is equal to
\sum{\overrightarrow{B}\cdot \mathrm{\Delta }\overrightarrow{\ell }}=\sum{B\mathrm{\Delta }\ell {\mathrm{cos} \left(\theta \right)\ }}=B{\mathrm{cos} \left(0\right)\ }\sum{\mathrm{\Delta }\ell }=B\cdot \ell =B\cdot 2\pi r
where $2\pi r$ is the length (circumference) of the closed Amperian path. The current $I$ is flowing out of the page and our contour is oriented counterclockwise, therefore the encircled current is positive and equal to
I_{enc}=I
By Ampere’s Law, we derive that
\sum{\overrightarrow{B}\cdot \mathrm{\Delta }\overrightarrow{\ell }}={\mu }_0I_{enc}\ \ \ \ \Rightarrow \ \ \ \ \ B\cdot 2\pi r={\mu }_0I
The magnetic field a distance $r$ from the wire is thus given by
\boxed{B=\frac{{\mu }_0I}{2\pi r}}
and is oriented counterclockwise viewed from above.
Graph of the magnitude $B$ vs. $r$:
The graph of the magnetic field against the distance $r$ to the wire is sketched below.
