# Magnetic field inside and outside cylinder with varying current density [closed]

I am reading through Introduction to Electrodynamics by David J. Griffiths and came across the following problem:

A steady current $I$ flows down a long cylindrical wire of radius $a$. Find the magnetic field, both inside and outside the wire if the current is distributed in such a way that $J$ is proportional to $s$, the distance from the axis.

If $J$ is proportional to the distance from the axis $r$, then we have:

$$\vec{J}(\vec{r})=kr\,\boldsymbol{\hat{z}}$$

We also have:

$$\iint_{\Sigma} \vec{J}(\vec{r})\cdot\:\mathrm{d}\vec{A}=I$$

We therefore have:

$$\int_{0}^{2\pi}\int_{0}^{a}kr^{2}\:\mathrm{d}r\:\mathrm{d}\theta=\frac{2\pi k a^{3}}{3}=I$$

And therefore we have:

$$\vec{J}(\vec{r})=\frac{3Ir}{2\pi a^{3}}\,\boldsymbol{\hat{z}}$$

Using Ampére's law we have:

$$2\pi r B = \mu_{0}I \implies \vec{B}(\vec{r})=\frac{\mu_{0} I}{2\pi r}\,\boldsymbol{\hat{\theta}}$$

If we take a Ampérian loop inside the cylinder, we have:

\begin{align} 2\pi r B &= \mu_{0} \iint_{\Sigma}\vec{J}(\vec{r})\cdot\:\mathrm{d}\vec{A} \\ &= \mu_{0}\int_{0}^{2\pi}\int_{0}^{r}\frac{3 I r'^{2}}{2\pi a^{3}}\:\mathrm{d}r'\:\mathrm{d}\theta \\ &= \frac{\mu_{0} I r^{3}}{a^{3}} \end{align}

And therefore we have:

$$\vec{B}(\vec{r})=\begin{cases}\frac{\mu_{0} I r^{2}}{2\pi a^{3}} \,\boldsymbol{\hat{\theta}} & r < a \\ \frac{\mu_{0} I}{2\pi r}\,\boldsymbol{\hat{\theta}} & r \geq a \end{cases}$$

Is this the correct magnitude and direction of the magnetic field?

## closed as off-topic by Rob Jeffries, Danu, ACuriousMind♦, Qmechanic♦Sep 9 '15 at 14:34

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "Homework-like questions should ask about a specific physics concept and show some effort to work through the problem. We want our questions to be useful to the broader community, and to future users. See our meta site for more guidance on how to edit your question to make it better" – Rob Jeffries, Danu, ACuriousMind, Qmechanic
If this question can be reworded to fit the rules in the help center, please edit the question.

• Final check - continuity of the solution at the boundary $r=a$. Which complements the sanity check you did. – Floris Oct 7 '14 at 4:10