To complete the deviation analysis we need to eliminate one of a or b by coming up with another equation linking the two. This is the Snell's Law equation. I have given it here in the version that makes most sense to me. Medium 1 is air so refractive index n1 = 1. My source also makes explicit something that was bugging me when I was thinking about thin film interference: yes, different frequencies do have different refractive indices in the same medium, otherwise there would be no spreading of the spectrum.