Solution (source code)

= Solution

For a physical adiabatic <ideal gas> one has $\gamma>1$; the following algebra also holds for positive $\gamma\ne1$. Compression work implies $p=\rho W'(\rho)-W$, obtained by differentiating the total internal energy $VW(M/V)$ at fixed mass. With the stated pressure law this integrates to
$$
\boxed{W(\rho)=p/(\gamma-1)+C\rho}.
$$
The term proportional to mass is an arbitrary energy reference; set $C=0$. <Mass flux> is $\rho u$, <momentum flux> is $p+\rho u^2$, and dividing the energy flux by <mass flux> gives
$$
\boxed{\frac{\gamma}{\gamma-1}\frac p\rho+\frac{u^2}{2}=\text{constant}}
$$
for steady flow.

Work in the shock's rest frame. If the shock speed in the laboratory is $D$, upstream speed relative to it is $D$ and downstream speed is $D/r$, where $r=\rho_1/\rho_0$. Conservation of momentum gives $p_1-p_0=\rho_0D^2(1-1/r)$. Conservation of specific total enthalpy gives
$$
\frac\gamma{\gamma-1}\frac{p_0}{\rho_0}+\frac{D^2}{2}
=\frac\gamma{\gamma-1}\frac{p_1}{r\rho_0}+\frac{D^2}{2r^2}.
$$
Eliminating $D^2$ and using $p_1/p_0=1+\beta$ yields
$$
\boxed{\frac{\rho_1}{\rho_0}=\frac{2\gamma+(\gamma+1)\beta}{2\gamma+(\gamma-1)\beta}}.
$$
Its weak-shock expansion is $1+\beta/\gamma-(\gamma-1)\beta^2/(2\gamma^2)+O(\beta^3)$, exactly the expansion of $(1+\beta)^{1/\gamma}$ through second order. Thus the adiabatic pressure-density relation agrees to order $\beta^2$; <entropy> production first affects this comparison at higher order. The same isentropic constant is not exactly preserved across a finite shock. The wording allows $\gamma=1$, but the printed enthalpy formula is then undefined. The compression calculation instead gives $W=(p_0/\rho_0)\rho\log(\rho/\rho_0)+C\rho$, and the <specific enthalpy> is $(p_0/\rho_0)[1+\log(\rho/\rho_0)]+C$. Thus the requested formula containing $1/(\gamma-1)$ requires $\gamma\ne1$; its physical ideal-gas application uses $\gamma>1$.