The colors we see in the bubble are produced by the interference between two waves: a) the wave reflected by the surface of the bubble b) the wave that travels inside the bubble and it is reflected by its back.
The condition for the constructive interference is that the phase shift between the two waves is an integer multiple of
. The phase difference between the two waves is
where
is twice the thickness of the bubble (since the second wave travels inside the bubble and it is reflected from the back), while
is due to the fact that the first wave has an extra phase shift
because it is reflected from a material (soap) with higher refraction index than the air.
So, in order to have constructive interference, we should require
where m is an integer. Substituting
and
, we have
But here
is the wavelength in the soap; we need instead the wavelength in the air, which is
where n=1.33 is the refraction index.
Therefore, we have
Using t=390 nm, and using different values of m, we find tha only m=1 and m=2 have wavelength in the visible spectrum:
and
. These wavelengths correspond to red and violet, so the bubble appears as red-violet.