On one side of the boundary (impedance \(Z_1\)) there is a pressure of \(p_i + p_r\). On the other side of the boundary (impedance \(Z_2\)) there is a pressure \(p_t\). Begin by noting that there cannot be any force at the boundary. That is, \(p_i + p_r = p_t\), or dividing by \(p_i\),
\begin{align}\label{lskfjls}\tag{i}
1 + R = T\,.
\end{align}
Also note that the particle velocity must be continuous at the boundary: \(u_i + u_r = u_t\). Using the plane wave impedance relation \(u= p/Z\), the above relation becomes
\begin{align*}
\frac{p_i}{Z_1} - \frac{p_r}{Z_1} &= \frac{p_t}{Z_2}\\
p_i - p_r &= \frac{Z_1}{Z_2} p_t
\end{align*}
Dividing the above equation by \(p_i\) gives
\begin{align}
1 - R &= \frac{Z_1}{Z_2} T \label{lksjfdlj}\tag{ii}
\end{align}
Combining equations (\ref{lskfjls}) and (\ref{lksjfdlj}) yields
\begin{align}\label{lksdfsff}\tag{iii}
T = \frac{2}{1+Z_1/Z_2}\,.
\end{align}
Combining equation (\ref{lksdfsff}) with equation (\ref{lskfjls}) gives
\begin{align}\label{lkref}\tag{iv}
R = \frac{1- Z_1/Z_2}{1+Z_1/Z_2}\,.
\end{align}
Equations (\ref{lksdfsff}) and (\ref{lkref}) make sense because they match the following limits:
When \(Z_1/Z_2 \to 0\), the incident wave experiences a rigid boundary, and an in-phase reflection and pressure doubling at boundary is expected. Indeed, equation (\ref{lkref}) goes to \(1\) while equation (\ref{lksdfsff}) goes to \(2\).
When \(Z_1/Z_2 \to \infty\) the incident wave experiences a pressure-release boundary, and an out-of-phase reflection and zero transmission at boundary is expected. Indeed, equation (\ref{lkref}) goes to \(-1\) while equation (\ref{lksdfsff}) goes to \(0\).
Finally, when \(Z_1/Z_2 = 1\), the incident wave does not experience a boundary, and no reflection and perfect transmission is expected. Indeed, equation (\ref{lkref}) goes to \(0\) and equation (\ref{lksdfsff}) goes to \(1\).