Derive the formula dsinθ = n𝜆
For the first order maximum, the path difference between two adjacent rays of light is 1𝜆 (as shown), the angle between the normal to the grating and the light ray is θ.
A right angled triangle is formed, with side lengths d and λ. the upper angle is θ (the lower angle is 90-θ°).
for the first maximum sinθ =𝜆/d, (sin θ = Opp/Hyp) rearrange to dsin =𝜆,
other maxima occur when the path difference between the two rays of light is nλ, where n is an integer, replace λ with nλ to get: d sin =n𝜆