potential flow question about sound speed For isentropic $P = k\rho^\gamma$ steady irrotational $\vec{u} = \nabla\phi$ flow, the momentum equation implies the Bernoulli relation
$$\tfrac{1}{2}|\nabla\phi|^2+\frac{k\gamma}{\gamma-1}\rho^{\gamma-1} = C$$
where $C$ is constant throughout the (connected) fluid. So far so good, I think, at least for smooth solutions. Now it is also true that the speed of sound is given by
$c^2 = P'(\rho) = k\gamma\rho^{\gamma-1}$, which ought to vary throughout the flow. But then wherever the speed $|\nabla\phi|$ is equal to the sound speed you could solve the Bernoulli relation to find 
$$ c^2 = \frac{\gamma-1}{\gamma+1}\frac{C}{3}.$$
But this is constant. What am I doing wrong?
 A: Aside from an algebraic error, you have solved for the critical value of sound speed where the fluid attains Mach 1 -- hence, you have done nothing wrong.  The sound speed will assume different values throughout the flow as a function of local temperature. Nevertheless the fluid will attain a condition where the velocity equals a specific sound speed (Mach 1) that depends on the density where the fluid is at rest.  There are other constraints to isentropic flow, for example, a maximum attainable velocity which corresponds to the pressure falling to $0$.
At Mach 1 the fluid velocity equals the critical speed of sound $c_*$at local conditions, so $|\nabla\phi|^2 = c_*^2$ and substituting in the Bernoulli equation we have
$$\frac{c^2}{2} + \frac{k\gamma \rho^{\gamma-1}}{\gamma-1} = \frac{c_*^2}{2} + \frac{c_*^2}{\gamma-1} = C \\ \implies c_*^2 \frac{\gamma +1 }{2(\gamma -1)}= C \\ \implies c_*^2 = 2C \frac{\gamma-1}{\gamma+1} \quad (*)$$.
The constant C can be related to the speed of sound $c_0$ when the fluid is at rest.  Under such stagnation conditions the fluid velocity is $0$ and, again, using the Bernoulli equation we have
$$ \frac{k\gamma \rho_0^{\gamma-1}}{\gamma-1} = \frac{c_0^2}{\gamma-1} = C $$
Substituting for C in (*) we obtain
$$c_*^2 = 2\frac{c_0^2}{\gamma-1} \frac{\gamma-1}{\gamma+1} = \frac{2c_0^2}{\gamma+1}, $$
which yields
$$\frac{c_*}{c_0} = \sqrt{\frac{2}{\gamma+1}}$$
Typical values for air are $\gamma = 1.4$ and $c_* \approx 0.913 c_0$. 
