How to test the solution for the magnetic field around a wire One can arrive at the equation for the magnetic field around an infinite wire in several ways(biot savart law, I used the integral form of Ampere's law). The solution is well known and of the form
$$
B_{\phi} = \frac{\mu I}{2\pi r},\quad B_{r}=B_{z}=0
$$
with permentivity $\mu$, current $I$ and distance $r$ from the wire, $\phi$ the direction being perpendicular to the wire, as known from the left hand rule. Now my problem is, when I plug in the solution into the differential form of Ampere's law to test the solution i.e.
$$
\boldsymbol \nabla× \mathbf B = I + \partial E / \partial t
\tag 1$$
in cylindrical coordinates I yield
$$I = I_z = \frac 1r \frac{ \partial 
(r B_{\phi})}{ \partial r} - \frac 1r \frac{\partial B_{r}}{\partial \phi}$$
with the observation that $\partial E / \partial t = 0$. When plugging in $B_{\phi}$ and $B_{r}$, the $1/r$ in $B_{\phi}$ cancels with $r$, leading to the right hand side of the expression being zero, meaning that $I =0$, being of course incorrect.

Can somebody point out to me my obvious mistake? Is the elextric field changing in time just exactly the current? and if so, why do they have a separate expression? Thanks already.

 A: First, you made a mistake in the Maxwell's equation. In SI unit, it should be
$$ \nabla \times B = \mu (J + \epsilon \partial E/\partial t),$$
where $J$ is the current density.
For a current wire which distributes only at $r = 0$, $J = I \frac{1}{2\pi r}\delta(r)$ in cylindrical coordinates.
As you mentioned, for a steady current, there is no time dependence and $\partial E/\partial t = 0$, so we only need to consider the first term on RHS.
This $\delta$ function should be understood under the integral
$$ \int dS \cdot \nabla \times B = \int dS \cdot \mu J.$$
If this integral is done over area excluding the origin (where the current locates), then this integral is equal to zero.
This is where you get the "mistake" in your answer.
However, for integrals done over area including the origin, it is not difficult to show that the RHS is non-zero and equal to $\mu I$.
This can also be shown from the LHS:
$$
\begin{align}
\int dS \cdot \nabla \times B  &= \int r dr d\phi \left(\frac{1}{r} \frac{\partial r B_{\phi}}{\partial r} - \frac{\partial B_r}{\partial \phi} \right) \\
&= 2\pi \lim_{a \to 0} \int dr \frac{d}{dr} \left(r \frac{\mu I}{2\pi \sqrt{r^2+a^2}}\right) \\
&= \mu I,
\end{align}
$$
which is just the result of Ampere's law.
A: Very nice question, I learnt something new when trying to answer it. First of all, there's a slight problem with your equation, it should read
$$\nabla \times \mathbf{B} = \mu_0 \mathbf{j}$$
where $\mathbf{j}$ is the current density, and I've ignored the term containing the changing electric field since we're dealing with magnetostatics. As you rightly point out,
$$\mathbf{B} = \frac{\mu_0 I}{2 \pi r}\mathbf{\hat{\phi}}.$$
The standard way to solve this problem is to go to the integral form of the given Maxwell Equation, so that:
$$\nabla \times \mathbf{B} = \mu_0\mathbf{j} \quad \quad \longrightarrow \quad \quad \oint_C \mathbf{B}\cdot \text{d}\mathbf{l} = \mu_0 \iint \mathbf{j}\cdot \text{d}\mathbf{A} = \mu_0 I,$$
and it's trivial to verify that this does indeed give you a consistent answer.

However, what if you want to do it directly using Maxwell's Equation? You should be a little concerned, since a current density appears on the right hand side. But what is the current density for a wire carrying a current $I$? Well, naively you'd want to divide the current by the cross-sectional area of the wire. But our wire is just a point, and so we'd get a nonsensical answer using our naive technique!
This is completely analogous to the case where one tries to apply Gauss's law in its differential form to a single point charge. There to the "densities" blow up and you need to stop thinking in terms of "functions" but rather in terms of distributions. In such cases, the Dirac delta function often appears, since our densities need to be:

*

*Zero everywhere apart from a point where it isn't well defined, and

*Finite when we integrate over all space.

The $\delta-$function satisfies these conditions. (This is not a proof! It's barely a motivation, frankly. Proving this is a mathematical exercise, and can get a little hairy.)
However, let's see what happens if we plug our $\mathbf{B}$ into the curl equation:
$$\nabla \times \mathbf{B} = \mathbf{\hat{z}} \frac{1}{r}\frac{\partial}{\partial r} \Big(r B_\phi\Big) = \mathbf{\hat{z}}\frac{1}{r} \frac{\partial}{\partial r}\Big(\text{constant}\Big) = 0 \quad \forall\,\, r \neq 0.$$
The important thing to realise is that as $r\to 0$, the above quantity is of the $\frac{0}{0}$  form, and therefore is not defined. The curl is zero everywhere except "at" the wire which is positioned at $r=0$. (This should make intuitive sense too, the current density is zero everywhere except on the wire, where it is infinite.)
There's a mathematical identity which (if I remember correctly) says that in cylindrical coordinates $$\nabla \times \frac{\hat{\phi}}{r} = \mathbf{\hat{z}} \,\,2\pi \delta^2(r),$$
where $\delta^2(r) = \delta(x)\delta(y)$ is the 2D $\delta-$function. Using this, you can show that $$\nabla \times \mathbf{B} = \mathbf{\hat{z}}\mu_0 I\, \delta^2(r).$$
The right hand side is always zero unless $r=0$ (which is what we saw should be the case by actually calculating the curl), but the value at $r=0$ is infinite (as we would expect intuitively). In other words the current density of an infinite wire pointing along $z$ is $\mathbf{j} = \mathbf{\hat{z}} \,\, I\delta^2(r).$
