In the notes I have, they have a diffraction grating with $2N + 1$ slits, a slit width of $2a$ and a slit spacing of $d$. They then say that the equation for the diffraction intensity pattern is given by:
$$I = I_0 \left( \frac{\sin((N+\frac{1}{2})kd\sin\theta)}{\sin(\frac{1}{2}kd\sin\theta)} \right)^2 \left( \frac{\sin(ka\sin\theta)}{ka\sin\theta} \right)^2 $$
They don't, however, give any proof or reason why this is the formula. I have been looking online for a way to justify this formula but I cant find anything. Anybody have a nice proof for this?