# Ampere's law in differential form

## Homework Statement

A long cylindrical wire of radius R0 lies in the z-axis and carries a current density given by:

##j(r)= j_0 \left( \frac{r}{R_0} \right)^2 \ \hat{z} \ for \ r< R_0##

##j(r) = 0 \ elsewhere##

Use the differential form of Ampere's law to calculate the magnetic field B inside and outside the wire.

## Homework Equations

Differential form of Ampere's law: ##\nabla \times B = \mu_0 J##

Curl in cylindrical coordinates:

##\nabla \times B = [\frac{1}{r}\frac{\partial B_z}{\partial \phi}] \hat{r} + [\frac{\partial B_r}{\partial z} - \frac{\partial B_z}{\partial r}] \hat{\phi} + \frac{1}{r} [\frac{\partial}{\partial r} (r B_\phi)-\frac{\partial B_r}{\partial \phi}]##

## The Attempt at a Solution

Could anyone please explain, in the equation above for curl in cylindrical coordinates, which derivative can be non-zero in this case?

If I take this to be the one involving differentiating φ-component with respect to r, then the answer I get for Bin seems to be correct, but Bout is wrong:

##\frac{1}{r} \frac{\partial}{\partial r} (r B_{\phi}) = \mu_0 j_0 (\frac{r}{R_o})^2 \implies B_{in}= \frac{\mu_0 j_0 r^3}{4 R_0^2}##

##\frac{1}{r} \frac{\partial}{\partial r} (r B_{\phi}) = \mu_0 (0) \implies B_{out} = \frac{C}{r}##​

What should I do here?

P.S. I am checking my answers by comparing them to the ones I've obtained using the integral form of Ampere's law:

##I_{enc, in} = \int^r_0 \frac{j_0 r^2}{R_0^2} . 2 \pi r dr =\frac{j_0 2 \pi r^4}{4 R_0^2}, \ I_{enc, out} = \frac{j_0 2 \pi R_0^2}{4}##

##\therefore \oint B_{in} .da =B_{in} 2\pi r= \frac{j_0 2 \pi r^4}{4 R_0^2} \implies B_{in}=\frac{\mu_0 j_0 r^3}{4 R_0^2}, \ B_{out}=\frac{\mu_0 j_0 R_0^2}{4 r}##

Any help would be appreciated.

You don't have a mistake, you just didn't finish your derivation. Namely, the constant $C$ in your expression for $B_{out}$ is yet to be determined. To determine it, you need some boundary condition to apply to $B_{out}$. Do you know what it is?

As for the comparison with the integral form, one simply has to note that $\frac{\mu_0 j_0R_0^2}{4} = const. = C$ where the last equality needs to be proven by the above method.

roam
You don't have a mistake, you just didn't finish your derivation. Namely, the constant $C$ in your expression for $B_{out}$ is yet to be determined. To determine it, you need some boundary condition to apply to $B_{out}$. Do you know what it is?

As for the comparison with the integral form, one simply has to note that $\frac{\mu_0 j_0R_0^2}{4} = const. = C$ where the last equality needs to be proven by the above method.

That makes sense now. But what sort of boundary conditions do I need to apply to ##B_{out}## in order to get the right ##C##? I really have no idea how to solve for ##C##. Any explanation would be helpful.

That makes sense now. But what sort of boundary conditions do I need to apply to ##B_{out}## in order to get the right ##C##? I really have no idea how to solve for ##C##. Any explanation would be helpful.
Well, there are two boundaries in the outer region - the surface of the cylinder (which is the boundary between $\vec{B_{in}}$ and $\vec{B_{out}}$) and $r=\infty$. Concerning the second boundary, one would expect the magnetic field to go to zero at infinity since these points are infinitely far from any magnetic field source (currents). This condition ($\vec{B_{out}}→0$ as $r→\infty$) is alreaady taken care of by the inverse-$r$ relationship that you derived (##\vec{B_{out}} = C/r##). Now, concerning the second boundary: how would you expect the fields $\vec{B_{in}}$ and $\vec{B_{out}}$ to be related in their mutual boundary (in the absence of surface current which is not present in this problem)? i.e., in the place where both $\vec{B_{in}}$ and $\vec{B_{out}}$ exist, how are they related to each other?
You have to remember that both $\vec{B_{in}}$ and $\vec{B_{out}}$ are part of the same function ##\vec{B}##. Can the magnetic field change abruptly from one value to another at such a boundary?

Last edited:
roam
Well, there are two boundaries in the outer region - the surface of the cylinder (which is the boundary between $\vec{B_{in}}$ and $\vec{B_{out}}$) and $r=\infty$. Concerning the second boundary, one would expect the magnetic field to go to zero at infinity since these points are infinitely far from any magnetic field source (currents). This condition ($\vec{B_{out}}→0$ as $r→\infty$) is alreaady taken care of by the inverse-$r$ relationship that you derived (##\vec{B_{out}} = C/r##). Now, concerning the second boundary: how would you expect the fields $\vec{B_{in}}$ and $\vec{B_{out}}$ to be related in their mutual boundary (in the absence of surface current which is not present in this problem)? i.e., in the place where both $\vec{B_{in}}$ and $\vec{B_{out}}$ exist, how are they related to each other?
You have to remember that both $\vec{B_{in}}$ and $\vec{B_{out}}$ are part of the same function ##\vec{B}##. Can the magnetic field change abruptly from one value to another at such a boundary?

Thank you so much for the explanation. It makes perfect sense now. I got the right constant:

##B_{out} (R_0) = \frac{C}{R_0} = \frac{\mu_0 j_0 R_0^3}{4 R_0^2} = B_{in} (R_0) \implies C= \frac{\mu_0 j_0 R_0^2}{4}##

So, the other question I was struggling with was how do we decide which of the derivatives in the expression for ##\nabla \times B## must be non-zero.

So in cylindrical polar coordinates the curl was:

##\nabla \times B = [\frac{1}{r}\frac{\partial B_z}{\partial \phi}] \hat{r} + [\frac{\partial B_r}{\partial z} - \frac{\partial B_z}{\partial r}] \hat{\phi} + \frac{1}{r} [\frac{\partial}{\partial r} (r B_\phi)-\frac{\partial B_r}{\partial \phi}]##

How do we know that only the ##\partial B_{\phi} / \partial r## term must be non-zero? Any explanations or links is greatly appreciated.

So, the other question I was struggling with was how do we decide which of the derivatives in the expression for ##\nabla \times B## must be non-zero.

So in cylindrical polar coordinates the curl was:

##\nabla \times B = [\frac{1}{r}\frac{\partial B_z}{\partial \phi}] \hat{r} + [\frac{\partial B_r}{\partial z} - \frac{\partial B_z}{\partial r}] \hat{\phi} + \frac{1}{r} [\frac{\partial}{\partial r} (r B_\phi)-\frac{\partial B_r}{\partial \phi}]##

How do we know that only the ##\partial B_{\phi} / \partial r## term must be non-zero? Any explanations or links is greatly appreciated.
First of all, the ##\hat{r}## and ##\hat{\phi}## components of the curl are zero because ##\nabla\times\vec{B} = \vec{J}## and ##J_{r}=J_{\phi}=0##. Concerning the ##\hat{z}## component, there are multiple ways to see that the second term vanishes. First, a nice "trick" with cylinders with currents parallel to their axis is that you can consider them to be straight wires, and then remember that the magnetic field is swirling around them by the right hand rule. A more rigorous way is via Biot-Savart law: $$\vec{B} = \frac{\mu_0}{4\pi}\int \frac{\vec{J}\times(\vec{r}-\vec{r}')}{|\vec{r}-\vec{r}'|^3}d\tau'$$ where ##\vec{r}## is the position vector of the point at which the field is being calculated, ##\vec{r}'## is the position vector of a current point and ##d\tau'=dx'dy'dz'=r'dr'd\phi'dz'## is an infinitesimal volume element of current. If you focus on the ##\vec{J}\times(\vec{r}-\vec{r}')## part, you will find that if you integrate it ##d\phi## (i.e. sum it around the cylinder circumferentially), the ##r## component will cancel. Finally, you don't even have to know that ##B_r=0##, you can consider symmetry - your configuration is completely symmetrical in ##\phi## (nothing depends on it - your current density is wholly in ##z## and the same goes for the cylinder). Thus, the field cannot possibly depend on it either and any derivative with respect to it must vanish.

Hope the above explanation makes sense!

roam
Yes, it's absolutely clear to me now. Thank you so much for the wonderful explanation. I do appreciate your time and expertise.