# Why does the speed of sound decrease with increase in density?

In my book it's written that speed of sound will in increase with increase in density of the medium as molecules with get closer to each other, but after some browsing on internet I found out about Laplace's formula which states that speed of sound in a medium is inversely proportional to density of the medium?Which of these is correct and why?

• What medium? Gases or solids? May 29 '20 at 15:23
• Have a look at these values: aplustopper.com/speed-of-sound-in-various-substances May 29 '20 at 15:26
• @JohnRennie can you pls explain this for all the mediums May 29 '20 at 15:51
• None of your statements are valid. The speed of sound goes like the inverse of the square root of density of the medium.
– nasu
Jan 20 at 3:26

In that answer for elastic field in a solid, you can see that the density is multiplying the time derivative of the displacement: $$\rho\frac{\partial^2 u_x}{\partial t^2}$$ The second derivatives of the displacements with respect to position are in the left side of the equations.