# Magnetic field by current in an infinite cylinder

Let $V\subset\mathbb{R}^3$ be an infinitely high solid cylinder of radius $R$, with its axis coinciding with the $z$ axis, entirely enclosed by the cylinder's lateral surface. Then, for any constant $\mu_0\in\mathbb{R}$ and any point of coordinates $\boldsymbol{r}\notin \bar{V}$ external to the cylinder, $$\frac{\mu_0}{4\pi}\int_V\frac{I\mathbf{k}\times(\boldsymbol{r}-\boldsymbol{x})}{\pi R^2\|\boldsymbol{r}-\boldsymbol{x}\|^3}d^3x=\frac{\mu_0 I \mathbf{k}\times\boldsymbol{r}}{2\pi\|\mathbf{k}\times\boldsymbol{r}\|^2}$$where $\mathbf{k}$ is the unit vector defyning the direction of the $z$ axis, which is the same as$$\frac{1}{2\pi}\int_V\frac{\mathbf{k}\times(\boldsymbol{r}-\boldsymbol{x})}{ R^2\|\boldsymbol{r}-\boldsymbol{x}\|^3}d^3x=\frac{\mathbf{k}\times\boldsymbol{r}}{\|\mathbf{k}\times\boldsymbol{r}\|^2}\quad (1)$$The result is the formula for the magnetic field generated by a steady current parallel to $\mathbf{k}$, having intensity $I$ and flowing through the cylinder.

My textbook, Gettys's Physics, derives the formula by using Ampère's law in the form $\oint_{\partial^+ \Sigma}\left(\frac{\mu_0}{4\pi}\int_{\mathbb{R}^3}\frac{\boldsymbol{J}(\boldsymbol{x})\times(\boldsymbol{r}-\boldsymbol{x})}{\|\boldsymbol{r}-\boldsymbol{x}\|^3}d\mu_{\boldsymbol{x}}\right)\cdot d\boldsymbol{r}=\mu_0\int_\Sigma \boldsymbol{J}\cdot\boldsymbol{N}_e \,d\sigma$, but I would like to understand a way to calculate the integral without using that law, since I have never seen a proof of it for a discontinuous density of current such as $\boldsymbol{J}=\frac{I\chi_V }{\pi R^2}\mathbf{k}$.

How can we proof the identity $(1)$? I have also tried with cylindrical coordinates $(x,y,z)=(r\cos\theta,r\sin\theta,z)$ with $r\in [0,R]$, $\theta\in[0,2\pi)$, $z\in(-\infty,+\infty)$, but I have got serious problem to manipulate the integral I get. I $\infty$-ly thank any answerer...

• These integrals usually become extremely difficult to do using everyday methods (such as substitution). Using physical intuition and spherical/cylindrical harmonics is the only viable way most of the time. – grdgfgr May 23 '16 at 19:59
• @grdgfgr: In this case, physical intuition provides the order of integration: We should only expect a nice result for the infinite cylinder, so the $z$ integration comes first; then since we know from Ampère's law that each cylindrical shell separately yields the same result (proportional only to the density of current in it, which is proportional to $r$), the integration over $\theta$ must be possible independent of $r$ and should thus be next, and then only the trivial integration over the cylindrical shells along $r$ remains. – joriki May 23 '16 at 20:42

Fix a point outside the cylinder, without loss of generality at $\mathbf r=(a,0,0)$. By symmetry, the magnetic field at $\mathbf r$ has only a $y$ component, and since $k$ only has a $z$ component, the only relevant component of $\mathbf r-\mathbf x$ is the $x$ component. The $y$ component of the left-hand side is

\begin{align} \frac1{2\pi R^2}\int_V\frac{a-x}{\|\mathbf r-\mathbf x\|^3}\mathrm d^3x &= \frac1{2\pi R^2}\iiint_V\frac{a-r\cos\theta}{\left((a-r\cos\theta)^2+(r\sin\theta)^2+z^2\right)^{3/2}}\,\mathrm dz\,\mathrm d\theta\,r\mathrm dr \\ &= \frac1{\pi R^2}\int_0^R\int_0^{2\pi}\frac{a-r\cos\theta}{(a-r\cos\theta)^2+(r\sin\theta)^2}\,\mathrm d\theta\,r\mathrm dr \\ &= \frac1{\pi R^2}\int_0^R\int_0^{2\pi}\frac{a-r\cos\theta}{a^2-2ar\cos\theta+r^2}\,\mathrm d\theta\,r\mathrm dr \\ &= \frac a{\pi R^2}\int_0^{R/a}\int_0^{2\pi}\frac{1-\rho\cos\theta}{1-2\rho\cos\theta+\rho^2}\,\mathrm d\theta\,\rho\mathrm d\rho \\ &= \Re\frac a{\pi R^2}\int_0^{R/a}\int_0^{2\pi}\frac{1-\rho\mathrm e^{\mathrm i\theta}}{\left(1-\rho\mathrm e^{\mathrm i\theta}\right)\left(1-\rho\mathrm e^{-\mathrm i\theta}\right)}\,\mathrm d\theta\,\rho\mathrm d\rho \\ &= \Re\frac a{\pi R^2}\int_0^{R/a}\int_0^{2\pi}\frac1{1-\rho\mathrm e^{-\mathrm i\theta}}\,\mathrm d\theta\,\rho\mathrm d\rho \\ &= \Re\frac a{\pi R^2}\int_0^{R/a}\oint\frac1{1-\rho/z}\,\frac{\mathrm dz}{\mathrm iz}\,\rho\mathrm d\rho \\ &= \Re\frac a{\pi R^2}\int_0^{R/a}\frac1{\mathrm i}\oint\frac1{z-\rho}\,\mathrm dz\,\rho\mathrm d\rho \\ &= \Re\frac a{\pi R^2}\int_0^{R/a}2\pi\rho\,\mathrm d\rho \\ &= \frac1a\;, \end{align}

in agreement with the right-hand side. Note that the contour integral is proportional to the residue at the pole because $r\lt a$. A cylindrical shell of current outside the test point does not contribute to the magnetic field; in this case, $r\gt a$, the contour integral vanishes as it doesn't contain the pole.

My $\infty$ pleasure.

• Thank you so much! A thing isn't clear to me: since my knowledge of complex analysis is almost null, I'm not sure what property is used to write the 5th row... – Self-teaching worker May 25 '16 at 13:13
• @Self-teachingworker: This uses Euler's formula $\mathrm e^{\mathrm i\theta}=\cos\theta+\mathrm i\sin\theta$. The $\Re$ at the beginning takes the real part of the expression. The denominator is just rewritten; if you multiply it out and use $\mathrm e^{\mathrm i\theta}\mathrm e^{-\mathrm i\theta}=1$ you get the denominator from the line before. I added an imaginary term $-\rho\mathrm i\sin\theta$ to the numerator and wrote the $\Re$ to get rid of it again. Alternatively, the integral over the added term is zero by symmetry. – joriki May 25 '16 at 13:57
• ...and then you used the residue theorem. Thank you very much! – Self-teaching worker May 25 '16 at 20:55
• I've reflected more deeply on this integral: since the integral of the absolute values of all the components of $\frac{\mathbf{k}\times(\boldsymbol{r}-\boldsymbol{x})}{\| \boldsymbol{r}-\boldsymbol{x}\|^3}$ converge since they are $\le\frac{1}{\|\boldsymbol{r}-\boldsymbol{x}\|^2}$, whose integral converges (as shown here) provided that $\boldsymbol{x}\notin V$, [...] – Self-teaching worker Jun 28 '16 at 16:50
• [...] the Lebesgue integral $\int_V\frac{\mathbf{k}\times(\boldsymbol{r}-\boldsymbol{x})}{\|\boldsymbol{r}- \boldsymbol{x}\|^3}d\mu_{\boldsymbol{x}}$ exists finite in the case that $\boldsymbol{x}\notin V$. Moreover if $\forall r\quad a>r$, the integral you wrote is always non-negative, therefore even if $\boldsymbol{x}$ is on the external surface of $V$, the $y$ component $\int_V\frac{a-x}{\|\mathbf r-\mathbf x\|^3}\mathrm d^3x$ converges as a limit as $R\to a$. [...] – Self-teaching worker Jun 28 '16 at 16:50