Solution (source code)

= Solution

With the convention $\widetilde p=\operatorname{Re}(\widehat p e^{i\omega t})$, a wave travelling in the positive $x$-direction has
$$
\boxed{\widehat p(x)=P e^{-ikx},\qquad k=\omega/c_0}.
$$
The linearized momentum equation gives
$$
\boxed{\widetilde u=\frac{\widetilde p}{\rho_0c_0}}
$$
for this right-moving wave; the sign is reversed for a left-moving wave.