The speed of sound in mathematical notation is conventionally represented by c, from the Latin celeritas meaning "swiftness".
For fluids in general, the speed of sound c is given by the Newton–Laplace equation:
where
*  is a coefficient of stiffness, the isentropic bulk modulus (or the modulus of bulk elasticity for gases);
*  is the density.
Note that , where  is the pressure and the derivative is taken isentropically, that is, at constant entropy s. This is because a sound wave travels so fast that its propagation can be approximated as an adiabatic process, meaning that there isn't enough time, during a pressure cycle of the sound, for significant heat conduction and radiation to occur.
Thus, the speed of sound increases with the stiffness (the resistance of an elastic body to deformation by an applied force) of the material and decreases with an increase in density. For ideal gases, the bulk modulus K is simply the gas pressure multiplied by the dimensionless adiabatic index, which is about 1.4 for air under normal conditions of pressure and temperature.
For general equations of state, if classical mechanics is used, the speed of sound c can be derived as follows:
Consider the sound wave propagating at speed  through a pipe aligned with the  axis and with a cross-sectional area of . In time interval  it moves length . In steady state, the mass flow rate  must be the same at the two ends of the tube, therefore the mass flux  is constant and . Per Newton's second law, the pressure-gradient force provides the acceleration:
And therefore:
If relativistic effects are important, the speed of sound is calculated from the relativistic Euler equations.
In a non-dispersive medium, the speed of sound is independent of sound frequency, so the speeds of energy transport and sound propagation are the same for all frequencies. Air, a mixture of oxygen and nitrogen, constitutes a non-dispersive medium. However, air does contain a small amount of CO which is a dispersive medium, and causes dispersion to air at ultrasonic frequencies ().
In a dispersive medium, the speed of sound is a function of sound frequency, through the dispersion relation. Each frequency component propagates at its own speed, called the phase velocity, while the energy of the disturbance propagates at the group velocity. The same phenomenon occurs with light waves; see optical dispersion for a description.