the index of refraction is not a property between interfaces of two materials, but rather an intrinsic property of that material. It is defined as the ratio of the speed of light in vacuum to that of the speed of light within the material.
hence it doesnt matter if light is going from pure nitrogen into glass, or from oxygen into treacle syrup, the refractive index of the materials are the same.
So your question "what would the index of refraction be at minus 40 degrees Celsius between air and ice and air and water" should really just be "what is the refractive indices of air, water, and ice and -40 C" since it is meaningless to ask what it is at the interfaces.
It is true that refractive index is a function of temperature, but not specifically because it changes its density. The refractive index is related to the complex dielectric constant of the material, which itself is dependent upon the atomic structure of the material (that is the phase it is in), as well as also varies with temperature while in that phase (see image example below). It is also a function of the wavelength of light. The fortunate thing is that for most transparent materials using visible light, one can neglect the imaginary part of the complex dielectric constant.
In the lower graph you will see how this particular material (Barium titanate's dielectric constant (called relative permittivity in this instance) varies with temperature, as well as its response in each phase (rhomobhedric, orthorhomic, tetragonal, and cubic).
As for the values, it is not something that I would be able to calculate for you, and your best bet is to find experimentally determined values. For air though, it will remain close to 1 for most temperatures at which humans can survive. At STP air has a refractive index of n = 1.000 292, whilst CO2 has n = 1.000 449, and nitrogen 1.000 298 at wavelengths of 598.9 nm (thats yellow light, more specifically the yellow light from the sodium D lines). Until gases approach liquid or solid phases, their refractive indices wont change significantly from 1.000something. (taken from here [www.kayelaby.npl.co.uk])
Water is difficult to say, as you tend not to get liquid water at -40C unless it is under larger pressures. Infact If I remember correctly under normal conditions, water cannot be liquid below about -20C regardless of applied pressure. See diagrams below (of water phase a function of temperature and applied pressure, meaning pressure applied above atmospheric pressure) as well as here [www.lsbu.ac.uk]
So the question really is what is the refractive index of ice at -40 C, but as you can see from the above, at -40C ice has 4 different thermodynamic states which could influence the dielectric constant and hence its refractive index. [gwest.gats-inc.com]. It will be a matter of a literature search to try and find the value, but I imagine it will be somewhere around 1.3. I dont have time for a literature search now, but if I get time later I will see what I can find.
This post was created using 100% recycled electrons