# Magnetostatics: Finding B field given current density

1. Nov 30, 2015

1. The problem statement, all variables and given/known data
Not sure if this is the correct place to post so move if needed.

In a cylindrical conductor of radius R, the current density is givne by $j_0 e^{- \alpha r} \hat{k}$. Where $\alpha$ and $j_0$ are some constants and $\hat{k}$ is the unit vector along the z-axis.

. Determine the magnitude of the B field at all points in space.

2. Relevant equations
$\oint_C \vec{B} \cdot d\vec{r} = \mu_0 I$
$I = \int \int_S \vec{j} \cdot d\vec{S}$

3. The attempt at a solution
Well I am a bit stuck on this, dont know how to proceed as I dont know if I am interpreting it wrong or what, but first I state
$\oint_C \vec{B} \cdot d\vec{r} = \mu_0 I(r)$
That amperes circuital law related the B field to the current passing through the contour C, so in this case as the current density is not uniform, the current is a function of r.
Then I try to find $I(r)$
$I = \int \int_S \vec{j} \cdot d\vec{S}$
$I = \int \int_S (\vec{j} \cdot \hat{n}) dS$
And using cylindrical coordinates,$j_0 e^{- \alpha r} \hat{k}$ is just simply $j_0 e^{- \alpha r} \hat{e_z}$ , and surely the unit normal vector is $\hat{e_{\rho}}$? But then that leads to the dot product of $\vec{j}$ and $\hat{e_{\rho}}$ to be 0.

Is $\hat{e_{\rho}}$ the unit normal vector in this case? Or would it be $\hat{e_z}$? Even if it is $\hat{e_z}$ I still run in to problems .

2. Dec 1, 2015

### TSny

Can you describe the surface S that you are integrating over?

3. Dec 1, 2015

Its too late now anyways as the due date was this morning, but still will come in handy to know how to get to grips with it.

The surface is the cross-sectional area of the conductor, so it must be $\hat{e_z}$ that is the unit vector normal to the surface. If so I still ran in to problems, I think it was with the conversion to cylindrical coordinates.

$\vec{j} \cdot \hat{n}$ just leads to $j_0 e^{-\alpha r}$ or rather since its now cylindrical coordinates $j_0 e^{-\alpha \rho}$ but then dont I also have to multiply by $\rho d\rho$? if so then I just run into problems, or rather the integration is complex and the answer is nonsensical.

Or I also tried just $\vec{j} \cdot d\vec{S}$ (which I suppose is supposed to be the same thing), where $d\vec{S} = dr\hat{e_r} + r d\phi\hat{e_{\phi}} + dz \hat{e_z}$ but then that surely leads to just $j_0 e^{-\alpha r} dz$ which would just mean $I(r)=zj_0 e^{-\alpha r}$ which doesnt look right to me.

4. Dec 1, 2015

### TSny

Yes. Good.

Yes. There is also a constant factor that needs to be included with $\rho d\rho$ (if you have already integrated over the angle variable).

It shouldn't be too bad. Can you show what you tried?

I agree, that doesn't look right. $d\vec{S}$ should have the units of area and have a direction perpendicular to the surface.

5. Dec 2, 2015

Well yeah it wasnt too bad, its just we havent had many (if any) exercises/problems where we have had to integrate by parts so far; not that it is overly complicated, I think its just as we have never had to use it in any of the problems so far I just guessed the lecturer wouldnt have given us one, but I'm probably wrong.

for the integration I was doing $\int_0^R \rho j_0 e^{-\alpha \rho} d\rho$ , letting $u=\rho$ so that $\frac{du}{d\rho} = 1$ and letting $dv = j_0e^{-\alpha \rho}$ so that $v=-\frac{1}{\alpha} j_0e^{-\alpha \rho}$

$$\int_a^b u\> dv = [uv]_a^b - \int_a^b v \> du \\ \int_0^R \rho j_0 e^{-\alpha \rho} d\rho = [-\frac{\rho}{\alpha}j_0e^{-\alpha \rho}]_0^R + \frac{1}{\alpha} \int_0^R j_0 e^{-\alpha \rho} d\rho \\ \int_0^R \rho j_0 e^{-\alpha \rho} d\rho = -\frac{R}{\alpha}j_0e^{-\alpha R} + \frac{1}{\alpha^2}j_0e^{-\alpha R} \\ \int_0^R \rho j_0 e^{-\alpha \rho} d\rho = \frac{1}{\alpha}j_0e^{-\alpha R}(\frac{1}{\alpha}-R) = I(r)$$

6. Dec 2, 2015

### TSny

Your evaluation of the integral has a couple of errors. Check all signs in your third line. Also, does the lower limit give a nonzero contribution?

Why did you choose R as the upper limit? Are you trying to find B at r = R, or at some arbitrary value of r?

7. Dec 2, 2015

Oh, because first I was trying to find the B field outside of the conductor, so my contour C encircled the whole conductor (and in my head a little bit of the space around it but I suppose that doesn't matter as there's no current there). I suppose it would be the same inside the conductor too (the integral) but with r instead of R as the upper limit?

Thanks, I just did it very quickly before posting. Yeah your right, I forgot about the r in the exponential, obviously at zero they go to one, so need to fix that.

As I said, the due date has passed so I'm not too worried about pinning down the exact answer at the moment, just as long as I know the process is correct. So am I a long the right lines? As the question states to find it at all points in space, I suppose there's only two, inside and outside the conductor, so the B field would have a R<r and R>r bit.

8. Dec 2, 2015

### TSny

OK. Yes, for finding B at any r>R, you would use R for the upper limit in the current calculation. For finding B at r<R, the upper limit is r.

Yes.

9. Dec 2, 2015