The equation of state for an ideal gas is given by:
$$p = \rho r T \tag{1}$$
In the other hand, the speed of sound is calculated by:
$$c = \sqrt{{\partial p\over \partial \rho}}\tag{2}$$
Using (1) we get:
$$c = \sqrt{rT}\tag{3}$$
But in most textbooks, the speed of sound in this case is given by:
$$c = \sqrt{\gamma r T}\tag{4}$$
Where did $\gamma$ in equation (4) come from? what is wrong with my derivation?
I appreciate your help.