Magnetic field at the center and ends of a long solenoid A long solenoid has current $I$ flowing through it, also denote $N$ as the turns per unit length. Take its axis to be the $z$-axis, by symmetry the only component of the magnetic field inside is $B_z$. Find the magnetic field at the center of the solenoid (on the axis). Also, find the magnetic field at the ends of the solenoid.
For the first part, since the solenoid is long we can approximate the magnetic field inside to be uniform and is given by $B_z = μ_0NI$, so we can say that the magnetic field at the center is also $μ_0NI$. I'm not sure if my argument is correct but based on my understanding, from the uniformity of the $B$-field inside, it should be the same everywhere inside. Can anyone kindly tell me if this is correct? Any suggestions and insights?
For the second part I don't have any idea on how to start.
 A: since you are concerned about a long solenoid, this problem has a very simple solution.
Suppose you have two identical long solenoids, each of them having magnetic field $B$ at the ends. You join them end to end, such that their magnetic moments are in same direction. Thus, at the junction the magnetic field adds up to $B+B=2B$.
But this junction is nothing but the mid point of another long sloenoid, with same value of N. Thus we get $μNI=2B$, or $B=μNI/2 $!
A: Notice, the magnetic field at some internal point on the axis of a solenoid is given by general expression 
$$B=\frac{\mu_0 NI}{2}(\cos\theta_1-\cos\theta_2)$$
where, $\theta_1$ & $\theta_2$ are the angles between axis & the lines joining the extreme-points of both the ends of solenoid to the concerned point.  
1) magnetic field at the center of a long solenoid is given by setting $\theta_1=0$ & $\theta_2=\pi$ $$B=\frac{\mu_0 NI}{2}(\cos 0-\cos\pi)=\color{blue}{\mu_0 NI}$$
2) magnetic field at the end of a long solenoid is given by setting $\theta_1=\pi/2$ & $\theta_2=\pi$ $$B=\frac{\mu_0 NI}{2}(\cos \pi/2-\cos\pi)=\color{blue}{\frac{\mu_0 NI}{2}}$$
Thus, the magnetic field at the center of a long solenoid is two times the magnetic field at the ends .
