In this problem, use Ampère's law to show that the magnetic field inside a long solenoid is $B=\mu_{0} n I .$ Assume that
the field inside the solenoid is uniform and parallel to the axis and that the field outside is zero. Choose a rectangular path for Ampère's law. (a) Write down $B_{\|} \Delta l$ for each of the four sides of the path, in terms of $B, a$ (the short side), and $b$ (the long side).
(b) Sum these to form the circulation.
(c) Now, to find the current cutting through the path: each loop carries the same current $I,$ and some number $N$ of loops cut through the path, so the total current is $N I .$ Rewrite $N$ in terms of the number of turns per unit length $(n)$ and the physical dimensions of the path.
(d) Solve for $B$.