# Physics equations/Magnetic field calculations

## The Biot-Savart law

Geometry for the Biot-Savart law. ${\displaystyle {\vec {B}}={\tfrac {\mu _{0}}{4\pi }}\int {\frac {Id{\vec {\ell }}\times {\hat {r}}}{r^{2}}}}$

The Biot–Savart law is used for computing the resultant magnetic field B at position r generated by a steady current I (for example due to a wire): a continual flow of charges which is constant in time and the charge neither accumulates nor depletes at any point. The law is a physical example of a line integral: evaluated over the path C the electric currents flow. The equation in SI units is:

**Problem: Generalize this line integral to a volume integral involving current density.

- click for solution -

Let J be the current density vector, and let dA be a vector that denotes direction and a small (differential) area. (The direction of dA is normal to the area element). Since the vectors parallel, the inner (dot) product dA equals the scalar product JdA. Also parallel to both J and dA is dL, an element of length along the wire. Since the normal to the area is parallel to the length, dAdL equals dV, which is the volume element. Hence IdL equals JdV, where dL and J both have direction. Thus the line integral over current becomes a volume integral:

${\displaystyle \mathbf {B} ={\frac {\mu _{0}}{4\pi }}\iiint _{V}\ {\frac {(\mathbf {J} \,dV)\times \mathbf {\hat {r}} }{r^{2}}}}$
where dV is the differential element of volume and J is the current density vector.

## Magnetic field lines for typical geometries

- click to see images of magnetic field lines -
 Magnetic field near a long straight wire. Magnetic field due to a current loop. Magnetic field due to a solenoid

## Magnetic field due to a current loop

Magnetic element current loop

*Problem: Show that if circular loop of radius ${\displaystyle a}$ carries a current ${\displaystyle I}$, then the magnetic field at the center of the loop points in the ${\displaystyle {\hat {z}}}$ direction and as a magnitude of:

${\displaystyle B_{\text{center}}={\frac {\mu _{o}I}{2a}}}$.

(This represents the magnetic field at ${\displaystyle z=0}$ in the figure to the right; the magnetic field points in the ${\displaystyle {\hat {z}}}$ direction.)

- click for solution -

The distance from the source current, ${\displaystyle Id{\vec {\ell }}}$, to the field point (at the center) is always ${\displaystyle a\;d{\vec {\ell }}}$. Since ${\displaystyle {\hat {r}}}$ is perpendicular to ${\displaystyle Id{\vec {\ell }}}$, and since their cross product always points along the axis of the loop, we have

${\displaystyle d{\vec {B}}={\frac {\mu _{0}}{4\pi }}{\frac {Id{\vec {\ell }}\times {\hat {r}}}{|r|^{2}}}={\frac {\mu _{0}}{4\pi }}{\frac {Id\ell }{a^{2}}}{\hat {n}}}$

where ${\displaystyle {\hat {n}}}$ is a unit vector pointing along the axis. Since ${\displaystyle \oint d\ell =2\pi a}$, we have our result.

***Problem:Show that if circular loop of radius ${\displaystyle a}$ carries a current ${\displaystyle I}$, then the magnetic field at the at a distance ${\displaystyle z}$ away from the center is in the z direction, has magnitude:

${\displaystyle B(z)={\frac {\mu _{o}I}{2}}{\frac {a^{2}}{\left(z^{2}+a^{2}\right)^{3/2}}}}$
- click for solution -

An element of the magnetic field due to an element of current is shown in the figure above and to the right. Here, ${\displaystyle d{\vec {B}}}$ points downward because the element at the top of the loop was chosen. We seek only the ${\displaystyle z}$ component, so we multiply by the cosine of the acute angle in the right triangle shown: ${\displaystyle dB_{\text{z}}=dBsin(\theta )}$, where

${\displaystyle \sin(\theta )={\frac {a}{\left(z^{2}+a^{2}\right)^{3/2}}}}$

where z is the distance from the center of the loop. The rest of solution resembles the calculation of the magnetic field at the center of a loop.

## Ampère's circuital law

Closed surfaces to the left; open surfaces with boundaries to right.
Understanding Maxwell's displacement current. A current flowing through a wire produces a magnetic field, in accordance with Ampère's law. But a capacitor in the circuit represents a break in the current, so that a surface can avoid penetration by the current by passing between the plates of the capacitor. Maxwell corrected this flaw by postulating that a time-varying electric also generates a magnetic field.

The "integral form" of the original Ampère's circuital law[1] is a line integral of the magnetic field around any closed curve C (This closed curve is arbitrary but it must be closed, meaning that it has no endpoints). The curve C bounds both a surface S, and any current which pierces that surface is said to be enclosed by the surface. The line integral of the magnetic B-field (in tesla, T) around closed curve C is proportional to the total current Ienc passing through a surface S (enclosed by C):

${\displaystyle \oint _{C}{\vec {B}}\cdot \mathrm {d} {\boldsymbol {\ell }}=\mu _{0}I_{\mathrm {enc} }}$

## Maxwell's correction term (displacement current)

This equation might is not generally valid if a time-dependent electric field is present, as was discovered by James Clerk Maxwell, who added the displacement current term to Ampere's law around 1861.[2][3] The need for this extra term can be seen in the figure to the right. The diagram shows a capacitor being charged by current ${\displaystyle I\,}$ flowing through a wire, which creates a magnetic field ${\displaystyle \mathbf {B} \,}$ around it. The magnetic field is found from Ampere's law:

*****Problem: Show that with Maxwell's correction (with ${\displaystyle \partial {\vec {E}}/\partial t}$), Ampere's law becomes:

${\displaystyle \oint _{C}{\vec {B}}\cdot \mathrm {d} {\boldsymbol {\ell }}=\mu _{0}\int _{S}({\vec {J}}+\epsilon _{0}{\frac {\partial {\vec {E}}}{\partial t}})\cdot d\mathbf {S} \,}$

where,

${\displaystyle \int _{S}{\vec {J}}\cdot d\mathbf {S} =I_{\mathrm {enc} }}$
- click for solution -

The equation says that the integral of the magnetic field ${\displaystyle \mathbf {B} \,}$ around a loop ${\displaystyle \partial S\,}$ is equal to the current ${\displaystyle \mathbf {J} \,}$ through any surface spanning the loop, plus a term depending on the rate of change of the electric field ${\displaystyle \mathbf {E} \,}$ through the surface. This term, the second term on the right, is the displacement current. For applications with no time varying electric fields (unchanging charge density) it is zero and is ignored. However in applications with time varying fields, such as circuits with capacitors, it is needed, as shown below. Any surface intersecting the wire, such as ${\displaystyle S_{1}\,}$, has current ${\displaystyle I\,}$ passing through it so Ampere's law gives the correct magnetic field:

${\displaystyle B={\frac {\mu _{0}I}{2\pi r}}\,}$

But surface ${\displaystyle S_{2}\,}$ spanning the same loop that passes between the capacitor's plates has no current flowing through it, so without the displacement current term Ampere's law gives:

${\displaystyle B=0\,}$

So without the displacement current term Ampere's law fails; it gives different results depending on which surface is used, which is inconsistent. The 'displacement current' term provides a second source for the magnetic field besides current; the rate of change of the electric field ${\displaystyle \mathbf {E} \,}$. Between the capacitor's plates, the electric field is increasing, so the rate of change of electric field through the surface ${\displaystyle S_{2}\,}$ is positive, and its magnitude gives the correct value for the field field ${\displaystyle \mathbf {B} \,}$ found above.

## Magnetic field due to a long straight wire

Magnetic field near a long straight wire.

*Problem: Show that in the vicinity of a long, straight wire carrying current ${\displaystyle I\,}$, Ampere's law yields:

${\displaystyle {\vec {B}}={\frac {\mu _{0}I}{2\pi r}}\,{\hat {\theta }}}$

where ${\displaystyle {\hat {\theta }}}$ is a unit vector that points in the azimuthal direction, and ${\displaystyle \mu _{0}}$ is the magnetic constant.

- click for solution -

Do the line integral around on a circle centered around the loop. ${\displaystyle \oint _{C}{\vec {B}}\cdot \mathrm {d} {\boldsymbol {\ell }}=2\pi rB}$

## Magnetic field inside a long thin solenoid

Magnetic field due to a solenoid

*Problem: Show that in the vicinity of a long, thin solenoid of length ${\displaystyle L}$

${\displaystyle {\vec {B}}=\mu _{0}{\frac {N}{L}}I=\mu _{0}n'I}$

where ${\displaystyle I\,}$ is the current, ${\displaystyle N}$ is the number of turns, and ${\displaystyle n'}$ is the number of turns per unit length.

- click for solution -

Do the line integral shown. Of the four paths,only l1 is non-zero. If /ell is the length of that path, then the total current enclosed is n'/ell

## references

1. https://en.wikipedia.org/w/index.php?title=Amp%C3%A8re%27s_circuital_law&oldid=578507291
2. Example taken from Feynman, Richard; Robert Leighton; Matthew Sands (1964) The Feynman Lectures on Physics, Vol.2, Addison-Wesley, USA, p.18-4, using slightly different terminology.
3. https://commons.wikimedia.org/w/index.php?title=File:Displacement_current_in_capacitor.svg&oldid=38260258