  Working in relativistic quantum field theory, we derive the quantization
condition satisfied by coupled two- and three-particle systems of identical
scalar particles confined to a cubic spatial volume with periodicity $L$. This
gives the relation between the finite-volume spectrum and the infinite-volume
$\textbf 2 \to \textbf 2$, $\textbf 2 \to \textbf 3$ and $\textbf 3 \to \textbf
3$ scattering amplitudes for such theories. The result holds for relativistic
systems composed of scalar particles with nonzero mass $m$, whose center of
mass energy lies below the four-particle threshold, and for which the
two-particle $K$ matrix has no singularities below the three-particle
threshold. The quantization condition is exact up to corrections of the order
$\mathcal{O}(e^{-mL})$ and holds for any choice of total momenta satisfying the
boundary conditions.
