The formula for finding the velocity of a longitudinal wave, such as a sound wave, is: $$v = \sqrt{\frac{E}{\rho}}$$ Where $v$ represents the velocity, $E$ represents the elasticity of the medium, and $\rho$ represents the density of the medium.
From this formula, it is obvious that velocity is inversely proportional to the square root of the density of the medium. It means that if the density increases, the velocity decreases.
However, isn't the opposite true for sound waves? As the density of the medium increases, the velocity of sound actually increases. For example, sound travels faster in water than in air. Please explain why this is so.