DoubleSlit Formula
Here we want to derive a formula that we can use to figure out the wavelength \(\lambda\) of light in a doubleslit experiment.
Consider a doubleslit experiment in which an interference pattern is generated at a detector screen.

The perpendicular distance from the double slit to the detector screen is \( a \) and can be determined for example with a folding rule.

The distance from the main maximum to an interference fringe is \( x \) and can be measured for example with a ruler. Note, however, that you always have to measure exactly from the center of one fringe to the center of the other fringe, because only e.g. exactly in the center of the light fringe the condition for constructive interference is fulfilled.

The distance of the two slits is \( g \).
Distance \( a \) and \( x \) form almost a right triangle. Complete the triangle by drawing the hypotenuse \( h \) of the triangle. The hypotenuse here shows at which angle \( \theta \) any maximum or minimum lies; depending to which maximum or minimum you measured the distance \( x \).
To make the formula simple at the end, we make two approximations.

Approximation #1: The distance \(a \) between the screen and the double slit is much larger than the distance \( x \) of the fringes on the screen: \(a ~\gt\gt~ x\)

Approximation #2: The slit distance \( g \) is much smaller than the slittoscreen distance \( a \): \(a ~\gt\gt~ g\)
Because of the first approximation the angle \( \theta \) enclosed by the sides \( a \) and \(x \) is very small. Thus the length of the hypotenuse \( h \) is about the same as the slitscreen distance \( a \): \( a \approx h \). For \( \theta = 0 \) they would be equal: \( h = a \). The sine of the angle \(\theta\) is the opposite cathetus divided by hypotenuse, and here we assume \(a\) to be the hypotenuse:
Next, let's consider another right triangle:
Since the detector screen is placed very far away from the double slit and is much larger compared to the slit distance \(g\), the two paths of two light waves, after passing through the two slits, close to the double slit, are approximately parallel (they would be exactly parallel if the screen were infinitely far away from the double slit). So here we use the second approximation.
In the right triangle (see illustration 2), we denote the angle opposite the slit distance \( \delta s \) by \( \beta \). The hypotenuse here is the slit distance \( g \).
By a simple geometrical consideration you can find out that the angles \( \theta \) and \( \beta \) are almost equal: \( \beta \approx \theta \) (they are equal \( \theta = \beta \) if the light paths behind the double slit are exactly parallel to each other). Thus, the sine of the angle \(\theta\) is opposite cathetus (path difference) divided by the hypotenuse (slit distance):
Set the two approximations 1
and 2
equal. In this way you eliminate the unknown angle \(\theta\) and get the formula you are looking for (we write approximately equal for most purposes as equal):

If you consider the distance from the main maximum to a bright interference fringe, then the path difference is \( \Delta s = m \, \lambda \). Here \( m = 0,1,2,...\) is an integer. So Eq.
3
becomes:$$ \begin{align} \frac{m \, \lambda}{g} ~=~ \frac{x}{a} \end{align} $$ 
For the distance from the main maximum to a dark fringe, use the condition for destructive interference: \( \Delta s = (m  1/2) \, \lambda \), with \( m = 1,2,...\):
$$ \begin{align} \frac{(m  1/2) \, \lambda}{g} ~=~ \frac{x}{a} \end{align} $$