# Magnetic Potential and Magnetic Field of a Permanent Cylindrical Magnet

The magnet has magnetization $$\vec{M}=M_0 \hat{k}$$, radius $$r=b$$, and length $$L=2l$$, we need to find the potential $$A$$ along its $$z$$ axis and then the magnetic field $$\vec{B}$$. The equation where one can start is

$$$$\vec{A}(\vec{r})=\frac{\mu _0}{4 \pi} \left[ \int \frac{\vec{J}_b}{|\vec{r}-\vec{r}´|}dV + \int\frac{\vec{K}_b}{|\vec{r}-\vec{r}´|}dS \right]$$$$ where $$\vec{J}_b=\vec{\nabla}\times \vec{M}=0$$ and $$\vec{K}_b=\vec{M} \times \hat{n}=M_0 \hat{\phi}$$.

Now we only have to solve the second term and it is quite easy with

$$\vec{r}´=b\hat{r}'+z'\hat{k}'$$ $$\vec{r}=z\hat{k}$$ $$dS'=bd\phi' dz'$$

so the potential takes the form

$$$$\vec{A}(\vec{r})=\frac{\mu_0 }{4 \pi} \int\frac{M_0bd\phi' dz'}{((z-z')^2+b^2)^{1/2}}dS\quad\hat{\phi}$$$$ which gives

$$$$\vec{A}(z)=\frac{\mu_0 M_0 }{2b} \left[ \frac{(z-l)}{((z-l)^2+b^2)^{1/2}}- \frac{(z+l)}{((z+l)^2+b^2)^{1/2}} \right] \quad\hat{\phi}$$$$

so the magnetic field we just apply the roational in cylindricals $$\vec{B}=\vec{\nabla} \times \vec{A}$$

$$\vec{\nabla} \times \vec{A}=-\frac{1}{r}\frac{\partial A_{\phi}}{\partial z}\hat{r}+\frac{A_{\phi}}{r}\hat{k}$$

Here is the problem, I've got a component in $$\hat{r}$$ where it should not be there, and if we only use the component in $$\hat{k}$$ there is an extra factor of $$\frac{1}{rb}$$ which shouldn't be there as well and I don't know why.

The magnetic field is suppose to be

$$$$\vec{B}(z)=\frac{\mu_0 M_0 }{2} \left[ \frac{(z-l)}{((z-l)^2+b^2)^{1/2}}- \frac{(z+l)}{((z+l)^2+b^2)^{1/2}} \right] \quad\hat{k}$$$$

Since the observation point is on the z-axis ($$\vec{r}=z\hat{k}$$), the system is axisymmetric, and the excitation condition is oriented in the $$\hat{\phi}$$ direction, $$\vec{A}=\vec{0}$$ is obtained. In your calculation, $$$$\int_0^{2\pi}\vec{K}_bd\phi=\int_0^{2\pi}M_0\hat{\phi}d\phi=\int_0^{2\pi}M_0(-\text{sin}\phi,\text{cos}\phi)d\phi=0.$$$$ should be considered. Of course this does not imply $$\vec{B}=\vec{0}$$ on the z-axis.