As already mentioned in @Miyase's comment you can derive this result
by applying the Huygens-Fresnel principle.
Consider two slits (each having width $a$, at a distance $g$)
illuminated by light of wavelength $\lambda$ (and hence
wave number $k=\frac{2\pi}{\lambda}$).
The following calculation is not essentially difficult, but requires some
familiarity with complex analysis. Therefore it is usually
not taught in an introductory physics course.
The light amplitude $E(\theta)$ into direction $\theta$
can be calculated straight-forward by summing the contributions
- by the first slit ($x$ from $-\frac g2-\frac a2$ to $-\frac g2+\frac a2$)
- and by the second slit ($x$ from $+\frac g2-\frac a2$ to $+\frac g2+\frac a2$)
The path difference of each contributing ray (compared to the
path length of the ray originating from the center of the double slit
at $x=0$) is $x\sin\theta$. And hence its phase is $kx\sin\theta$.
Summing these contributions you get
$$\begin{align}
E(\theta)
&=E_0\left(
\int_{-g/2-a/2}^{-g/2+a/2}e^{ikx\sin\theta}dx
+\int_{+g/2-a/2}^{+g/2+a/2}e^{ikx\sin\theta}dx
\right) \\
&=E_0\left(e^{-\frac i2 kg\sin\theta}+e^{+\frac i2 kg\sin\theta}\right)
\int_{-a/2}^{+a/2}e^{ikx\sin\theta}dx \\
&=2E_0\cos\left(\frac 12 kg\sin\theta\right)
\frac{\sin\left(\frac 12 ka\sin\theta\right)}{\frac 12 k\sin\theta}
\end{align}$$
From this you get the intensity $I(\theta)=|E(\theta)|^2$
(using $I_0=4E_0^2a^2$ as an abbreviation)
$$I(\theta)=I_0
\cos^2\left(\frac 12 kg\sin\theta\right)
\left(\frac{\sin\left(\frac 12 ka\sin\theta\right)}{\frac 12 ka\sin\theta}\right)^2
$$
You see, you got a product of two factors.
The first factor is the interference pattern of 2
infinitesimally narrow slits separated by distance $g$.
And the second factor is the diffraction pattern
of a single slit of width $a$.