Since the yellow beam is refracted at 90∘, the angle of incidence i is exactly the critical angle for yellow:
sini=sinic, yellow=nyellow1
In glass (or water), the refractive index is slightly larger for shorter wavelengths, so nred<nyellow<nblue.
(a) Blue light is totally internally reflected. It has the largest n, so the smallest critical angle, sinic, blue=1/nblue<sini. The fixed angle i now exceeds the critical angle for blue, so no refracted ray is possible.
(b) Red light is refracted into the second medium. It has the smallest n, so its critical angle is larger than i. With i below its critical angle, red emerges, grazing just above the surface at slightly less than 90∘.
