5.1 The Bar Magnet, Magnetic Dipoles and Gauss's Law for Magnetism
A bar magnet behaves exactly like a current-carrying solenoid: far away its field is a dipole field falling off as $1/r^3$, in a uniform field it feels a torque $\boldsymbol\tau=\mathbf m\times\mathbf B$, and — because magnetic field lines never end — the net magnetic flux through every closed surface is zero.
A hiker in the hills pulls out a compass and the needle swings round, trembles and settles pointing north. A fridge magnet holds a shopping list to the door. Inside an MRI scanner a field tens of thousands of times stronger than the Earth's lines up the tiny magnetic moments of the protons in your body. A wind turbine, the speaker in your earphones and the motor in a ceiling fan all contain permanent magnets. People were using magnets long before anyone knew what electricity was — but in Chapter 4 (Moving Charges and Magnetism) you saw that a loop of current produces a magnetic field and turns in a magnetic field just as a magnet does. This section closes the circle: a bar magnet is, magnetically, nothing more than a solenoid.
We describe the field of a bar magnet with field lines, measure the strength of a magnet by its magnetic moment $\mathbf m$, and find the field far from it — which turns out to have the same shape as the field of an electric dipole (Section 1.2). We then put a magnet in a uniform field, find the torque and the potential energy, and use them to explain why a compass needle oscillates before it settles. Finally we meet one of the four basic laws of electromagnetism, Gauss's law for magnetism: magnetic field lines never begin or end, so there are no isolated magnetic poles.
The Bar Magnet and Magnetic Field Lines
Sprinkle iron filings on a sheet of card over a bar magnet and tap the card. The filings line up into a pattern of curves that crowd together near the two ends of the magnet and spread out between them. The ends, where the attraction for iron is strongest, are the poles. Hang the magnet freely and one end turns towards geographic north: that end is the north pole (N), the other the south pole (S). Like poles repel and unlike poles attract.
The striking fact is what happens when you try to separate the poles. Break a bar magnet in half and you do not get a lone N and a lone S: you get two smaller magnets, each with its own N and S. Break those again and the same thing happens, right down to single atoms. No one has ever found an isolated magnetic pole — a magnetic monopole — although physicists have searched hard for one. Poles always come in N–S pairs, so the simplest magnetic object is a magnetic dipole.
Iron filings and small compass needles trace out the direction of the magnetic field $\mathbf B$ around the magnet (Chapter 4 defined $\mathbf B$ by the force it exerts on a moving charge). Joining up these directions gives magnetic field lines, drawn by the same rules as the electric field lines of Section 1.2 — with one decisive difference.
1. They form continuous closed loops. Outside a magnet they run from the N pole round to the S pole; inside the magnet they continue from the S pole to the N pole, closing the loop. Unlike electric field lines, they have no starting or ending points.
2. The tangent to a line gives the direction of $\mathbf B$; the field is strong where the lines are close together (near the poles, and inside the magnet) and weak where they are far apart.
3. Two magnetic field lines never cross — the field at a point has only one direction.
4. Inside the magnet $\mathbf B$ points along $\mathbf m$ (S to N). Between the charges of an electric dipole, by contrast, $\mathbf E$ points from $+q$ to $-q$, against $\mathbf p$. Far away the two patterns have exactly the same shape.
The Bar Magnet as an Equivalent Solenoid
Put a bar magnet and a current-carrying solenoid of the same size side by side and sprinkle iron filings around both. Outside, the two patterns are indistinguishable. Hang the solenoid from a thread and it turns to point north–south like a compass; bring the N pole of a magnet near one end and that end is repelled or attracted exactly as a pole would be. Each turn of the solenoid is a current loop with magnetic moment $IA$ (Chapter 4), and the solenoid adds them all up. Ampère's bold suggestion was that a bar magnet does the same: inside the material, countless atomic current loops are lined up, and their combined effect is a surface current circulating round the magnet like the winding of a solenoid.
The far field on the axis (uses integration). Take a solenoid of length $2l$ and radius $a$, with $n$ turns per unit length carrying current $I$, and a point $P$ on its axis at distance $r$ from its centre. A thin slice of thickness $dx$ at distance $x$ from the centre contains $n\,dx$ turns. Using the field on the axis of a circular loop (Chapter 4), the slice produces at $P$ $$dB=\frac{\mu_0\,(n\,dx)\,I\,a^2}{2\left[(r-x)^2+a^2\right]^{3/2}}.$$ Far away ($r\gg l$ and $r\gg a$) the bracket is close to $r^2$ for every slice, so $\left[(r-x)^2+a^2\right]^{3/2}\approx r^3$ and $$B\approx\frac{\mu_0nIa^2}{2r^3}\int_{-l}^{l}dx=\frac{\mu_0nIa^2\,(2l)}{2r^3}=\frac{\mu_0}{4\pi}\,\frac{2\,\big[n(2l)\,I\,(\pi a^2)\big]}{r^3}.$$ The bracket is (number of turns) × (current) × (area) — the total magnetic moment $m$ of the solenoid. The result has exactly the form of the axial field of an electric dipole, $\dfrac{1}{4\pi\varepsilon_0}\dfrac{2p}{r^3}$, with $\dfrac{1}{\varepsilon_0}\to\mu_0$ and $p\to m$.
A bar magnet or solenoid of magnetic moment $\mathbf m$ (for a solenoid $m=NIA$, $N$ turns of area $A$ carrying current $I$) produces at distance $r$ from its centre, with $r$ much larger than its size:
On the axial line, along $\mathbf m$: $$\mathbf B_\text{axial}=\frac{\mu_0}{4\pi}\,\frac{2\mathbf m}{r^3}.$$
On the equatorial line, opposite to $\mathbf m$: $$\mathbf B_\text{eq}=-\frac{\mu_0}{4\pi}\,\frac{\mathbf m}{r^3}.$$
Closer in, the pole model gives $B_\text{axial}=\dfrac{\mu_0}{4\pi}\dfrac{2mr}{(r^2-l^2)^2}$ and $B_\text{eq}=\dfrac{\mu_0}{4\pi}\dfrac{m}{(r^2+l^2)^{3/2}}$ ($2l$ = magnetic length), the exact analogues of Result 1.6. Here $\dfrac{\mu_0}{4\pi}=10^{-7}\ \text{T m/A}$.
So the field of a magnet, like that of an electric dipole, falls off as $1/r^3$, is twice as strong on the axis as on the equator at the same distance, and depends on the magnet only through $m$. A short, strong magnet and a long, weak one with the same $m$ look identical from far away. Only up close — and inside — do they differ, and there the solenoid picture is the true one: the lines go straight through the magnet from S to N.
A Magnetic Dipole in a Uniform Field
Place a bar magnet in a uniform field $\mathbf B$ with $\mathbf m$ at angle $\theta$ to $\mathbf B$. In the pole picture the N pole is pushed along $\mathbf B$ with force $q_m\mathbf B$ and the S pole the opposite way with $-q_m\mathbf B$. The forces cancel, so the net force is zero; but they act along parallel lines a distance $2l\sin\theta$ apart and form a couple of torque $q_mB\,(2l\sin\theta)=mB\sin\theta$. (The same result follows from the torque on a current loop, Chapter 4 — as it must, since the magnet is a set of current loops.) Turning the magnet against this torque stores energy, exactly as for the electric dipole of Section 1.2.
A magnetic dipole of moment $\mathbf m$ in a uniform field $\mathbf B$ experiences zero net force and a torque $$\boldsymbol\tau=\mathbf m\times\mathbf B,\qquad \tau=mB\sin\theta,$$ which tends to turn $\mathbf m$ into line with $\mathbf B$. Its potential energy (zero at $\theta=90^\circ$) is $$U=-\mathbf m\cdot\mathbf B=-mB\cos\theta,$$ lowest, $-mB$, at $\theta=0$ (stable equilibrium) and highest, $+mB$, at $\theta=180^\circ$ (unstable equilibrium). The work needed to turn it slowly from $\theta_1$ to $\theta_2$ is $W=mB(\cos\theta_1-\cos\theta_2)$.
If the dipole has moment of inertia $I$ about its pivot and is displaced through a small angle, it performs angular simple harmonic motion with period $$T=2\pi\sqrt{\frac{I}{mB}}.$$
Why the oscillation is simple harmonic. For a small twist $\theta$ (in radians) the restoring torque is $mB\sin\theta\approx mB\,\theta$, so Newton's second law for rotation gives $I\dfrac{d^2\theta}{dt^2}=-mB\,\theta$. This is the equation of SHM (Class 11 Physics, Chapter 13) with $\omega^2=mB/I$, hence $T=2\pi/\omega=2\pi\sqrt{I/(mB)}$. The formula is a practical tool: time the oscillations of a needle of known $I$ and you can find $mB$ — and, knowing $m$, measure an unknown field $B$. A stronger field makes the needle oscillate faster: $T\propto1/\sqrt B$.
The electrostatic analogue. Every result so far is a result of Chapter 1 with a change of symbols. Replace $\mathbf p$ by $\mathbf m$, $\mathbf E$ by $\mathbf B$ and $\dfrac{1}{\varepsilon_0}$ by $\mu_0$, and the dipole formulas carry over unchanged:
| Quantity | Electric dipole | Magnetic dipole |
|---|---|---|
| constant | $1/\varepsilon_0$ | $\mu_0$ |
| moment | $\mathbf p$ (C m) | $\mathbf m$ ($\text{A m}^2$) |
| far field, axial | $\tfrac{1}{4\pi\varepsilon_0}\tfrac{2\mathbf p}{r^3}$ | $\tfrac{\mu_0}{4\pi}\tfrac{2\mathbf m}{r^3}$ |
| far field, equatorial | $-\tfrac{1}{4\pi\varepsilon_0}\tfrac{\mathbf p}{r^3}$ | $-\tfrac{\mu_0}{4\pi}\tfrac{\mathbf m}{r^3}$ |
| torque | $\mathbf p\times\mathbf E$ | $\mathbf m\times\mathbf B$ |
| energy | $-\mathbf p\cdot\mathbf E$ | $-\mathbf m\cdot\mathbf B$ |
The analogy is exact for the field outside the sources. It fails inside, and that failure is the whole content of the next law.
Gauss's Law for Magnetism
Surround one end of an electric dipole — the charge $+q$ — with a closed surface. Field lines start on $+q$ and leave through the surface, and Gauss's law (Section 1.3) says the net flux is $q/\varepsilon_0$. Now surround the N pole of a bar magnet in the same way. Lines leave through the outside part of the surface, but inside the magnet the same lines arrive from the S end and cross the surface inwards. Every line that goes out also comes in, because magnetic field lines are closed loops: there is nothing inside for them to start from. Whatever shape the closed surface has and wherever it is, the outgoing and incoming lines balance.
The net magnetic flux through any closed surface is zero: $$\Phi_B=\oint\mathbf B\cdot d\mathbf A=0.$$ For a surface made of flat pieces in fields that are uniform over each piece, $\displaystyle\sum_{\text{all pieces}}\mathbf B\cdot\Delta\mathbf A=0$, with every area vector pointing outwards. Equivalently: isolated magnetic poles (monopoles) do not exist, and magnetic field lines have no beginning and no end.
Compare the two Gauss's laws side by side. For $\mathbf E$ the right-hand side is (enclosed charge)$/\varepsilon_0$; for $\mathbf B$ it is zero because there is no "magnetic charge" to enclose. The SI unit of magnetic flux is the $\text{T m}^2$, which Chapter 6 names the weber. Gauss's law for magnetism is one of the four Maxwell equations (Chapter 8); it holds for every magnetic field, steady or changing, produced by magnets or by currents.
1. Ending field lines at the poles. Magnetic field lines do not stop at the N and S poles; they continue through the magnet from S to N. Drawings that stop at the poles hide the fact that the flux through a closed surface is zero.
2. Getting the direction of $\mathbf m$ wrong. $\mathbf m$ points from S to N inside the magnet, the same way as the field lines inside. (For an electric dipole $\mathbf p$ points from $-q$ to $+q$, but $\mathbf E$ between the charges points the other way.)
3. Using the short-magnet formulas too close. $\dfrac{\mu_0}{4\pi}\dfrac{2m}{r^3}$ is accurate only when $r$ is several times the length of the magnet (Example 1: $12\%$ error at $r=4l$).
4. Expecting a net force in a uniform field. A uniform field only turns a magnet. A net force — like the pull of a magnet on a nail — needs a non-uniform field.
5. Mixing up torque and energy. At $\theta=90^\circ$ the torque is greatest ($mB$) but $U=0$; at $\theta=0$ the torque is zero but $U$ is least ($-mB$).
Enrichment only: the Earth's magnetism is not in the 2026 CBSE, JEE Main, NEET or JEE Advanced syllabi. It appears in older papers and in some state boards. Near its surface the Earth's field resembles that of a huge bar magnet near the centre of the Earth, with its $\mathbf m$ pointing roughly from geographic north to geographic south — so the Earth's "north magnetic pole" is really an S pole of that magnet. The field is about $3\times10^{-5}$ T near the equator and $6\times10^{-5}$ T near the poles.
At any place three numbers describe it. The magnetic declination $D$ is the angle between geographic north and the direction a horizontal compass needle points (the vertical plane containing that direction is the magnetic meridian). The angle of dip (inclination) $I$ is the angle that the total field makes with the horizontal, measured in the magnetic meridian; a needle free to turn in a vertical plane — a dip needle — settles at this angle. The horizontal and vertical components are $$B_H=B\cos I,\qquad B_V=B\sin I,\qquad \tan I=\frac{B_V}{B_H}.$$ For example, where $B_H=3.5\times10^{-5}$ T and $I=30^\circ$: $B=\dfrac{B_H}{\cos30^\circ}\approx4.0\times10^{-5}$ T and $B_V=B_H\tan30^\circ\approx2.0\times10^{-5}$ T. The dip is $0^\circ$ on the magnetic equator and $90^\circ$ at the magnetic poles. A compass needle in a horizontal plane responds only to $B_H$, so its oscillation period is $T=2\pi\sqrt{I_\text{needle}/(mB_H)}$.
Exercises
- 1 A bar magnet of magnetic length $12$ cm has magnetic moment $2.4\ \text{A m}^2$. Find its pole strength. It is cut into two equal halves by a cut perpendicular to its length. Find the pole strength and magnetic moment of each half.
- 2 The same magnet is instead cut into two equal halves along its length (parallel to its axis). Find the pole strength and moment of each half.
- 3 A thin bar magnet of moment $m$ is bent at its midpoint into an L shape, the two arms at $90^\circ$. Find its new magnetic moment.
- 4 State two differences between electrostatic field lines and magnetic field lines.
- 5 In which direction do the field lines run inside a bar magnet? Explain why they cannot stop at the poles.
- 6 Show that the units $\text{A m}^2$ and $\text{J/T}$ are the same.
- 7 Why do iron filings sprinkled near a magnet line up along the field lines?
- 1 A short bar magnet has moment $1.2\ \text{A m}^2$. Find the field $25$ cm from its centre on its axis.
- 2 For the same magnet find the field $25$ cm from its centre on its equatorial line, and give its direction.
- 3 For a short magnet, find the ratio of the field on its axis at distance $r$ to the field on its equatorial line at distance $2r$.
- 4 The field on the axis of a short magnet is $2.0\times10^{-5}$ T at $10$ cm from its centre. Find its magnetic moment.
- 5 A short solenoid has $400$ turns of radius $2.0$ cm and carries $0.50$ A. Find its magnetic moment and the field $40$ cm from it on its axis.
- 6 A bar magnet of magnetic length $8.0$ cm has moment $0.50\ \text{A m}^2$. Find the field on its axis $12$ cm from its centre with the pole-model formula and with the short-magnet formula.
- 7 At what distance on the equatorial line of a short magnet is the field equal to its axial field at $10$ cm?
- 8 Two identical short magnets, each of moment $0.50\ \text{A m}^2$, lie on a common axis with their centres $40$ cm apart and both moments pointing in the $+x$ direction. Find the field midway between them. What is it if one magnet is turned round?
- 1 A magnet of moment $0.80\ \text{A m}^2$ makes $60^\circ$ with a uniform field of $0.15$ T. Find the torque on it.
- 2 The greatest torque a uniform field of $0.30$ T can exert on a magnet is $0.12$ N m. Find the magnet's moment.
- 3 For the magnet and field of part 2, find the potential energy at $\theta=0^\circ$, $90^\circ$ and $180^\circ$.
- 4 How much work is needed to turn the magnet of part 2 from its stable position through $60^\circ$?
- 5 At what angles between $\mathbf m$ and $\mathbf B$ is the torque half its maximum value?
- 6 A current loop has $\mathbf m=(0.30\,\hat{\mathbf i}+0.40\,\hat{\mathbf j})\ \text{A m}^2$ in a field $\mathbf B=0.50\,\hat{\mathbf k}$ T. Find the torque vector, its magnitude, and the potential energy.
- 7 A needle of moment $0.050\ \text{A m}^2$ oscillates with a period of $0.50$ s in a uniform field of $0.020$ T. Find its moment of inertia. What is the period if the field is made four times larger?
- 8 Modelling. A field geologist hangs a small magnetised needle in a uniform laboratory field of $5.0\times10^{-5}$ T; it makes $12$ small oscillations per minute. When a magnetised rock sample is placed nearby, so that its field adds to the laboratory field in the same direction, the needle makes $18$ oscillations per minute. Find the field of the rock at the needle.
- 1 State Gauss's law for magnetism. What does it tell us about magnetic poles?
- 2 A closed surface encloses the N pole of a magnet. A flux of $2.0\times10^{-4}\ \text{T m}^2$ leaves through part of it. Find the flux through the rest and the total.
- 3 A cube of side $10$ cm is in a uniform field of $0.40$ T along the $+x$ direction, with faces perpendicular to the axes. Find the flux through each face and the total.
- 4 A closed hemisphere of radius $3.0$ cm stands in a uniform field of $0.50$ T along its axis. Find the flux through its curved surface.
- 5 Using the analogy between electric and magnetic dipoles, write down the equatorial field of a short magnet from the corresponding electric result, and the energy of a magnetic dipole from $U=-\mathbf p\cdot\mathbf E$.
- 6 Why is the right-hand side of Gauss's law for $\mathbf E$ not zero, while that for $\mathbf B$ is zero?
- 7 A student reports a net magnetic flux of $1\times10^{-6}\ \text{T m}^2$ out of a closed box containing a magnet. What can you conclude?
E1. Board · 3 marks Derive an expression for the torque on a bar magnet of moment $\mathbf m$ placed at angle $\theta$ to a uniform magnetic field $\mathbf B$, and for the work done in turning it from $\theta_1$ to $\theta_2$. A magnet of moment $2.5\ \text{A m}^2$ is in a uniform field of $0.20$ T. Find the torque at $\theta=30^\circ$ and the work needed to turn it from $\theta=0^\circ$ to $90^\circ$.
E2. Board · 1 mark Assertion (A): The net magnetic flux through a closed surface surrounding the N pole of a bar magnet is zero. Reason (R): Magnetic field lines form closed loops, passing through the magnet from S to N. (A) Both A and R are true and R is the correct explanation of A. (B) Both are true but R is not the correct explanation of A. (C) A is true, R is false. (D) A is false, R is true.
E3. JEE Main A magnetic needle makes small oscillations of period $T$ in a uniform field $B$. It is replaced by a needle with the same moment of inertia but twice the magnetic moment, and the field is increased to $4B$. The new period is (A) $T/2$ (B) $T/4$ (C) $T/(2\sqrt2)$ (D) $2\sqrt2\,T$.
E4. NEET A thin bar magnet of magnetic moment $m$ is bent into a semicircular arc. Its new magnetic moment is (A) $m$ (B) $2m/\pi$ (C) $m/\pi$ (D) $\pi m/2$.
E5. JEE Advanced (One or more correct.) A bar magnet is placed in a uniform magnetic field and released. Which statements are correct? (A) The net force on the magnet is zero. (B) The torque on it is greatest when $\mathbf m$ is perpendicular to $\mathbf B$. (C) Its potential energy is least when $\mathbf m$ is antiparallel to $\mathbf B$. (D) The net magnetic flux through any closed surface drawn around the magnet is zero.
E6. JEE Main NEET A short bar magnet of moment $0.40\ \text{A m}^2$ is placed with its north pole pointing along a uniform field of $5.0\times10^{-5}$ T. The neutral points lie (A) $4.3$ cm from its centre on the axis (B) $9.3$ cm from its centre on the equatorial line (C) $9.3$ cm from its centre on the axis (D) $20$ cm from its centre on the equatorial line. ($\mu_0/4\pi=10^{-7}$ T m/A)
Research question. Does the field of a small permanent magnet really fall off as $1/r^3$, and how large is its magnetic moment?
Why it matters. Every smartphone contains a three-axis magnetometer — a chip a few millimetres across that measures $\mathbf B$ to about a microtesla — used for the compass app and for navigation indoors. The same dipole law is used by engineers who place magnetic position sensors in cars and robots, by doctors who track magnetic markers in the body, and by geophysicists who locate buried iron objects and ore bodies from the $1/r^3$ fall-off of their fields. Measuring a magnet's moment with a phone reproduces, in miniature, a standard laboratory method.
What to do.
- Install a free sensor app that shows the magnetometer reading (e.g. phyphox). Find where the sensor sits inside the phone by sliding a small magnet around it and watching for the largest reading.
- Lay a ruler on a table along the line through the sensor. Record the background reading (the Earth's field plus the building) with no magnet present.
- Place a small disc magnet on the ruler with its axis along the ruler, and record the field component along the ruler for distances $r=4,\,5,\,6,\,8,\,10,\,12,\,15$ cm from the sensor. Subtract the background each time.
- Plot $\log B$ against $\log r$. Measure the slope, and from the intercept (or from $B r^3$ at each point) find $m$ using $B=\dfrac{\mu_0}{4\pi}\dfrac{2m}{r^3}$. Repeat with the phone on the magnet's equatorial line and check the factor of $2$.
Tools: Smartphone with a sensor app, ruler, small neodymium or ferrite magnet, spreadsheet or graph paper. Keep the magnet more than a few centimetres from the phone, and away from bank cards.
Hand in: Your table, the log–log graph with its slope, your value of $m$ from both lines, and a comment on which distances gave unreliable results and why.
Going further. Estimate the magnetisation of the magnet, $M=m/V$ (Section 5.2), from its dimensions. How does it compare with the value about $1\times10^{6}$ A/m quoted for neodymium magnets?
🧪 Self-check quiz
Q1. Inside a bar magnet the magnetic field lines run
Q2. The SI unit of magnetic moment is
Q3. The field on the axis of a short magnet is $B_0$ at distance $r$. At distance $2r$ on the same axis it is
Q4. Gauss's law for magnetism, $\oint\mathbf B\cdot d\mathbf A=0$, expresses the fact that
Q5. A compass needle oscillates with period $T$ in a uniform field. If the field is made four times stronger, the period becomes