Consuder a solenoid of length L having N turns. The diametre of the solenoid is assumed to be much smaller when compared to its length and the coil is wound very closely.
In order to calculate the magnetic field at any point inside the solenoid , we use Ampere's circuital law. Consider a rectangular loop abcd as shown in Figure. Then from Ampere's circuital law,
`underset(C) oint vecB . vec(dl) = mu_(0)I_("enclosed")`
` = mu_(0) xx ` ( total current enclosed by Amperian loop )
The left hand side of the equation is
`underset(C) ointvecB . vec(dl) = underset(a) overset(b)intvecB. vec(dl) + underset(b) overset(c) int vecB.vec(dl) + underset(c)overset(d)intvecB.vec(dl) + underset(d) overset(a)int vecB. vec(dl) `
Since the elemental lengths along bc and da are perpendicular to the magnetic field which is along the axis of the solenoid , the integrals
`underset(b) overset(c) intvecB.vec(dl) = underset(b) overset(c) int |vecB||vec(dl)|cos 90^(@) = 0 `
` underset(d) overset(a) int vecB.vec(dl) = 0 `
Since the magnetic field outside the solenoid is zero , the integral `underset(c) overset(d) int vecB.vec(dl) `
For the path along ab , the integral is
`underset(a) overset(b)int vecB.vec(dl) = B underset(a) overset(b) int dl cos 0^(@) = B underset(a) overset(b) int dl `
where the length of the loop ab as shown in the Figure is h. But the choice of length of the loop ab is arbitrary. We can take very large loop such that it is equal to the length of the solenoid L .
Therefore the integral is
`underset(a) overset(b) int vecB. vec(dl) = BL `
Let NI be the current passing through the solenoid of N turns, then
`underset(a) overset(b) vecB.vec(dl) = BL = mu_(0) NI rArr B = mu_(0) (NI)/ L `
The number of turns per unit length is given by `N/L = n , ` Then
`B = mu_(0) (n LI)/L = mu_(0) n I `
Since n is a constant for a given solenoid and `mu_(0)` is also constant. For a fixed current I , the magnetic field inside the solenoid is also a constant.