Why are red and blue light refracted differently if they travel at the same speed in the same medium?

In general, red and blue light do not travel at the same speed in a non-vacuum medium, so they have different refractive indices and are refracted by different amounts. This phenomena is known as dispersion.


The refractive index is a function of wavelength. It has different values for different wavelengths. The way to show this in the mathematical notation is to write $$ n(\lambda) $$ just as you would write $f(x)$ for some function of $x$. So with this more complete notation Snell's law is written $$ n_1(\lambda_1) \sin (\theta_1) = n_2(\lambda_2) \sin (\theta_2). $$ The common version $$ n_1 \sin (\theta_1) = n_2 \sin (\theta_2) $$ is saying the same thing, once you remember that $n_1$ and $n_2$ here refer to the refractive index at the wavelength in question in the medium in question.

The wavelength will itself be different in the two media. This makes it slightly awkward to use the formulae in terms of wavelength as written above. However the frequency will be the same in the two media so one way to proceed is to find the index as a function of frequency and use that.


Index of refraction actually does depend on the wavelength of the light in the medium. Typically this detail is left out of introductory physics classes, and the values of index of refraction given to students only applies to yellow light (at least this is what happened in my experience).

Of course, one obvious example of index of refraction being wavelength dependent is when white light moves through a prism. We end up with a spectrum coming out of the prism, indicating that the speed of light in the prism varies with wavelength of the light.