Magnetic field due to a coil of N turns and a solenoid I have learnt that the formula for calculating the magnetic field at the centre of a current-carrying coil of $N$ turns is:- $$ B = \frac {\mu N I}{2r}$$
(where $r=$ radius of the loop,
$I=$ current in the coil)
And, the magnetic field at the centre of a current-carrying solenoid of $N$ turns is:- $$ B = \frac{\mu N I}{L}$$
(where $L$ & $I$ are the length and the current in the solenoid respectively and $\mu=\mu_0\mu_r$ is the magnetic permeability).
As we can see, both these formulas are different. But I can't figure out why that is.
 (Since from what I have read about solenoids, they are just a number of coils wound closely together).
So my question is-
why are there two different formulas for magnetic field at the the centre of a coil of $N$ turns and of a solenoid?
 (Is a solenoid somehow different from a coil having many turns?)
 A: Let's discuss the matter both qualitatively and quantitatively
Quantitative Discussion
First of all let's derive the expression for the magnetic field at the axis of a current carrying coil


Let's begin with a coil of a single turn and derive the expression for the magnetic field on the axis of this coil. The cos components of the magnetic field cancel out due to symmetry and the sine components add up along the axis. So we have the field as $$dB=\frac{\mu_0Idl\sin\alpha}{4\pi r^2}\sin\theta$$
Here $\alpha=\frac{\pi}{2}$, so $\sin\alpha=1$ ($\alpha$ is the angle b/w the face of the loop and the object).
or $$dB=\frac{\mu_0Idl}{4\pi r^2}\sin\theta$$ or $$B=\int\frac{\mu_0Idl}{4\pi r^2}\frac{R}{r}$$ or $$B=\frac{\mu_0IR}{4\pi r^3}\int dl$$ 
($\int dl= 2\pi r$ i.e. the circumference of the coil) or $$B=\frac{\mu_0IR}{4\pi r^3} 2\pi R$$ or $$B=\frac{\mu_0IR^2}{2(R^2+x^2)^\frac{3}{2}}$$
Now for an object at the centre of the coil $x=0$ so $$B=\frac{\mu_0I}{2R}$$
Now the point is that we can extend this formula for a coil of N turns iff the thickness of the coil is small(better if negligible) i.e all the loops are nearly on the same cross section. Otherwise if the coil is considerably thick then we cannot apply this derivation. For a thick coil (solenoid) the derivation is different

Let us discuss about this coil of thickness t. Here we cannot apply the above derivation as the coil is thick. If we wish to derive the expression of magnetic field on the axis of this coil with the method we did before we will not only have to integrate along the circumference of each individual loop of the coil but also along the length of the coil. Thus it would be better if in this case we consider our differential element not to be $dl$ on the circumference of the coil, but to be a coil of small thickness $dx$ itself and this brings us to the logic for deriving the magnetic field on the axis of a solenoid.
 
Let 'N' be the number of coils per unit length of the solenoid. So in the length $dx$ there will be $Ndx$ number of coils.
The field experienced by an object O at the centre of this solenoid is given by $$dB=\frac{\mu_0NdxIR^2}{2(R^2+x^2)^\frac{3}{2}}$$ Now we can substitute $x$ as $R\tan\theta$ so $$x=R\tan\theta$$ or $$dx=R\sec^2\theta d\theta$$ putting these values we get $$dB=\frac{\mu_0NI\cos\theta d\theta}{2}$$ integrating the expression from $-\frac{\pi}{2}$ to $+\frac{\pi}{2}$ we get $$B=\int_\frac{-\pi}{2}^\frac{\pi}{2} \frac{\mu_0NI\cos\theta d\theta}{2}$$ or $$B=\frac{\mu_0NI}{2} \int_\frac{-\pi}{2}^\frac{\pi}{2} \cos \theta d\theta$$ or$$B=\frac{\mu_0NI}{2} (\sin\frac{\pi}{2} -\sin(-\frac{\pi}{2}))$$ or $$B= \mu_0NI$$ which is the required expression for the field at the centre of a solenoid.
Look in this derivation, unlike the first one here we have assumed the differential element to be a coil of small thickness $dx$ rather than assuming a small length $dl$ on any of the coils.
so for the thick coil the derivation will be 

Qualitative Discussion
For a coil of n turns we can apply the formula $$B=\frac{\mu_0NI}{2R}$$ only when all the $N$ turns of the coil are nearly on the same cross section. Otherwise we will have to resort to the expression of solenoid. 
I hope these helped clear ur doubts
