Sound wave velocity:
$$
v_s = \sqrt{\frac{B}{\rho}};\tag{1}
$$
where $\rho$ the mass density of medium, $B$ is the boulk modulous defined as ratio of pressure change $\Delta P$ with percentage change of volume ($\frac{\Delta V}{V}$)
$$
B = -\frac{\Delta P }{\Delta V / V} = -V\frac{d P}{d V}.
$$
Assume the area of the cross-section of propagation is $A$, and $V= A dx$, the volume unit without deformation. The deformation $\Delta V = A \Delta s$, $s$ is the disantace displacement.
$$
\Delta P (x) = B \frac{\Delta V}{V}\big\vert_x = B\frac{\partial \Delta s}{\partial x}.\tag{2}
$$
Sinusoidal equation for displacement:
$$
\Delta s(x, t) = \Delta s_0 \sin (kx-\omega t). \tag{3}
$$
where angular frequecy $\omega = 2\pi f = k v_s$.
Using Eq.(2) converting displacement $\Delta s(x,t)$ to pressure deviation
$\Delta P(x,t)$
\begin{align}
\Delta P(x,t) &=B\frac{\partial \Delta s}{\partial x} \\
&= B k\Delta s_0 \cos k(x-vt).
\end{align}
The work done per wave length $F = A\Delta P$:
\begin{align}
W &= \int_{0}^{\frac{2\pi}{k}} F d\Delta s \\
&= \int_{0}^{\frac{2\pi}{k}} A B k\Delta s_0 \cos (kx-\omega t) k\Delta s_0 \cos (kx-\omega t) dx\\
&=A B k^2 \Delta s_0^2 \int_{0}^{\frac{2\pi}{k}} \cos^2 (kx-\omega t) dx\\
&= \frac{\pi}{k} A B k^2 \Delta s_0^2
\end{align}
Intensity (period $T =\frac{2\pi}{\omega}$, $B = \rho\,v_s^2$, and $v_s = \frac{\omega}{k}$ )
\begin{align}
I &= \frac{W}{A T} =\frac{\pi}{k}\frac{ B k^2 \Delta s_0^2}{2\pi/\omega}\\
&= \frac{1}{2} \rho v_s^2 k \omega \Delta s_0^2 \\
&=\frac{1}{2} \rho v_s \omega^2 \Delta s_0^2\\
&=2\pi^2 \,\rho\, v_s f^2 \Delta s_0^2
\end{align}
In the last equation, $\omega$ is replaced by frequency $\omega = 2\pi f$.