Option 1: Solenoid field seen as a stack of circular loops
Step 1: A solenoid is nothing but a large number of identical circular current loops set side by side. Deep inside a very long solenoid the fields of neighbouring loops add along the axis and cancel sideways, giving a uniform axial field; outside, the return field spreads over a huge area and is practically zero.
Step 2 (Apply Ampere on a rectangle): Draw a rectangle of axial length \(L\) with one long side inside and one long side far outside. The circulation of \(\vec B\) receives \(B\,L\) from the inner side; the outer side contributes nothing because \(B\approx 0\) there, and the two end sides contribute nothing because \(\vec B\) is perpendicular to them. So
\[ \oint \vec B\cdot d\vec l = B\,L. \]
Step 3 (Count the wires pierced): If the winding has \(n\) turns per metre, the rectangle of length \(L\) is pierced by \(nL\) wires, each carrying \(I\); the enclosed current is \(nLI\).
Step 4 (Ampere's law): Equating,
\[ B\,L = \mu_0\,(nL)\,I \;\Rightarrow\; B = \mu_0 n I. \]
Step 5: Writing \(n = N/\ell\) (total turns \(N\) over length \(\ell\)) gives the equivalent form \(B = \mu_0 N I/\ell\). The result shows the field depends only on turns per unit length and current, not on the radius.
\[\boxed{B = \mu_0 n I}\]
Option 2: Torque on a dipole through the current-loop model
Step 1: Model the magnetic dipole as a small plane current loop of area \(A\) carrying current \(i\), so that its magnetic moment is \(M = iA\) (equivalently \(M = m\cdot 2l\) for a bar magnet). Place the loop in a uniform field \(\vec B\) with its normal at angle \(\theta\) to \(\vec B\).
Step 2: The two opposite sides of the loop carry currents in opposite directions, so they feel equal and opposite forces \(F = BiL_{\text{side}}\). These form a couple; the net force is zero.
Step 3: The moment arm of this couple is the projection of the loop width across the field, which introduces a factor \(\sin\theta\). Working out the geometry gives torque \(= (iA)B\sin\theta\).
Step 4: Since \(M = iA\),
\[ \tau = M B\sin\theta,\qquad \vec\tau = \vec M\times\vec B. \]
Step 5 (Definition): Setting \(\theta = 90^\circ\) and \(B = 1\) makes \(\tau = M\). So the magnetic dipole moment equals the maximum torque a dipole feels in a unit field, i.e. the torque when the dipole sits perpendicular to the field of unit strength.
\[\boxed{\tau = MB\sin\theta}\]