Biot-Savart law and magnetic field of a ring I have to calculate the magnetic field along the axis of a ring of radius $R$ on which circulates a current $I$ using the Biot-Savart law. The Biot-Savart law as given in my (really bad) course states
$$\mathbf{B}=\frac{\mu_0}{4\pi}\oint_{C}\frac{\mathbf{I}\times \mathbf{r}}{|\mathbf{r}|^3}\mathrm{d}l $$
where in this case
$$C=\{(\rho, \phi, z): \rho=R, \, z=0,\,\phi\in[0,2\pi[  \}$$
and $\mathbf{I}=I\hat{e}_{\phi}$
we have $\mathbf{r}=\rho\hat{e}_{\rho}+z\hat{e}_z$, thus
$$\hat{e}_\phi\times \mathbf{r}=\hat{e}_\phi\times(\rho\hat{e}_{\rho}+z\hat{e}_z)=-\rho\hat{e}_z+z\hat{e}_\rho$$
and thus
$$\mathbf{B}=\frac{\mu_0}{4\pi}\int_{0}^{2\pi}\left[\frac{-\rho\hat{e}_z+z\hat{e}_\rho}{(\rho^2+z^2)^\frac{3}{2}}\right]_{\rho=R, \,z=0}\mathrm{d}\phi$$
which of course gives something which is constant and wrong. I really don't understand how this formula could give anything which makes sense, since every spatial variable will disappear with the integration. I found other versions of the law around which include notations such as $\vec{dl}\times\vec{r}$ which I just don't understand, I don't know what it means to take the cross product of a differential with something. Do I have a wrong Biot-Savart law? If not, what am I doing wrong?
Thank you.
 A: First of all, let's say the current flow in the direction of increasing $\phi$. Now, for the ring, let's write Biot-Savart law in the form
$$ \textbf{B}(\textbf{x}) = \frac{\mu_o i}{4\pi} \oint_C \frac{d\textbf{l}'\,\times\,\textbf{r}}{|\textbf{r}|^3},$$
where $d\textbf{l}'$ is the infinitesimal displacement vector and $\textbf{r} = \textbf{x} - \textbf{x}'$ is the separation vector from the field source (current along the wire's segment $dl'$) at $\textbf{x'}$ to the point $\textbf{x}$ where you want to measure the field. Note I have used $\textbf{i}\,dl'=i\,d\textbf{l}'$ (personally, I prefer to use $i\,d\textbf{l}'$).
Because of the geometry of the problem, cylindrical coordinates are more suitable to handle the calculations. For points at the ring axis, $\textbf{x} = z\, \hat{\textbf{e}}_z$. Also, the location of an arbitrary infinitesimal segment of the wire can be represented by $\textbf{x}'=R\, \hat{\textbf{e}}_\rho'$ (remember $\hat{\textbf{e}}_\rho'$ is function of $\phi'$ and $\phi'$ defines where in the wire this segment is). Therefore $\textbf{r}=z\, \hat{\textbf{e}}_z-R\, \hat{\textbf{e}}_\rho'$ and $|\textbf{r}|^3=(z^2+R^2)^{3/2} $. Finally, $d\textbf{l}'=R\, d\phi'\,\hat{\textbf{e}}_\phi'$. I have included all these primes to remember these are variable related to the source of the field and are integration variables in the Biot-Savart law.
The cross-product now reads
$$d\textbf{l}'\,\times\,\textbf{r} = (z\,R\, \hat{\textbf{e}}_\rho'+R^2\,\hat{\textbf{e}}_z')\,d\phi'. $$
Now Biot-Savart law reads
$$ \textbf{B}(\textbf{x}) = \frac{\mu_o i}{4\pi} \int_0^{2\pi} \frac{z\,R\,\hat{\textbf{e}}_\rho'+R^2\,\hat{\textbf{e}}_z'}{(z^2+R^2)^{3/2}}\,d\phi'.$$
The unit vector $\hat{\textbf{e}}_z'$ is constant, and equal to $\hat{\textbf{e}}_z$ so it goes out the integral. On the other hand, $\hat{\textbf{e}}_\rho'=\cos{\phi'}\hat{\textbf{e}}_x+\sin{\phi'}\hat{\textbf{e}}_y$ is a function of $\phi'$ and must be integrated,
$$ \textbf{B}(\textbf{x}) = \frac{\mu_o i}{4\pi}\frac{z\,R}
 {(z^2+R^2)^{3/2}}\int_0^{2\pi}(\cos{\phi'}\hat{\textbf{e}}_x+\sin{\phi'}\hat{\textbf{e}}_y)\,d\phi'+\frac{\mu_o i}{4\pi}\frac{R^2}{(z^2+R^2)^{3/2}}\hat{\textbf{e}}_z\int_0^{2\pi} d\phi'.$$
The first integral vanishes because $\int_0^{2\pi}\cos\phi'\,d\phi'=\int_0^{2\pi}\sin\phi'\,d\phi'=0$. The second integral is just $2\pi$. Then you get the magnetic field at a distance $z$ along the ring's axis:
$$ \textbf{B}(\textbf{x}) = \frac{\mu_o i}{2}\frac{R^2}{(z^2+R^2)^{3/2}}\hat{\textbf{e}}_z.$$
A: I usually approach these problems less mathematical. Griffiths uses the following figure:
The part $dl'$ yields a piece of the magnetic field $dB$. All the horizontal components cancel so we only have to account for the vertical components. The integral becomes:
$$ B(z) = \frac{\mu_0}{4\pi} I \int \frac{d\textbf{l'}\times \textbf{r}}{r^2} = \frac{\mu_0}{4\pi} I \int \frac{dl'}{r^2} \cos\theta $$
The cross product between dl and I is more clearly visible in the figure. You take the cross product of a small part of I with the vector r. The vector r is a unit vector so it's length is 1. The angle between the 2 vectors is 90 degrees so you only have dl left. The cosine picks out the vertical component. Solving this integral is trivial.
