Solution (source code)

= Solution

For the collinear boosts specified in the question, multiplication of the two $2$-by-$2$ blocks and the hyperbolic addition formulas give
$$
\begin{pmatrix}\cosh\theta&\sinh\theta\\\sinh\theta&\cosh\theta\end{pmatrix}
\begin{pmatrix}\cosh\theta'&\sinh\theta'\\\sinh\theta'&\cosh\theta'\end{pmatrix}
=\begin{pmatrix}\cosh(\theta+\theta')&\sinh(\theta+\theta')\\\sinh(\theta+\theta')&\cosh(\theta+\theta')\end{pmatrix}.
$$
Thus the resulting <rapidity> is $\boxed{\theta''=\theta+\theta'}$. Collinearity matters: boosts in different spatial directions do not in general combine into a pure boost of this form.