Ampere's circuital law — find magnetic field inside a long solenoid

medium CBSE JEE-MAIN NCERT Class 12 4 min read

Question

A long solenoid has nn turns per unit length. Using Ampere’s circuital law, find the magnetic field inside it.

This is a standard derivation — it appears in CBSE Class 12 boards almost every year (3–5 marks) and is a conceptual foundation for problems in JEE Main.


Solution — Step by Step

We choose a rectangular loop PQRS with side PQ of length LL lying inside the solenoid (parallel to the axis), and side RS lying outside.

The reason for this shape: we need one side where B\vec{B} is uniform and parallel to the path, and one side where B=0\vec{B} = 0 (outside an ideal infinite solenoid).

Ampere’s circuital law states:

Bdl=μ0Ienc\oint \vec{B} \cdot d\vec{l} = \mu_0 I_{enc}

We split the line integral over all four sides:

  • PQ (inside, parallel to axis): Bdl=BL\vec{B} \cdot d\vec{l} = B \cdot L
  • QR and SP (perpendicular to axis): Bdl\vec{B} \perp d\vec{l}, so contribution = 0
  • RS (outside solenoid): Boutside=0B_{outside} = 0, so contribution = 0

The entire integral reduces to BLB \cdot L.

The loop encloses a length LL of the solenoid. With nn turns per unit length, the number of turns inside the loop is nLnL.

Each turn carries current II, so the total enclosed current is:

Ienc=nLII_{enc} = nLI

Substituting into Ampere’s law:

BL=μ0nLIB \cdot L = \mu_0 \cdot nLI B=μ0nI\boxed{B = \mu_0 n I}

The length LL cancels cleanly — which is expected, since the field inside an ideal solenoid is uniform everywhere.


Why This Works

An ideal solenoid is essentially a stack of circular current loops packed tightly together. The field from adjacent turns partially cancels outside but adds up constructively inside — which is why Boutside0B_{outside} \approx 0 for a long solenoid. This is the key assumption that makes the Amperian rectangle so powerful here.

The beauty of Ampere’s circuital law is that we don’t need to know the field geometry in detail — we just need to pick a loop where the integral is easy to evaluate. The rectangle works because it exploits the symmetry: the field is uniform and axial inside, and negligible outside.

Notice that B=μ0nIB = \mu_0 n I depends only on nn (turns per unit length) and II, not on the radius of the solenoid or its total length. A solenoid twice as wide but with the same nn and II gives the same field inside.


Alternative Method

We can also write the formula using total turns NN and total length \ell:

n=N    B=μ0NIn = \frac{N}{\ell} \implies B = \frac{\mu_0 N I}{\ell}

This form is more useful in numerical problems where total turns and length are given directly (common in JEE Main MCQs). Both are equivalent — use whichever matches the data given.

If the problem gives “number of turns per cm”, convert to per metre before substituting. n=500n = 500 turns/cm =50000= 50000 turns/m. Forgetting this unit conversion is a very common error in numericals.


Common Mistake

Many students write the Amperian loop integral as B×4LB \times 4L — treating all four sides as contributing BLBL each. This is wrong. Only the side inside the solenoid (PQ) contributes. QR and SP are perpendicular to B\vec{B} (dot product = 0), and RS is outside where B=0B = 0. Always analyse each side separately before adding.

A related error: confusing nn (turns per unit length) with NN (total turns). The formula B=μ0nIB = \mu_0 n I uses nn. If you accidentally write NN without dividing by length, your answer will be off by a factor of \ell — and it won’t even have the right units.

Want to master this topic?

Read the complete guide with more examples and exam tips.

Go to full topic guide →

Try These Next