Theorem: Magnetic Field of Infinite Straight Conductor carrying Steady Current

Let $s$ be an infinitely long wire lying along the $z$ axis and carrying a steady current.
Let $\map {\mathbf B} {\mathbf r}$ be the magnetic field at a position $\mathbf r$ due to $s$.
Then:
:$\map {\mathbf B} {\mathbf r} = \dfrac {\mu_0 I} {2 \pi \rho} \paren {-\sin \theta \, \mathbf i + \cos \theta \, \mathbf j}$
where
:$\mu_0$ is the vacuum permeability
:$I$ is the electric current in s
:$\rho$ is the perpendicular distance from $\mathbf r$ to $s$
:$\theta$ is the angle of $\mathbf r$ from the $x$ axis in a plane perpendicular to $s$
:$\mathbf i$ and $\mathbf j$ are unit vectors pointing along the $x$ axis and $y$ axis, respectively.

Proof:
We have a generic magnetic field:
:$\map {\mathbf B} {\mathbf r} = \begin{bmatrix} \map {B_x} {x, y, z} \\ \map {B_y} {x, y, z} \\ \map {B_z} {x, y, z} \\ \end{bmatrix}$
Due to translational symmetry in the $z$ direction, the magnetic field is independent of the $z$ coordinate.
:$\map {\mathbf B} {\mathbf r} = \begin{bmatrix} \map {B_x} {x, y} \\ \map {B_y} {x, y} \\ \map {B_z} {x, y} \end{bmatrix}$
Due to rotational symmetry about the $z$ axis, the magnetic field at any point must be a rotated version of the field along the $x$ axis.
{{begin-eqn}}
{{eqn | l = \map {\mathbf B} {\mathbf r}
      | r = \map {R_z} \theta \begin{bmatrix} \map {B_x} \rho \\ \map {B_y} \rho \\ \map {B_z} \rho \end{bmatrix}
}}
{{eqn | r = \begin{bmatrix} \cos \theta & -\sin \theta & 0 \\ \sin \theta & \cos \theta & 0 \\ 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} \map {B_x} \rho \\ \map {B_y} \rho \\ \map {B_z} \rho \end{bmatrix}
}}
{{eqn | r = \begin{bmatrix}\map {B_x} \rho \cos \theta - \map {B_y} \rho \sin \theta \\ \map {B_x} \rho \sin \theta + \map {B_y} \rho \cos \theta \\ \map {B_z} \rho \end{bmatrix}
}}
{{end-eqn}}
where
:$\map {R_z} \theta$ is a matrix representing rotations about the z axis
:$\map {B_x} \rho = \map {B_x} {\rho, 0}$, and similarly for $\map {B_y} \rho$ and $\map {B_z} \rho$
:$\rho$ is the distance from the wire
Consider rotating the wire 180$\degrees$ about the $x$ axis.
The $\map {B_x} \rho$ component of the field along the $x$ axis does not change since it lies along the axis of rotation.
However, rotating the wire has the effect of reversing the current, which causes the magnetic field to point in the opposite direction.
:$\map {\mathbf B} {\mathbf r} \rightarrow -\map {\mathbf B} {\mathbf r}$
The only way that $B_x$ can remain unchanged with a reversed sign is if it is equal to zero.
:$\map {B_x} x = 0$
Thus, we have:
:$\map {\mathrm B} {\mathbf r} = \begin{bmatrix} -\map {B_y} \rho \sin \theta \\ \map {B_y} \rho \cos \theta \\ \map {B_z} \rho \end{bmatrix}$
Let $S$ be a circular path of radius $r$ in the $xy$ plane centered on the wire:
{{begin-eqn}}
{{eqn | l = \mu_0 I
      | r = \oint_S \map {\mathbf B} {\mathbf r} \cdot \d \mathbf l
      | c = Ampère-Maxwell Law
}}
{{eqn | r = \int_0^{2 \pi} \begin{bmatrix} -\map {B_y} r \sin \theta \\ \map {B_y} r \cos \theta \\ \map {B_z} r \end{bmatrix} \cdot \begin{bmatrix} -\sin \theta \\ \cos \theta \\ 0 \end{bmatrix} r \rd \theta
}}
{{eqn | r = \int_0^{2 \pi} B_y \paren {\sin^2 \theta + \cos^2 \theta} r \rd \theta
      | c = {{Defof|Dot Product}}
}}
{{eqn | r = \map {B_y} r r \int_0^{2 \pi} \rd \theta
      | c = Sum of Squares of Sine and Cosine
}}
{{eqn | r = 2 \pi r \map {B_y} r
}}
{{end-eqn}}
Therefore:
:$\map {B_y} \rho = \dfrac {\mu_0 I} {2 \pi \rho}$
Now, we have:
:$\map {\mathrm B} {\mathbf r} = \begin{bmatrix} -\dfrac {\mu_0 I} {2 \pi \rho} \sin \theta \\ \dfrac {\mu_0 I} {2 \pi \rho} \cos \theta \\ \map {B_z} \rho \end{bmatrix}$
The divergence of the field is:
{{begin-eqn}}
{{eqn | l = 0
      | r = \nabla \cdot \map {\mathbf B} {\mathbf r}
      | c = Gauss's Law for Magnetism
}}
{{eqn | r = -\dfrac {\mu_0 I} {2 \pi} \frac \partial {\partial x} \paren {\frac {\sin \theta} \rho} + \dfrac {\mu_0 I} {2 \pi} \frac \partial {\partial y} \paren {\frac {\cos \theta} \rho} + \frac {\partial B_z} {\partial z}
      | c = {{Defof|Divergence Operator}}
}}
{{eqn | r = -\dfrac {\mu_0 I} {2 \pi} \frac \partial {\partial x} \paren {\frac y {x^2 + y^2} } + \dfrac {\mu_0 I} {2 \pi} \frac \partial {\partial y} \paren {\frac x {x^2 + y^2} } + \frac {\partial B_z} {\partial z}
      | c = $\cos \theta = \frac x \rho$ and $\sin \theta = \frac y \rho$ and $\rho^2 = x^2 + y^2$
}}
{{eqn | r = \dfrac {\mu_0 I} {2 \pi} \paren {\frac {2 x y} {\paren {x^2 + y^2}^2} } - \dfrac {\mu_0 I} {2 \pi} \paren {\frac {2 x y} {\paren {x^2 + y^2}^2} } + \frac {\partial B_z} {\partial z}
}}
{{eqn | r = \frac {\partial B_z} {\partial z}
}}
{{end-eqn}}
In regions not containing the wire, the curl of the field is:
{{begin-eqn}}
{{eqn | l = \mathbf 0
      | r = \nabla \times \map {\mathbf B} {\mathbf r}
      | c = Ampère's Law with Maxwell's Addition in regions with no current
}}
{{eqn | r = \mathbf i \paren {\frac \partial {\partial y} B_z - \frac \partial {\partial z} \paren {\frac {\mu I} {2 \pi \rho} \cos \theta} } - \mathbf j \paren {\frac \partial {\partial x} B_z - \frac \partial {\partial z} \paren {-\frac {\mu I} {2 \pi \rho} \sin \theta} } + \mathbf k \paren {\frac \partial {\partial x} \paren {\frac {\mu_0 I} {2 \pi \rho} \cos \theta} - \frac \partial {\partial y} \paren {-\frac {\mu_0 I} {2 \pi \rho} \sin \theta} }
      | c = {{Defof|Curl Operator}}
}}
{{eqn | r = \mathbf i \frac {\partial B_z} {\partial y} - \mathbf j \frac {\partial B_z} {\partial x} + \mathbf k \paren {\frac {\mu_0 I} {2 \pi} } \paren {\frac \partial {\partial x} \paren {\frac {\cos \theta} \rho} + \frac \partial {\partial y} \paren {\frac {\sin \theta} \rho} }
      | c = $\partial_z = 0$ for all components
}}
{{eqn | r = \mathbf i \frac {\partial B_z} {\partial y} - \mathbf j \frac {\partial B_z} {\partial x} + \mathbf k \paren {\frac {\mu_0 I} {2 \pi} } \paren {\frac \partial {\partial x} \paren {\frac x {x^2 + y^2} } + \frac \partial {\partial y} \paren {\frac y {x^2 + y^2} } }
}}
{{eqn | r = \mathbf i \frac {\partial B_z} {\partial y} - \mathbf j \frac {\partial B_z} {\partial x} + \mathbf k \paren {\frac {\mu_0 I} {2 \pi} } \paren {\frac {y^2 - x^2} {\paren {x^2 + y^2}^2} + \frac {x^2 - y^2} {\paren {x^2 + y^2}^2} }
}}
{{eqn | r = \mathbf i \frac {\partial B_z} {\partial y} - \mathbf j \frac {\partial B_z} {\partial x}
}}
{{eqn | ll= \leadsto
      | l = \frac {\partial B_z} {\partial x}
      | m = \frac {\partial B_z} {\partial y}
      | mo = =
      | r = 0
}}
{{end-eqn}}
We have:
:$\dfrac {\partial B_z} {\partial x} = \dfrac {\partial B_z} {\partial y} = \dfrac {\partial B_z} {\partial z} = 0$
which means $B_z$ is everywhere constant.
Since all physical magnetic fields decay to zero as $\rho \to \infty$, $B_z = 0$ everywhere.
Thus, we have:
{{begin-eqn}}
{{eqn | l = \map {\mathrm B} {\mathbf r}
      | r = \dfrac {\mu_0 I} {2 \pi \rho} \begin{bmatrix} -\sin \theta \\ \cos \theta \\ 0 \end{bmatrix}
}}
{{eqn | r = \dfrac {\mu_0 I} {2 \pi \rho} \paren {-\sin \theta \, \mathbf i + \cos \theta \, \mathbf j}
}}
{{end-eqn}}
{{qed}}