\chapter{Magnetostatics}

\section{Basic concepts}

Magnetostatics aims at the description of all phenomena that involve 
non-changing magnetic fields. Qualitative knowledge about magnetostatics
has been around for many centuries: it is possible to use a magnet needle to 
make a compass without knowing how to quantify magnetic processes. In this
section some basic concepts of magnetism are discussed.

In electrostatics you are familiar with the fact you have positive and 
negative charges. The charges for magnetostatics always come in pairs. In a 
magnet
one side is the magnetic-positive side, while the other side is the 
magnetic-negative side. The magnetic-positive side we like to call the 
'north-pole' and the magnetic-negative side the 'south-pole'. Off course this
naming is derived from our own earth, which itself is a permanent magnet. 
Forces between magnets are such that a north- and a south pole attract each 
other, while there is a repelling force between two poles of the same kind.

Now you could decide to cut a magnet in half, just between the north- and the 
south pole, in order to obtain a north-pole and a south-pole separately. The
result of your experiment, however, will be that you will have indeed two 
magnets, both with a north AND a south pole (see Fig.~\ref{fig:north_south}).
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.6\textwidth]{NoMonopoles.eps}
  \caption[]{\label{fig:north_south} \sl Cutting a magnet in two pieces will
    only result in creating two magnets, each with a magnetic north- and 
    south pole. You can repeat cutting, but you will not create a magnetic 
    monopole.}
  \end{center}
\end{figure}
You can repeat this as many times as you like, but the only thing you will 
succeed in, is to get many more small magnets. As far as we know no magnetic
monopoles exist!

Also it is well known that compared to gravity the magnitude of the magnetic 
force is huge. It is very common for even small magnets to 
lift little (or sometimes big) pieces of iron, against the gravitational force
from the whole earth!

In addition there exists an intricate relation between electrical currents 
and magnetic field, which will become clear further in these lecture notes.
The unit of a magnetic field is called the Tesla, and it can be described in
terms of other units as:
\begin{equation}
[Tesla] = [N]/([A][m]) = [N][s]/([C][m]) = [kg]/([C][s])
\end{equation}
with $[A] = [C]/[s]$ an electrical current, and $[N]$ the unit of force. 

\section{Lorentz force}

\subsection{Experimental basis and formulation}
 
The Dutch physicist Hendrik Antoon Lorentz  was the first to quantify
the movement of an electrically charged particle inside a constant magnetic 
field. Just as Coulomb's law that describes forces in electrostatics, the
law for the force caused by a magnetic field is based on experimental data:
\begin{enumerate}
\item{The Lorentz force is proportional to the strength of the magnetic field;}
\item{The Lorentz force is proportional to the electric charge;}
\item{The Lorentz force is proportional to the velocity of the object it 
  acts on;}
\item{The Lorentz force is proportional to the sine of the angle between 
  the velocity vector and the speed vector;}
\item{The Lorentz force is perpendicular to both the velocity direction 
  and the direction of the magnetic field;}
\end{enumerate}
This list of experimental data can be elegantly translated into the following 
mathematical statement, that fully describes the force of a magnetic field 
$\vec{B}$ on a moving object with charge $q$ and a velocity $\vec{v}$:
\begin{equation}
\label{eq:lorentz}
\vec{F} = q \vec{v} \times \vec{B}
\end{equation}
The $\times$ in equation~\ref{eq:lorentz} represents the 'cross-product' 
between 
two vectors. With our knowledge of the cross product we can prove that the 
Lorentz force actually obeys the experimental data as listed above. The 
magnitude of the Lorentz force is given by:
\begin{eqnarray}
  |\vec{F}| & = & q |\vec{v} \times \vec{B}| \nonumber \\
            & = & q |\vec{v}||\vec{B}| \sin\theta
\end{eqnarray}
with $\theta$ the angle between the magnetic field lines and the velocity 
vector. From the last equation it can be seen that the first four experimental
requirements on the Lorentz force have been fulfilled. 

\subsection{The direction of the Lorentz force}

When it comes to proving that the Lorentz force fulfills the last requirement
things are slightly more complicated, since we now have to calculate the 
{\sl direction} of the force. Remember that for electrostatics the electrical 
force was just proportional to the size and direction of the electrical field. 
For the Lorentz force this is not the case, since we are dealing with a 
cross-product of two vectors. Now we have too look into the detail of the 
cross-product: what is the direction of the result vector? First we will 
work out mathematically what is the direction of the field.
The cross product between any two vectors $\vec{v}= (v_x, v_y, v_z)$ and 
$\vec{B} = (B_x, B_y, B_z)$ can be calculated by evaluating the following 
determinant (try this yourself and you will be a commander of cross-products!):
\begin{eqnarray}
\vec{v}\times\vec{B} & = &  
  \left|
    \begin{array}{ccc}
      \hat{x} & \hat{y} & \hat{z} \\
      v_x     & v_y     & v_z     \\
      B_x     & B_y     & B_z 
    \end{array}
  \right| \nonumber  \\
 & = & 
  (v_y B_z - v_z B_y)~\hat{x} + 
  (v_z B_x - v_x B_z)~\hat{y} +
  (v_x B_y - v_y B_x)~\hat{z} \nonumber \\ 
  \label{eq:fl_explicit}
 & = & 
  \left(
  \begin{array}{c}
    v_y B_z - v_z B_y \\
    v_z B_x - v_x B_z \\
    v_x B_y - v_y B_x
  \end{array}
  \right)
\end{eqnarray}
This general equation might not tell the full story of the direction of the
Lorentz force directly, but we can prove that the direction of the force is 
both perpendicular to the velocity vector and the magnetic field vector. 
Two vectors are perpendicular if their {\sl inner product} equals zero 
(remember: $\vec{A}\cdot\vec{B}=|A||B|\cos\theta$), so we have to validate 
that:
\begin{equation}
  \label{eq:Fvzero}
  \vec{F} \cdot \vec{v} = 0
\end{equation}
We can explicitly calculate the inner product using 
equation~\ref{eq:fl_explicit} as follows:
\begin{eqnarray}
  \vec{F}\cdot\vec{v} & = & q (\vec{v}\times\vec{B})\cdot\vec{v} \nonumber \\
  & = & q (v_y B_z - v_z B_y)~v_x + \nonumber\\
  &   & q (v_z B_x - v_x B_z)~v_y +
        q (v_x B_y - v_y B_x)~v_z \nonumber \\
  & = & q B_x (v_z v_y - v_y v_z) + q B_y (- v_z v_x + v_z v_y) +
        q B_z (v_y v_x - v_x v_y) \nonumber\\
  & = & 0
\end{eqnarray}
Following similar tactics you can now prove yourself that the Lorentz force 
is also perpendicular to the magnetic field In fact you then have 
proved a general property of cross-products between vectors $\vec{A}$ and 
$\vec{B}$:
\begin{eqnarray}
  \vec{A}\cdot(\vec{A}\times\vec{B}) & = & 0 \\
  \vec{B}\cdot(\vec{A}\times\vec{B}) & = & 0
\end{eqnarray}
Note that the second statement follows directly from the first, because of 
another property of the cross-product:
\begin{eqnarray}
  \vec{A} \times \vec{B} = - \vec{B} \times \vec{A}
\end{eqnarray}
Prove this!

\subsection{A force without work}

A very important consequence of the fact that the Lorentz force is 
perpendicular to the velocity of an object, is that the Lorentz force does
not do any work. To understand this a bit more in detail we have to recall 
our definition of work $W$ being done by a force. It has been defined as the 
displacement in the direction of the force, or as an equation:
\begin{equation}
  W = \intLine \vec{F} \cdot \vec{dl}
\end{equation}
This can be rewritten with a change of variables as:
\begin{equation}
  W = \intLine \vec{F} \cdot \vec{v} dt
\end{equation}
The last equation is clearly zero due to equation~\ref{eq:Fvzero}. The
consequence of this is that if a charged particle moves through a magnetic 
field its energy does not change, since that requires work done. So the only
thing that does change is the {\sl direction} of the velocity. This is 
really special to the Lorentz force: all other forces you have thus far 
encountered, like the Coulomb force or gravitational force, do actually work.

\subsection{The right-hand-rule}

Now it is time to get a clearer understanding of the direction of the 
Lorentz force by studying a simple example. Let's look at a configuration
with a magnetic field 
$\vec{B} = (0,0,B)$ pointing in the $\hat{z}$ direction and a particle with
charge $q$ moving with velocity $\vec{v}=(v,0,0)$ in the $\hat{x}$ direction.
The equation now becomes much more explicit and clear:
\begin{equation}
\vec{F} = - q v B \hat{y}
\end{equation}
You can verify that all requirements on the Lorentz force as mentioned before 
are still fulfilled ($\sin\frac{\pi}{2} = 1$!) and also you can see that the 
direction of the Lorentz force can be obtained without calculation, by using
the (in)-famous 'right hand rule'. Stretch out your hand and make your thumb
point in the direction of $\vec{v}$. Point your other fingers in the direction
of the magnetic field $\vec{B}$. The cross-product $\vec{v}\times\vec{B}$ is
now pointing out of the palm of your hand. Exercise this a couple of times
and you will never make any mistakes in pointing out the direction of  
cross-product. Be however careful that a negative electric charge does flip 
the direction of the Lorentz force by $180^{\circ}$.

\subsection{Example: force on a wire}

What happens if you place a wire of length $L$ carrying a current $I$, 
inside a homogeneous magnetic field, $B$~(see Fig.~\ref{fig:ForceOnWire})? 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{ForceOnWire.eps}
  \caption[]{\label{fig:ForceOnWire} \sl A wire with length $L$ is placed 
    inside a homogeneous magnetic field $B$ with field lines pointing out
  of the paper.}
  \end{center}
\end{figure}
The direction of the force can be found using the right hand rule. The 
electrons move in the opposite direction as the current, but they have a 
negative charge. So the direction of the force is the direction of the
cross product of $\vec{I}$ and $\vec{B}$. The size of the force is calculated
by integrating:
\begin{eqnarray}
  |\vec{F}| & = & \intLine dq (\vec{v}\times\vec{B}) \nonumber \\
  & = & \intLine \lambda dl (\vec{v}\times\vec{B}) \nonumber \\
  & = & \intLine dl (\vec{I}\times\vec{B}) \nonumber \\
  \label{eq:Fonwire}
  & = & L I B
\end{eqnarray}
We have used the fact that the line charge density $\lambda$ multiplied by 
the velocity of the electrons gives the electrical current $I$. So we
now have an equation that tells us that the Lorentz force of a magnetic 
field on a wire carrying a current $I$ is equal to:
\begin{equation}
  d\vec{F} = dl (\vec{I}\times\vec{B})
\end{equation}

\subsection{Current loops \& Magnetic dipoles \label{sec:dipole}}

Now let us consider a square wire loop with sides of length $L$
carrying a current $I$, placed in a homogeneous magnetic field $\vec{B}$ 
(see Fig.~\ref{fig:WireLoop}).
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{WireLoop.eps}
  \caption[]{\label{fig:WireLoop} \sl A square wire loop with sides $L$ 
    and carrying a current $I$ is placed 
    inside a homogeneous magnetic field $B$.}
  \end{center}
\end{figure}
The forces on each of the sides of the loop can be calculated in the
same way as shown in the previous paragraph:
\begin{equation}
\vec{F} = L (\vec{I}\times\vec{B})
\end{equation}
It can be seen that the net force on the wire loop is zero, since the forces
on top and bottom of the loop cancel each other, just as the forces on both
of the sides. However, there is a {\it torque} on the current loop! The 
torque, $\tau$, exerted on for example the left side of the loop is 
just the size of the Lorentz force times the 'arm' the force. So:
\begin{equation}
\tau_L = (L I B) \frac{L}{2} \sin\theta
\end{equation}
In he right side of the loop the Lorentz force points in the 
opposite direction, but the arm of the force also points in the opposite
direction. So the total torque becomes:
\begin{equation}
\label{eq:TorqueOnWireLoop}
\tau = L^2 I B \sin\theta
\end{equation}
Notice that the bottom and top sides of the current loop do not contribute 
to the torque. The Lorentz force is certainly pulling of the wire there
as well, but it is trying to stretch the wire loop instead of trying to rotate
it (try to understand this yourself).

At this point it is instructive to rewrite equation\ref{eq:TorqueOnWireLoop} as
the following cross-product:
\begin{equation}
\vec{\tau} = \vec{m}\times{\vec{B}}
\end{equation}
where $\vec{m}$ is the {\it magnetic dipole moment} of the current loop. The 
direction of the magnetic dipole moment is perpendicular to the plane spanned
by the wire loop. Its size is just the current multiplied by the surface area:
\begin{equation}
|\vec{m}| = L^2 I
\end{equation}
The torque exerted on the wire loop tries to rotate it such that it is 
perpendicular to the magnetic field lines. In terms of a magnetic dipole
moment we can make a more general statement: a magnetic field tries to set 
magnetic dipoles parallel to the magnetic field lines.


\section{Biot-Savart's law}

Now we have learned in the previous section how to calculate the force exerted
by a magnetic field on a moving charge, we have to know how to actually
calculate a magnetic field. Magnetic fields are caused by
electric currents. An expression that relates the magnetic field, $\vec{B}_P$,
in a point $P$ to an electric current, $I$, is called the law of Biot-Savart:
\begin{equation}
  \label{eq:biotsavart}
  \vec{B}_{P} = \frac{\mu_0 I}{4 \pi} 
  \intLine \frac{d\vec{l}\times\hat{r}}{r^2} 
\end{equation}
The integration is done along the current path in the direction of the flow;
$d\vec{l}$ is an element of length along the wire and $\hat{r}$ is the 
direction vector from the location of $d\vec{l}$ and the point $P$ as is 
sketched in Fig.~\ref{fig:BiotSavart}. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{BiotSavart.eps}
  \caption[]{\label{fig:BiotSavart} \sl Variables needed to calculate 
   the magnetic field in a point $P$ due to an infinitesimal wire
   element with length $d\vec{l}$ at a distance $\vec{r}$.
  }
  \end{center}
\end{figure}
Try to verify by using the right-hand-rule that the magnetic field due to 
the infinitesimal wire element in Fig.~\ref{fig:BiotSavart} is pointing into
the paper. When using Eq.~\ref{eq:biotsavart} you should realize that along 
your integration path  both $d\vec{l}$, $\hat{r}$, and $r$ may change, both
in magnitude and direction! To master this equation practice is mandatory.

The constant $\mu_0$ is called the magnetic permeability which is defined as:
\begin{equation}
  \mu_0 \equiv 4\pi~10^{-7} \frac{N}{A^2}
\end{equation}
A remarkable thing happens when the magnetic permeability is multiplied with 
the electrical permittivity $\epsilon_0$. Remember that $\epsilon_0$ was 
defined  as:
\begin{equation}
  \epsilon_0 \equiv \frac{1}{4\pi~10^{-7} c^2} \frac{C^2}{Nm^2}
\end{equation}
The multiplication leads to:
\begin{equation}
\frac{1}{\epsilon_0 \mu_0} = c^2
\end{equation}
with $c$ the speed of light. This amazing results indicates that there 
might be a special relationship between electric and magnetic field. This
relationship will be unveiled toward the end of this course.

\subsection{A wire with a current}

With Biot-Savart's law we are now able to calculate the magnetic field 
for any current configurations. So let us start with the calculation of the 
magnetic field of a relatively simple example: an infinitely  long wire 
carrying a current $I$ (see Fig.~\ref{fig:biotsavart_wire}).
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{BfieldWire.eps}
  \caption[]{\label{fig:biotsavart_wire} \sl Wire carrying a current $I$. 
    The magnetic field is calculated at a point $P$ at a distance $r$ 
    from the wire.
  }
  \end{center}
\end{figure}
We could start calculating like blind chickens at this point, but we
can also use {\sl symmetry} arguments to argue what the direction of the 
field must be. The cylindrical symmetry of this example excludes the 
existence of a radial component to the magnetic field. We can try to argue 
that this  is impossible by making a 'gedanken' experiment: we can rotate the
infinitely long wire by $180^{\circ}$ so the current is now pointing in
the downward direction. As can be seen in the law of Biot-Savart changing the
sign of the current would result in flipping the sign of the $\vec{B}$ field.
However, the rotation of the wire leaves the radial component of the magnetic
field pointing in the same direction as before. So there can exist no 
radial magnetic field in our example. The component of the magnetic field
pointing {\sl along} the direction of the wire drops out because the
contribution coming from the current at $z<0$ is canceled exactly 
by the contribution from the current at $z>0$ (try to prove and visualize 
this yourself). 

So the only component of the magnetic field that is not equal to zero is 
the component in the azimuthal, $\phi$, direction. Its size is calculated 
with Biot-Savart's law~\ref{eq:biotsavart}, but we have to be extremely careful
how to fill in the variables in the equation. Let us consider the magnetic
field caused by an infinitesimal line element $\vec{dz}$ first 
(see Fig.~\ref{fig:biotsavart_wire}): the magnitude 
of the magnetic field in point $P$ due to this line element is:
\begin{equation}
  |d\vec{B}_P| = \frac{\mu_0 I}{4\pi} \frac{|d\vec{z}|\sin\alpha}{r^2+z^2}
\end{equation}
There are a couple of variables in this equation that at first might seem a bit
strange. First there is the $r^2+z^2$ term, while you would expect a $r^2$ 
term if you look at the Biot-Savart law. But in fact the $r^2+z^2$ is correct
since it is the distance between the line element $\vec{dz}$ and the point
$P$. So the $r$ in Biot-Savart's law is a very different $r$ than is used
to indicate the radius in cylindrical coordinates. The same is the case
for $\hat{r}$ which indicates the unit vector in the direction of the line
element $\vec{dz}$ and the point $P$, and thus also has nothing to do with
the radius in cylindrical coordinates. You must think very well before just 
using a formula! The $\sin\alpha$ comes from the size of the cross product:
\begin{equation}
  |\vec{dz}\times\hat{r}|=dz\sin\alpha
\end{equation}
where $\alpha$ is the angle between $\vec{dz}$ and $\hat{r}$. It can
be geometrically worked out to be:
\begin{equation}
  \sin\alpha = \frac{r}{\sqrt{r^2+z^2}}
\end{equation}
 
Now we can calculate the magnetic field adding the contributions from
all line elements to the magnetic field. 
\begin{eqnarray}
  |\vec{B}_P| & = & \left| \intLine d \vec{B}_{\phi} \right| \nonumber \\
              & = & \frac{\mu_0 I}{4\pi} \int_{-\infty}^{+\infty} 
  \frac{dz}{r^2 + z^2}\frac{r}{\sqrt{r^2+z^2}} \nonumber \\
  & = & \frac{\mu_0 I}{4 \pi} \left. \frac{z}{r\sqrt{r^2+z^2}}
  \right|_{-\infty}^{+\infty} \nonumber \\
  \label{eq:Bfieldwire}
  & = & \frac{\mu_0 I}{2\pi r}
\end{eqnarray}
The integral over $z$ you do not have to be able to solve yourself. If
you encounter such an integral at any point we will provide you with the 
answer. However you can verify the answer by differentiating the one but
last equation.

\subsection{Two parallel wires}

We can now consider a configuration with two parallel wires with length $L$ at
a distance $\vec{R}_{12}$ each carrying an electrical current, $I_1$
and $I_2$,respectively~(see~Fig.~\ref{fig:TwoWires}). We can calculate the magnetic 
field at the position of the second wire, due to the current in the other wire
using equation~\ref{eq:Bfieldwire}.
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{TwoWires.eps}
  \caption[]{\label{fig:TwoWires} \sl Two wires with electric currents both
  generate a magnetic field. The magnetic fields result in a Lorentz force on 
  the wires.}
  \end{center}
\end{figure}
The equation for the Lorentz force on a wire (Eq.~\ref{eq:Fonwire})
tells us that:
\begin{eqnarray}
  |\vec{F}_2| & = & L |(\vec{I_2}\times\vec{B}_1)| \\
  & = & \frac{\mu_0 L I_2 I_1}{2\pi R_{12}}
\end{eqnarray}
The calculation of the size of the cross product is fairly easy since there 
are only $90^{\circ}$ angles involved in this example. I leave it up to you
to show that the Lorentz force between the wires is attractive if the currents 
point in the same direction.

\subsection{Knowledge and Skills}

The knowledge and skills you should have acquired during reading of the 
previous can be summarized as follows:
\begin{itemize}
\item{Magnets always have a north- and a south pole. Magnetic monopoles
do not exist;}
\item{The Lorentz force of a magnetic field on a moving charge is:
\begin{equation}
  \vec{F}_L = q \vec{v}\times\vec{B}
\end{equation} 
Make sure you can figure out both the {\it size} and the {\it direction}
of the Lorentz force. For the direction make sure that you are comfortable 
with the right-hand-rule;}
\item{The Lorentz force on a straight wire segment is:
\begin{equation}
  \vec{F} = L (\vec{I}\times\vec{B})
\end{equation};
}
\item{The torque on a current loop is:
\begin{equation}
\tau = \vec{m}\times\vec{B}
\end{equation}
where $\vec{m}$ is the magnetic dipole moment;
}
\item{The law of Biot-Savart can be used to calculate magnetic fields that
are caused by line currents:
\begin{equation}
  \vec{B}_{P} = \frac{\mu_0 I}{4 \pi} 
  \intLine \frac{d\vec{l}\times\hat{r}}{r^2} 
\end{equation}
}
\end{itemize}


\section{Intermezzo: Current densities}

In the previous section we used currents all the time. Just as for electric 
charges it is often instructive to talk about current densities instead 
of currents. We can speak of {\sl line}, {\sl surface}, and {\sl volume}
current densities (see Fig.~\ref{fig:Currents}). 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.9\textwidth]{Currents.eps}
  \caption[]{\label{fig:Currents} \sl Different types of current densities: 
  a) shows a line current density, b) a surface current density, and c) shows 
  volume current density.}
  \end{center}
\end{figure}
A line current is defined
as the charge density per meter, $\lambda$, times the velocity of the charges:
\begin{equation}
  \vec{I} = \lambda \vec{v} \rightarrow [I] = C/s = A~\mbox{(Ampere)}
\end{equation}
The size of the current is just the magnitude of the vector $\vec{I}$. The
corresponding Lorentz forces are calculated as:
\begin{equation}
  \vec{F}_L = \intLine \vec{I}\times\vec{B} dl = 
  I \intLine \vec{I}\times\vec{B}
\end{equation}
For surface currents the situation is similar~(see Fig.~\ref{fig:Currents}b):
\begin{eqnarray}
  \vec{K} & \equiv & \frac{d\vec{I}}{dl_{\perp}} \rightarrow [K] = A/m\\
          & = & \sigma \vec{v}
\end{eqnarray}
To obtain a current one now has to multiply the surface current density, 
$\vec{K}$, with the length of the surface. Or to be more precise one has to 
integrate the current density along a surface if the current density is not 
a constant. The Lorentz force is now:
\begin{equation}
  \vec{F} = \intSurface \vec{K}\times\vec{B} do
\end{equation}
Biot-Savart's law can be used again to calculate the magnetic field resulting
from  a surface current density:
\begin{equation}
\vec{B} = \frac{\mu_0}{4\pi}\intSurface
\frac{\vec{K}(\vec{r}')\times\hat{d}}
    {d^2}do'
\end{equation}
where the integration is over the surface carrying the current, and 
$\vec{d} = \vec{r} - \vec{r}'$.

Most frequent you will encounter volume currents, $\vec{J}$, which are 
defined as:
\begin{eqnarray}
  \vec{J} &\equiv & \frac{d\vec{I}}{do_{\perp}} \rightarrow [J] = A/m^2 \\
  & = & \rho \vec{v}
\end{eqnarray}
The differentiation with respect to $do_{\perp}$ gives a vector pointing
through a surface: the size of $\vec{J}$ is the current per unit area 
perpendicular to the flow. For example take a wire with radius $R$ and a 
current $I$. If we now assume that the current density is homogeneous, we can 
obtain the current density $\vec{J}$, by simply dividing $I$ by the surface
$\pi R^2$ of the wire. The direction of $\vec{J}$ is along the direction of
current flow. The Lorentz force can be calculated through the volume 
integral:
\begin{equation}
  \vec{F} = \intVolume \vec{J}\times\vec{B} dV
\end{equation}
Try to prove this last equation yourself.
Once more Biot-Savart's law can be used to calculate the magnetic field 
resulting from  a volume current density:
\begin{equation}
\vec{B} = \frac{\mu_0}{4\pi}\intVolume\frac{\vec{J}(\vec{r}')\times\hat{d}}
    {d^2}dV'
\end{equation}
where the integration is over the volume carrying the current, and 
$\vec{d} = \vec{r} - \vec{r}'$.


\section{Ampere's law}

We now know how to calculate magnetic fields in any configuration using
the Biot-Savart law in principle. We can have a closer look at the properties 
of magnetic 
fields to see if there are laws, like Gauss's law for electrical fields, 
that can simplify our calculation of magnetic fields in certain cases. 
Let us go back to the magnetic field of a wire carrying a current:
\begin{equation}
B_{\phi} = \frac{\mu_0 I }{2 \pi r}, B_r = B_z = 0
\end{equation}
We can take a circular path around the wire, so that the line 
integral:
\begin{equation}
\intLine \vec{B}\cdot d\vec{l} = \mu_0 I
\end{equation}
where the $\int$ represents an integral in a path around the wire. In fact
the path does not have to be a circle; any path around the wire will give
exactly the same answer (can you prove this one? see Griffiths section~5.3.1). 
We can generalize this law a bit further to obtain:
\begin{equation}
\intLine \vec{B}\cdot d\vec{l} = \mu_0 \intSurface \vec{J} \cdot d\vec{o}
\end{equation}
This equation is known as the law of Ampere: it states that the integral of the
magnetic field along a closed path is equal to the total current that is 
enclosed by the path. We have seen that it is true
for a thin wire carrying a current. It can be explicitly proven, 
using the Biot-Savart law and the superposition principle, that it is true in 
general for any current density causing a magnetic field.
(see Griffiths section~5.3.2). 

The law of Ampere is always true, but for calculation of magnetic 
fields it is useful only if there is a high degree of {\sl symmetry} in
the configuration you want to solve. The reason for this is that in that 
case the
line integral $\int \vec{B} \vec{dl}$ can become easy to solve. This
is especially true if you know that the magnetic field over your
integration path is constant, since the magnetic field then drops out of the
integral, or in an equation:
\begin{equation}
\intLine \vec{B}\vec{dl} \rightarrow \vec{B} \intLine \vec{dl}
\end{equation}
In the next sections we show a selection of examples where the
magnetic fields can be calculated in a fairly easy way, using the law
of Ampere.

\subsection{Thick wire with a current \label{sec:thickwire}}

In the previous section you have already seen how Ampere's law can be used to
calculate the magnetic field outside a wire. Now let us consider a wire
with a radius $R$ carrying a current $\vec{I}$ distributed homogeneously
over the wire (see Fig.~\ref{fig:thickwire}). 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{BfieldThickWire.eps}
  \caption[]{\label{fig:thickwire} \sl A thick wire of radius $R$ carrying
  a current $I$ that is homogeneously distributed.}
  \end{center}
\end{figure}
The current density $\vec{J}$
in this case is just the total current divided by the surface of a 
cross-section through the wire:
\begin{equation}
\vec{J} = \frac{\vec{I}}{\pi R^2}
\end{equation}
From the symmetry of the problem we can conclude that the magnetic field 
only has a component pointing in the azimuthal ($\phi$) direction, and
that it only depends on the radius $r$. Ampere's law inside the wire
now reduces to:
\begin{eqnarray}
\intLine \vec{B}\vec{dl} & = & \mu_0 \intSurface \vec{J}\vec{do}\\
B \cdot 2\pi r & = & \frac{\mu_0 I r^2}{R^2} 
\end{eqnarray}
so that the magnetic field in the $\phi$ direction as a function of $r$
now becomes:
\begin{equation}
B(r<R) = \frac{\mu_0 I r}{\pi R^2}
\end{equation}
Outside the wire you can show (see previous section) that the magnetic
field is the same as for an infinitely thin wire. Off course if you do not
{\it see} the cylindrical symmetry in a problem like this you can always 
use the law of Biot-Savart to calculate the magnetic field. The advantage
is that you are always right to use this law, the disadvantage is that you
will have to calculate much more complicated integrals. Remember for example
how much work it was to find the magnetic field of a wire with the
Biot-Savart law!
 
\subsection{Plane with a homogeneous current density}

As a next example of the Ampere's law we calculate the magnetic field 
of an infinite plane carrying a current density $\vec{K}$ (A/m) as shown in 
Fig.~\ref{fig:bplane}.  
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{BfieldPlane.eps}
  \caption[]{\label{fig:bplane} \sl An infinitely big plane with homogeneous
    current density $\vec{K}$.}
  \end{center}
\end{figure}
The plane is lying in the $y-z$ plane and the
current is flowing in the $y$ direction. Since we know that magnetic
fields to be perpendicular to the currents causing them, the magnetic field
cannot have a component in the $y$ direction. From a clever symmetry 
argument we can also show that the component of the B-field perpendicular
to the plane must also be zero. Suppose there were a component of the
magnetic field in the $x$ direction. Then rotate the whole (infinite!) 
plane $180^{\circ}$ around the $x$ axis. The current is now pointing in
the opposite  direction, while the $x$ component of the B-field is unaffected.
This is a clear contradiction and thus the $x$ component of the 
magnetic field must be zero as well. We are only left with a magnetic
field parallel to the plane in the $z$ direction.

Now we can use Ampere's law to calculate the magnitude of the field, by
constructing an imaginary rectangular path as shown in Fig.~\ref{fig:bplane}.
Along this path we can again calculate the integral $\intLine \vec{B}d\vec{l}$.
The sides of the rectangle that are perpendicular to the plane do not contribute
to the line integral since we just showed that the magnetic field does
not have a component perpendicular to the plane, so we are left with the 
two sides that are parallel to the plane. So:
\begin{equation}
\intLine\vec{B}d\vec{l} = 2 a B_z
\end{equation}
Ampere's law tells us that this integral should be equal to $\mu_0$ times
the enclosed current. So we can now solve the $\vec{B}$ field:
\begin{eqnarray}
  2 a B_z & = & \mu_0 K a \\
          & \Downarrow & \\
  B_z & = & \frac{\mu_0 K }{2}
\end{eqnarray}
So the field is homogeneous on either side of the plane. Only the sign of
the magnetic field flips (try to confirm the direction yourself by using the
right-hand-rule).

\subsection{The Solenoid \label{sec:solenoid}}

An even more complicated configuration that is made simple by Ampere's
law is the solenoid. A solenoid is an infinitely long cylinder of radius $R$
over which a wire carrying a current $I$ is wrapped around with $N$ windings
per meter (see Fig.~\ref{fig:bsolenoid}). 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{BfieldSolenoid.eps}
  \caption[]{\label{fig:bsolenoid} \sl A solenoid with radius $R$ and current
    $I$ running through $N$ windings per meter.}
  \end{center}
\end{figure}
We can start-off with a couple
of symmetry arguments to reduce some of the components of the magnetic field
to zero, just as we did before for the infinite plane. First there can be
no component in the $\phi$ direction, since it is parallel to the current. 
Secondly, suppose there is a radial component to the field. Then by
rotating the cylinder around the $x$ axis over $180^{\circ}$ the current 
is now going in the 
opposite direction and the radial component of the $B$ field is unaffected:
contradiction!  The radial component of the field can only be zero, so we 
are left with only a $z$ component.

Let's first calculate the field {\it outside} the solenoid. We can take
the line integral around a path indicated by~{\bf 1} in 
Fig.~\ref{fig:bsolenoid}. There is no enclosed current so Ampere's law
reduces to:
\begin{equation}
\intLine\vec{B}d\vec{l} = 0
\end{equation}
We can safely assume that the magnetic field should go to zero when the far end
of the integration path goes to infinity. In that case we only get a 
contribution to the path integral from the line piece at $r=r$. Since
the total integral needs to be zero, this can only be true if the field
itself is zero. So outside a solenoid the magnetic field is zero!

The field inside we can obtain by integrating the B-field along the
path indicated by ~{\bf 2} in Fig.~\ref{fig:bsolenoid}. The only contribution
to the integral is from the path inside the solenoid parallel to the $z$ axis.
The enclosed current is simply:
\begin{equation}
  I_{\mbox{\scriptsize enclosed}} = a I N
\end{equation}
Ampere's law is now written as:
\begin{eqnarray}
 \intLine \vec{B} d\vec{l} & = & \mu_0 \intSurface \vec{J}d\vec{o} \\
 B_z a & = & \mu_0 a I N \\
 & \Downarrow & \\
 B_z & = & \mu_0 I N
\end{eqnarray}
A surprisingly simple answer for such a complicated configuration.

\subsection{Knowledge and Skills}

The knowledge and skills you should have acquired during reading of the 
previous can be summarized as follows:
\begin{itemize}
\item{You should be familiar with {\it line}, {\it surface} and {\it volume}
currents;}
\item{You should be able to calculate the Lorentz force on these different
kinds of current densities;}
\item{You should be able to write down and use Ampere's law to calculate
magnetic fields in situations with a high degree of symmetry.}
\end{itemize}


\section{Field equations}

In this section we will give an overview of the equations that give
a full description of electro- and magnetostatics. In order to do so
there is one more bit of mathematics you need to know.

\subsection{Stokes' theorem}

The last bit of math you need to know before we can complete the
theory of electro- and magneticstatics is the theorem of Stokes. In
electrostatics Gauss's law (see section~\ref{section:gauss}) gave a relation
between surface integrals of the electrical field and a volume integral
of a charge density. It turns out that for the line integrations you encounter
in magnetostatics a similar type of relation can be found. For any vector
field the integral around a surface is equal to the curl of the 
vector field integrated over the surface:
\begin{equation}
\label{eq:stokes}
\intLine \vec{A}\cdot d\vec{l} = \intSurface (\rot \vec{A})d\vec{o} 
\end{equation}
We will not rigorously prove Stokes theorem, but we will try to give 
a more hand-waving argument to make it acceptable to you. Assume you have
a vector field $\vec{A}\mbox{(x, y, z)}$ and you want to calculate the
path integral of the vector field around an infinitesimal small loop in the
plane $z=0$ as shown in Fig.~\ref{fig:stokes1}. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.5\textwidth]{StokesInfinitesimal.eps}
  \caption[]{\label{fig:stokes1} \sl Vector field integrated along a path
    enclosing an infinitesimal loop in the $xy$ plane.}
  \end{center}
\end{figure}
The line integral $\intLine \vec{A} d\vec{l}$
is then split up in four parts, with a contribution from each of the sides
of the little square. For each of the sides we must think what $d\vec{l}$ 
should be, especially paying attention to the plus and minus signs. 
Along path {\bf 1} $d\vec{l} = \mbox{(dx, 0, 0)}$, along path {\bf 2} 
we move in the positive $y$ direction so $d\vec{l} = \mbox{(0, dy, 0)}$.
Paths {\bf 3} and {\bf 4} are in the $-x$ and $-y$ direction, respectively,
so they pick up a minus sign with respect to paths {\bf 1} and {\bf 2}.
So the line integration becomes:
\begin{eqnarray}
  \intLine \vec{A} d\vec{l} & = & 
  \int_{x}^{x+dx} A_x(x', y) dx' +
  \int_{y}^{y+dy} A_y(x, y') dy' - \\
 & &  \int_{x+dx}^{x} A_x(x', y+dy) dx' -
  \int_{y+dy}^{y} A_y(x', y+dy) dx' 
\end{eqnarray}
Notice that I have left out the $z$ index everywhere since $z=0$ anyhow. The
first component can be calculated explicitly:
\begin{equation}
  \int_{x}^{x+dx} A_x(x', y) dx'  = \frac{1}{2}(A_x(x,y)+A_x(x+dx,y))dx
\end{equation}
If you do this to all four terms and then collect the $A_x$ and $A_y$
terms together (go ahead and try) you will find that:
\begin{eqnarray}
  \intLine \vec{A} d\vec{l} & = & 
  dx dy (\frac{\partial A_x}{\partial y}-\frac{\partial A_y}{\partial x}) \\
  & = & (\rot\vec{A})_z do \\
  & = & (\rot\vec{A})\cdot d\vec{o} 
\end{eqnarray}
For a non-infinitesimal path in the $x-y$ plane we can write the {\it surface}
integral as the sum of many infinitesimal surface integrals as shown in 
Fig.~\ref{fig:stokes2}. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.7\textwidth]{StokesGeneral.eps}
  \caption[]{\label{fig:stokes2} \sl Many infinitesimal path integrations
    make up a big one. Notice how only the boundary integration remains.}
  \end{center}
\end{figure}
Using the theorem we just derived for infinitesimal 
path integrals, you can see from the figure each side of the 
infinitesimal loop borders to another infinitesimal loop that gives exactly
an opposite contribution to the path integral, except when the loop is
at the border of your integration area. That is how the relation between
a total surface integration and the path integral around the surface comes 
about. In this context it is instructive to think of the the curl of a vector
as a little {\it whirlpool} around it: then it becomes easy to see why
Stokes theorem makes sense. You have to notice that we really did not 
give any general proof of the theorem. We restricted ourselves to integration
in the $xy$ plane, and certainly not any surface. For a more rigorous proof
please refer to any vector analysis textbook.

\subsection{Stokes theorem: example}

At this point it is worth to go through an example in which we can apply 
Stokes' theorem. Suppose we want to calculate the path integral over a circular
path with radius $R$ and center $x=y=0$ for a vector field $\vec{A}$ that 
is parametrized as:
\begin{equation}
  \vec{A} = \frac{(-y, x, 0 )}{\sqrt{x^2+y^2}}
\end{equation}
In Fig.~\ref{fig:stokes3}a you see what the vector field looks like. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.7\textwidth]{StokesExample.eps}
  \caption[]{\label{fig:stokes3} \sl In Fig.~a) you see a drawing of the 
    vector field $\vec{A}$, in Fig.~b) a drawing of 
    $\rot\vec{A}$.}
  \end{center} 
\end{figure}
So what about the line integral? The vector field is just the unit vector in 
the $\phi$ direction so:
\begin{equation}
\intLine \vec{A}\cdot d\vec{l} = \int_{circle} dl = 2\pi R
\end{equation}
According to Stokes theorem we could also calculate the curl of this vector 
field and then do the integration over the surface spanned by the path. 
So first the curl of the vector field:
\begin{eqnarray}
  \rot\vec{A} & = & 
  \left|
  \begin{array}{ccc}
    \hat{x} & \hat{y} & \hat{z} \\
    \partial_x    & \partial_y     & \partial_z     \\
    A_x     & A_y     & A_z 
  \end{array}
  \right| =
  \hat{z} (\frac{\partial}{\partial x}\frac{x}{\sqrt{x^2+y^2}}+
           \frac{\partial}{\partial y}\frac{y}{\sqrt{x^2+y^2}}) \\
   & = & \frac{\hat{z}}{\sqrt{x^2+y^2}} \equiv \frac{\hat{z}}{r}
\end{eqnarray}
In Fig.~\ref{fig:stokes3}b the curl of the vector field $\vec{A}$ is
drawn. Now let's calculate the surface integral of $\rot\vec{A}$.
\begin{equation}
\int_{disk}\rot\vec{A} = 
\int_{r=0}^{r=R}\int_{\phi=0}^{\phi=2\pi} \frac{1}{r} r dr d\phi =
2 \pi R
\end{equation}
Notice the factor $r$ coming from the integration in cylindrical coordinates.
The answer you get either way is exactly the same, though the work has been
considerably more extensive when calculating the surface integral.

\subsection{The curl of $\vec{B}$}

We can now use Stokes theorem to find an elegant 
differential formulation of the law of Ampere, just as we could use 
Gauss law in electrostatics
to go from Gauss's law in integral form to  Gauss's law in differential 
form. Recall Ampere's law:
\begin{equation}
  \label{eq:ampere}
  \intLine \vec{B} d\vec{l} = \mu_0 \intSurface \vec{J}\cdot d\vec{o}
\end{equation}
Stokes theorem (equation~\ref{eq:stokes}) now tells us that the 
path integral on the left hand side of equation~\ref{eq:ampere} can
be written as the surface integral of the curl of $\vec{B}$. So 
equation~\ref{eq:ampere} becomes:
\begin{equation}
  \intSurface (\rot\vec{B}) \cdot d\vec{o} = 
  \mu_0 \intSurface \vec{J}\cdot d\vec{o}
\end{equation}
This can only be true for any $\vec{B}$ if:
\begin{equation}
  \label{eq:ampere_diff}
  \rot\vec{B} = \mu_0 \vec{J}
\end{equation}
Please realize that equation~\ref{eq:ampere_diff} is {\it equivalent} to
Ampere's law in integral form (equation~\ref{eq:ampere}); there is really 
nothing new in this equation, except for the notation.

Now a little example. We have calculated the magnetic field for a thick wire
with a current in section~\ref{sec:thickwire} to be:
\begin{equation}
\left\{
    \begin{array}{ll}
      \vec{B} = \frac{\mu_0 I r}{2\pi R^2}\hat{\phi} 
              = \frac{\mu_0 I}{2\pi R^2} (-y, x, 0) & r<R \\ \\
      \vec{B} = \frac{\mu_0 I}{2\pi r} \hat{\phi} & r>R
    \end{array} 
\right.
\end{equation}
We can explicitly calculate the curl of $\vec{B}$ inside the wire:
\begin{equation}
  \rot\vec{B} = \left|
  \begin{array}{ccc}
    \hat{x} & \hat{y} & \hat{z} \\
    \partial_x    & \partial_y     & \partial_z     \\
    -y     & x     & 0 
  \end{array}
  \right| = \frac{2\mu_0 I}{2\pi R^2}\hat{z} = \mu_0 \vec{J}
\end{equation}
Can you prove that outside the wire $\rot\vec{B}=0$?

\subsection{The divergence of $\vec{B}$}

We have an expression for the curl of the magnetic field. What about its
divergence? For electrical fields we had Gauss's law in differential form 
which stated that $\div\vec{E}=\rho/\epsilon_0$. The divergence of the 
$\vec{E}$ field at any point is equal to the charge density at that point.
For the the divergence of {\it any} magnetic field we could get a similar 
expression, by taking the divergence of the law of Biot-Savart 
(equation~\ref{eq:biotsavart}), since Biot-Savart's law is true for magnetic
fields caused by any current distribution. For such a proof see for example
Griffiths chapter 5.3.2. However, we can actually predict what $\div\vec{B}$
should be by comparing it to the same expression for the electrical field.
In the equation for $\div\vec{E}=\rho/\epsilon_0$ you see that on the 
right hand side of the equation you find the {\it electric} charge density.
Since {\it magnetic} charges do not seem to exist, we can guess that:
\begin{equation}
  \div\vec{B}=0
\end{equation}
This should be true for any magnetic field and it is indeed the answer you
find by following the explicit proof in Griffiths. Let's see if it is true for
the magnetic field of our 'good old' thick wire (see above). Inside the
wire we have:
\begin{eqnarray}
\div\vec{B} & = & \div\frac{\mu_0 I r}{2\pi R^2}\hat{\phi} \\
            & = & \frac{\mu_0 I}{2\pi R^2}(-\partial_x y + \partial_y x) = 0
\end{eqnarray}
Outside the wire:
\begin{eqnarray}
\div\vec{B} & = & \div\frac{\mu_0 I}{2\pi r}\hat{\phi} \\
            & = & \frac{\mu_0 I}{2\pi}
                  (-\partial_x \frac{y}{r^2} + \partial_y \frac{x}{r^2}) = 0
\end{eqnarray}
Notice here that we would run into serious problems if we would have
chosen to calculate $\div\vec{B}$ for a wire with zero thickness, due to the
singularity in the $\vec{B}$ field at $r=0$.
            
Now remember that Gauss's law for electrostatics could be either written in
the differential form as shown above or in integral form:
\begin{equation}
\intSurface\vec{E}d\vec{o} = \frac{1}{\epsilon_0}\intVolume \rho dV
\end{equation}
Or in words: the integration of the $\vec{E}$ field over a closed surface
(i.e. flux) is equal to the total charge enclosed. Since we know now that
$\div\vec{B}=0$, we can write for the magnetic flux through any surface with
help of the law of Gauss:
\begin{eqnarray}
\Phi_B & = & \intSurface \vec{B}d\vec{o} \\
       & = & \intVolume \div\vec{B} dV = 0 
\end{eqnarray}
So the magnetic flux through any closed surface is equal to zero. This 
is another way of stating that there exist no magnetic charges.

\subsection{Summary: Field equations for $\vec{E}$ and $\vec{B}$ fields}

At this point we know all there is to know about electrostatics and 
magnetostatics. For any stationary charge distribution we can in principle
calculate the corresponding electric field and for any steady current
we can calculate the resulting magnetic field (though the calculations are not
always easy). In addition we know how a charged particle behaves in these
fields, since we have the equation for the Lorentz force on a charged 
particle:
\begin{equation}
\vec{F}_L = q (\vec{E} + \vec{v}\times\vec{B})
\end{equation}
There are just four equations needed to calculate all electrical and magnetic
fields. In integral form:
\begin{eqnarray}
  \intSurface \vec{E} \cdot d\vec{o} & = & \frac{1}{\epsilon_0} \intVolume \rho dV ~\mbox{(Gauss law)} \\
  \intLine \vec{E} \cdot d\vec{l} & = & 0\\
  \intSurface \vec{B} \cdot d\vec{o} & = & 0\\
  \intLine \vec{B} \cdot d\vec{l} & = & \mu_0 \intSurface \vec{J} \cdot d\vec{o}~\mbox{(Ampere's law)}
\end{eqnarray}
Using Stokes theorem and the divergence theorem - just mathematical trickery - 
these integral equations can be re-written as the following set of differential
equations:
\begin{eqnarray}
  \div\vec{E}  & = & \frac{\rho}{\epsilon_0} \\
  \rot\vec{E} & = & 0 \\
  \div\vec{B}  & = & 0 \\
  \rot\B & = & \mu_0 \vec{J}
\end{eqnarray}
That is all there is to know about electro- and magneto- statics; nothing 
more nothing less.

\subsection{Knowledge and Skills}

The knowledge and skills you should have acquired during reading of the 
previous can be summarized as follows:
\begin{itemize}
\item{You should be familiar with Stokes' theorem relating line integrals to
   surface integrals
}
\item{Ampere's law in differential form:
   \begin{equation}
   \vec{\nabla}\times\vec{B} = \mu_0 \vec{J}
   \end{equation}
}
\item{The divergence of the magnetic field is zero:
  \begin{equation}
  \vec{\nabla}\cdot\vec{B} = 0
  \end{equation}
}
\item{You should know the four equations describing electrostatics and 
   magnetostatics
}
\end{itemize}

\section{Magnetic fields in matter}

In this section we will try to explain what happens if matter is placed 
inside magnetic fields.

\subsection{Paramagnetism: electron spin}

Since every electron in matter has intrinsic spin it carries a little
magnetic dipole moment with a dipole moment:
\begin{equation}
m = \frac{q_e h}{2m_e}
\end{equation}
You can imagine the electron as a spinning electric 
charge, or a current loop if you want (see section~\ref{sec:dipole}). Without
a magnetic field (see Fig.~\ref{fig:paramagnetism}a) these dipoles are
randomly oriented, but if a magnetic field is applied the dipole moments - and
thus the spin vectors - try to align themselves with the magnetic field. As
a result of the aligned dipole moments the magnetic field is {\it enhanced}:
enhancement of a magnetic field in matter due to an applied magnetic field
we call {\it paramagnetism}. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.9\textwidth]{Paramagnetism.eps}
  \caption[]{\label{fig:paramagnetism} \sl Alignment of electron spins
    in a magnetic field as a cause of para-magnetism.
    }
  \end{center}
\end{figure}
It seems that since every material contains electrons paramagnetism should be
a universal effect for all substances. However the Pauli exclusion principle
(quantum mechanics) does not allow electrons in the same orbit to have 
their spins aligned. So as a rule of thumb only substances with an odd number 
of electrons exhibit paramagnetism due to spin alignment, while for substances
with even number of electrons the effect cancels out. Even when a substance
is paramagnetic the alignment of spins is usually (room temperatures) far
from complete due to thermal fluctuations. A last point to remember is that
as soon as the external magnetic field disappears, the paramagnetic 
effect disappears, and the dipole moments are randomly distributed once more.

\subsection{Paramagnetism: Electron orbit}

Just as the electron has a magnetic moment, so does the orbiting electron
around the nucleus. Again a current loop! This effect only gives a minute 
contribution to the paramagnetism, since it turns out to be much harder
to 'turn' an entire orbit than it is to turn a spin.
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.9\textwidth]{ParamagnetismOrbital.eps}
  \caption[]{\label{fig:paramagnetism_orbital} \sl Alignment of electron
    orbits resulting in para-magnetism.
    }
  \end{center}
\end{figure}

\subsection{Diamagnetism}

There is a second, more subtle, effect of a magnetic field on the orbit
of an electron, for which we will have to look a bit deeper into the 
centripetal acceleration that holds an atom together. Without  a magnetic field
the centripetal acceleration is caused by the Coulomb attractive force alone. 
So:
\begin{equation}
\label{eq:diamagnetism_centripetal}
\frac{1}{4\pi\epsilon_0} \frac{e^2}{R^2} = m_e \frac{v^2}{R}
\end{equation}
Now suppose there is a magnetic field, that is 
perpendicular to the plane of orbit of the electron and opposite to the 
direction of the magnetic moment of the atomic orbit
(situation shown to the right side of Fig.~\ref{fig:diamagnetism}). 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.9\textwidth]{Diamagnetism.eps}
  \caption[]{\label{fig:diamagnetism} \sl Changing velocity of the electrons
    in a magnetic field resulting in diamagnetism.
    }
  \end{center}
\end{figure}
In that case the 
centripetal force is sustained by both the Coulomb and the Lorentz forces. 
Equation~\ref{eq:diamagnetism_centripetal} now becomes:
\begin{equation}
\frac{1}{4\pi\epsilon_0}\frac{e^2}{R^2} + ev' = m_e \frac{v'^2}{R}
\end{equation}
By subtraction of the above two equation, and assuming that the change in 
velocity is small, we get for the change in velocity 
(see Griffiths section 6.1.3):
\begin{equation}
v - v' \approx \frac{eRB}{2m_e}
\end{equation}
When a magnetic field is turned on the electron speeds up and thus the magnetic
moment increases. If the magnetic moment would have been in the opposite 
direction
as shown to the left side in Fig.~\ref{fig:diamagnetism}, the velocity of the
electron would decrease, and thus the magnetic moment would decrease. 

In both cases there is a change in magnetic dipole moment that is opposite 
to the direction of the applied magnetic field. This effect is called 
diamagnetism. All substances show diamagnetism, but in general it is much 
weaker than paramagnetism, so in general it is only visible when paramagnetism
is absent. In general this was shown to be the case for materials with even
numbers of electrons. Furthermore, the calculation as shown here does not 
always give a reliable result, it is just made to make the argument clear. To
get quantitative answers on diamagnetism a full quantum mechanically correct
calculation is required.

\subsection{Magnetization and Bound Currents}

In the previous section we saw the effects of magnetic field on matter on a 
microscopic scale. Now we will give a macroscopic description of magnetic 
fields in matter. Let us first consider a cylinder of para-magnetic material 
that is  placed inside a magnetic field (see Fig.~\ref{fig:ParaCylinder}a). 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.9\textwidth]{ParaCylinder.eps}
  \caption[]{\label{fig:ParaCylinder} \sl Effect of a magnetic field
    on a macroscopic object.
    }
  \end{center}
\end{figure}
The magnetic field - on average - aligns the magnetic dipoles in the 
material. So there is an average dipole moment per volume element, which
is defined as
\begin{equation} 
\vec{M}\equiv\frac{\mbox{dipole moment}}{\mbox{volume}}
\end{equation}
We call $\vec{M}$ the magnetization of the material.
If you remember that a magnetic dipole is in fact nothing else than a little
current loop  you can have a look on top of the cylinder (see 
Fig.\ref{fig:ParaCylinder}b). You see all the current loops lying side-by-side
and effectively only a current is running over the edge of our cylinder. So
in case we have a uniformly magnetized object, it can be described as if
there was a current running over the edge of the object. The magnetization
of an object can thus be interpreted as a surface current.

We can make the above argument more quantitative by considering an
example in which a slab of para-magnetic material is placed in a 
magnetic field (see Fig.~\ref{fig:BoundCurrent}a). 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.9\textwidth]{BoundCurrent.eps}
  \caption[]{\label{fig:BoundCurrent} \sl Magnetization can effectively
    be described by bound current densities.
    }
  \end{center}
\end{figure}
We can have a look at the 
dipole moment for each little block in the slab by multiplying the 
magnetization by the volume of the little block .
This should be equal to the effective current going around the block multiplied
by its area (remember that $\vec{m}=\vec{I} Area$). So:
\begin{equation}
d |\vec{M}| Area  = I_{block} Area
\end{equation}
Now it can be clearly seen from the figure that neighboring blocks have
sides carrying opposite currents, at least in case the magnetization is 
homogeneous. As a result there is an effective boundary current which happens
to be exactly $I_{block}$. So:
\begin{equation}
I_{boundary} = I_{block} = |\vec{M}| d
\end{equation}
The surface current density $K$ is just the current per unit length:
\begin{equation}
K = \frac{|\vec{M}| d}{d} = |\vec{M}|
\end{equation}
Figure~\ref{fig:BoundCurrent}b shows the equivalent situation for our
magnetized slab of material. In a more general notation our current
density can now be written as the cross-product of the magnetization
vector and the normal vector to the surface:
\begin{equation}
\vec{K}_{mag} = \vec{M}\times\hat{n}
\end{equation}
Finally if the magnetization is non-homogeneous there will also be an 
effective volume current density (see Griffiths section 6.2), which is 
written as:
\begin{equation}
\vec{J}_{mag} = \nabla\times\vec{M}
\end{equation}
The vectors $\vec{K}_{mag}$ and $\vec{J}_{mag}$ are what we call the bound
surface and volume currents, respectively. Please notice that these are
some kind of effective currents, since no real charge is moved from
one place to another. 

\subsection{Linear materials}

A material is called a linear material its magnetization is proportional to
the magnetic field. In such cases $\vec{M}$ is written as:
\begin{equation}
\label{eq:linear_magnetization}
\vec{M} = \frac{\chi_m}{\mu_0 (1+\chi_m)}\vec{B}
\end{equation}
where $\chi_m$ is called the magnetic susceptibility, which is a measured 
quantity for each material. Please note that
$\vec{B}$ is not just the external magnetic field, but the field including
the modifications due to the magnetization (tricky):
\begin{equation} 
\vec{B} = \vec{B}_{mag} +\vec{B}_0
\end{equation}
where $\vec{B}_{mag}$ is the field due to the magnetization and $\vec{B}_0$
is the externally supplied field.

\subsubsection{Example: Infinite bar}

Consider a long para-magnetic (linear material) cylinder inside an 
externally supplied magnetic field $\vec{B}_0$ as in 
Fig.~\ref{fig:ParaCylinder}. The surface bound current is written as:
\begin{equation}
K_{mag} = \vec{M}\times\hat{n}
\end{equation}
The magnetic field due o the magnetization can be calculated with Ampere's
law assuming that the cylinder is infinitely long (at this point you should 
be able to do the calculation yourself, so I don't do it):
\begin{equation}
\vec{B}_{mag} = \mu_0 |\vec{K}_{mag}| \hat{z}
\end{equation}
Now we can use Eq.~\ref{eq:linear_magnetization} to rewrite this equation
in terms of its susceptibility as:
\begin{equation}
\vec{B}_{mag} = \chi_m \vec{B}_0
\end{equation}
So we can see that the total magnetic field inside the cylinder 
is modified with a factor $(1+\chi_m)$.

\subsubsection{Example: Infinite bar with free current}

We are now considering the infinite cylinder once more, but now we are
generating the external magnetic field with a wire running around the 
cylinder (also see section~\ref{sec:solenoid}). Suppose we have $n$ windings
per meter and a free current $I$ then the magnetic field due to the free 
current is:
\begin{equation}
\vec{B}_0 = n I \hat{z} = K_{free} \hat{z}
\end{equation}
Now suppose we fill the interior of the cylinder with a linear magnetic 
material with a susceptibility $\chi_m$, then we know from the previous 
example that:
\begin{equation}
\vec{B} = (1+\chi_m)\vec{B}_0 = (1+\chi_m) n I \hat{z}
\end{equation}
So by inserting some material inside a magnet we have a way of amplifying
(para-magnetic) or damping (dia-magnetic) the resulting field.

\subsection{Ferromagnetism}

Finally we come to the special case of ferromagnetism. In ferro-magnetic 
materials electron spins really love to align with each other. Whereas for
the normal paramagnetic materials the alignment was far from perfect, for a 
ferromagnetic material the alignment can be almost 100\%. Usually there
are little areas - so called Weiss domains - in which the spins are aligned
(see Fig.~\ref{fig:Weiss}), 
and usually the effect of these areas cancel out giving no noticeable external
magnetic field. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.7\textwidth]{Weiss.eps}
  \caption[]{\label{fig:Weiss} \sl In a ferro-magnetic material
    there are domains where spins spontaneously align to each other. These
    are the so called Weiss areas.
    }
  \end{center}
\end{figure}
However, once an external magnetic field is applied all these
domains can spontaneously align themselves to the magnetic field. A small
externally applied field can then result in a huge magnetic field from the
material. Another interesting property of ferromagnetism is what happens
when the external magnetic field is switched off. The alignment of spins
might become less, but it does not disappear: you have created a permanent
magnet! 

If for example our solenoid from the previous example is filled with a 
ferromagnetic material, the resulting $\vec{B}$ field may be 100 times
larger than the externally applied field. The effect is highly non-linear
as illustrated in Fig.~\ref{fig:hysteresis}, which shows the magnetic
field as a function of the externally applied field. 
\begin{figure}[ht]
  \begin{center}
  \includegraphics[width=0.7\textwidth]{hysteresis.eps}
  \caption[]{\label{fig:hysteresis} \sl If the external magnetic field
    is removed from a ferro-magnetic material the magnetization does
    not directly disappear. This non-linear behavior is called
    hysteresis.
    }
  \end{center}
\end{figure}
First the $\vec{B}$
field grows rapidly as a function of the external field. Then at a certain
point the dipole moments of all domains are aligned and there is no further
increase in $\vec{B}$ (saturation). If the external field is removed, there 
is still quite some magnetic field remaining due to the ferromagnetism. 
Only once the external field is fully reversed, the $\vec{B}$ field
finally changes sign.

\subsection{Knowledge and Skills}

The knowledge and skills you should have acquired during reading of the 
previous can be summarized as follows:
\begin{itemize}
\item{In para-magnetic material the magnetization is in the same direction
as the externally applied magnetic field;}
\item{In dia-magnetic materials the magnetization is in the opposite
direction as the externally applied magnetic field;}
\item{A magnetized object can be effectively described with bound surface
current density $\vec{K}_{mag}$ and a volume current density $\vec{J}_{mag}$, 
with:
\begin{eqnarray}
\vec{K}_{mag} & = & \vec{M}\times\hat{n} \\
\vec{J}_{mag} & = & \vec{\nabla} \times \vec{M}
\end{eqnarray}
}
\item{ Linear materials are materials for which the magnetization is 
proportional to the magnetic field:
\begin{equation}
\vec{M} = \frac{\chi_m}{\mu_0 (1+\chi_m)} \vec{B}
\end{equation}
where $\chi_m$ is the magnetic susceptibility of the material.
}
\end{itemize}


