# Magnetic Field of a cylinder

1. May 31, 2007

### stunner5000pt

1. The problem statement, all variables and given/known data
An infinitely long cylinder, of radius R, carries a "frozen-in" magnetization. parallel to the axis, $M = ks\hat{z}$ where k is a constant and s is the distance from the axis; there is no free current anywhere. Find the magnetic field inside and outside the cylinder

2. Relevant equations
$$J_{b} = \nabla \times M$$
$$K_{b} = M\times \hat{n}$$
$$\oint B \cdot dl = \mu_{0} I_{enc}$$

3. The attempt at a solution

Here $$J_{b} = -k\hat{\phi}$$
and $$K_{b} = kR \hat{\phi}$$

so the field inside s<R
$$B \cdot 2\pi s = \mu_{0} \int J_{b} da = \mu_{0} \int -k s'ds' d\phi'$$
so i get $$B = -\mu_{0} ks \hat{z}$$
but the answer is supposed to be positive...
why is that? Am i supposed to include the surface current density to find the field? But for a question in the past (for a cylinder with magnetization $M = ks^2 \hat{\phi}$.. however that time the enclosed current in the enitre (s>R) cylinder was zero - there was symmetry between the two surface currents. The amperian loop was a circlular loop within the cylinder...

Is this question to be solved differently because there is no symmtery between the surface and volume current densities?