Showing that the magnetic field inside an infinite current carrying cylinder is zero I'm doing some self studying of introductory physics, and was working a question from a textbook that has several parts. The first few parts asked me to show that the magnetic field of an infinite current carrying cylinder has the form $\vec{B} = f(r)\begin{bmatrix}0 & z & -y\end{bmatrix}$ if we choose the x axis to be the central axis of the pipe. where $r = \sqrt{y^2 + z^2}$. I was then asked to show that in the empty space interior that $f(r) = \frac{a}{r^2}$, where $a$ is a constant of integration. I succeeded at that as well, following the outline in the textbook, I used the definition of curl as a derivative, computed curl and performed some integration. In summary, I have shown that inside the cylinder $\vec{B} = \frac{a}{r^2}\begin{bmatrix}0 & z & -y\end{bmatrix}$.
However, I'm stuck on what should be a simple corollary of my result, which is to show that the magnetic field inside the cylinder in empty space is always $0$. The hint is that the field at the central axis is $0$ by symmetry, which I understand. But, then I should use my result above for the field inside and the fact that the field is $0$ at the central axis to show it is $0$ everywhere inside. This is supposed to be a simple conclusion to all of the work I did above, but I'm just not seeing it. 
 A: So you have that $\vec{B} = \frac{a}{r^2}\begin{bmatrix}0 & z & -y\end{bmatrix}$ thus the magnitude is $B = \frac{a}{r^2}\sqrt{z^2+(-y)^2},$ where $a$ is unknown.
Can you write that as a function of $r?$
Can you investigate what happens as $r$ goes to zero?
Are magnetic fields continuous in empty space (a vacuum)?
If so, try the next five:
What magnetic field do you expect at the origin?
What is its magnitude?
Remember that $a$ is an unknown constant. Is there any choice of $a$ that allows $B$ to approach the magnitude it needs as you approach the origin?
Is it the only choice? Is it what you wanted?
If not, can you compute the line integral of the magnetic field in a circle about the origin and compare that to some thing?
For educational purposes I can share some actual requirements of continuity. Across any surface bounded by a triangle the normal component of the $\vec B$ field must give the same average flux just on one side of the triangle as on the other (or else you can't take the divergence and hence you can't say the divergence is zero).
There is a similar rule for tangential components but they can jump depending one whether you have surface currents or if something super extreme is happening to an electric field in a particular instant.
A: The magnitude of the B-field is $a/r$ and circulates around the axis. By symmetry, you understand that the magnitude is zero on-axis. But if $a$ is anything but zero, your expression gives an infinite B-field magnitude. Therefore $a$ must be zero and therefore the B-field is also zero everywhere else inside the pipe.
The result also follows from Ampere's law. The line integral of the B-field around a closed circular loop inside the pipe, which encloses no current, should be zero. As the B-field is parallel to the line element (if $a$ is non-zero), you would get a non-zero line integral. Therefore both $a$ and the B-field must be zero.
