Why does sound travel faster in warm air?

I thought sound always travels faster in a denser medium - For eg, it travels faster in water than in air. And I believe thats because the molecules are packed closer together, so the vibrations are transferred faster between them, hence more speed.

But then why does sound travel in less dense, warmer air than in dense cold air? Correct me if I'm wrong, but doesnt the speed of sound increase if you cool down a solid or liquid (because density increases)?

I've heard of this equation that says the speed of sound is proportional to gas temperature and inversely proportional to its molar mass. So what is it with gases that reverses this "more density=more speed" phenomenon you would normally find in liquids and solids?

So if we had a graph that plotted the speed of sound vs temperature of the substance, what kind of trend would we get? How would this trend differ with different states of matter - gases, liquids and solids?

I thought sound always travels faster in a denser medium - For eg, it travels faster in water than in air. And I believe thats because the molecules are packed closer together, so the vibrations are transferred faster between them, hence more speed.

But then why does sound travel in less dense, warmer air than in dense cold air? Correct me if I'm wrong, but doesnt the speed of sound increase if you cool down a solid or liquid (because density increases)?

I've heard of this equation that says the speed of sound is proportional to gas temperature and inversely proportional to its molar mass. So what is it with gases that reverses this "more density=more speed" phenomenon you would normally find in liquids and solids?

So if we had a graph that plotted the speed of sound vs temperature of the substance, what kind of trend would we get? How would this trend differ with different states of matter - gases, liquids and solids?

thanks

Good question. Actually, the sound speed is dependent on the sqare root of the absolute temperature divided by the molar mass. Specifically,

[tex]v = \sqrt{\frac{\gamma R T}{M}}[/tex]

Here [tex]\gamma [/tex] is the adiabatic constant of the gas, usually approximated as 1.4 for air. So the graph of sound speed vs. temperature would obey a square root function. Often times you'll see the following equation:

[tex]v = 331 m/s + (0.6 m/s/C) T[/tex]

Here T is no longer the absolute temperature, but the Celsius temperatue. My guess is that this equation is arrived at by taking the Taylor series of the exact expression. Whatever the case, it holds for temperatures near the freezing point of water. But keep in mind that in general, sound speed is not proportional to Celsius temperature, it's proportional to the square root of the absoute temperature.

Now as to the issue of density. It actually turns out that denser materials carry sound more poorly (i.e. the sound speed reduces with increased density). For example, for a wave on a string with tension [tex]F[/tex] and linear mass density [tex]\mu[/tex],

[tex]v = \sqrt{\frac{F}{\mu}}[/tex]

So if you increase the mass density of the string, the wave speed decreases! This probably defies your common sense, but there's a reason. Waves travelling through three-dimensional solids behave a lot like waves on a string. But solid objects have a very high tension, which is why sound travels faster. It's not the density that increases the sound speed, but the tension.

The density is not directly related to the temperature of the air. The temperature can still be raised and the density can still be same provided that the volume remains the same. Then the increase in temperature brings about an increase in translational kinetic energy according to the first law of thermodynamics.