Solution (source code)

= Solution

All the transformations below fix the origin. A <planar rotation> preserves lengths and angles and turns every vector through one common oriented angle. Its <rotation matrix> is
$$
R_\theta=\begin{pmatrix}\cos\theta&-\sin\theta\\\sin\theta&\cos\theta\end{pmatrix}.
$$
An <orthogonal reflection> in a line fixes that line and reverses its perpendicular direction; reflection in the horizontal axis has <reflection matrix> $\operatorname{diag}(1,-1)$. A <uniform dilation> multiplies every vector by the same positive scale $s$, represented by $sI$; for example $2I$ doubles lengths. A <shear mapping> fixes one line pointwise and shifts vectors parallel to that line by an amount proportional to their transverse coordinate. A horizontal <shear mapping> has matrix
$$
S_k=\begin{pmatrix}1&k\\0&1\end{pmatrix},\qquad (x,y)\longmapsto(x+ky,y),
$$
with $S_1$ a nontrivial example.

The first given matrix is \b[the clockwise <planar rotation> through $\pi/4$], namely $A=R_{-\pi/4}$. Direct multiplication gives
$$
\boxed{C=AB=\begin{pmatrix}1&2\\0&1\end{pmatrix}=S_2.}
$$
Thus \b[$C$ is a horizontal <shear mapping> of strength $2$]. Because $A^{-1}=R_{\pi/4}$,
$$
\boxed{B=R_{\pi/4}S_2.}
$$
So \b[$B$ is the composition of that <shear mapping> followed by an anticlockwise <planar rotation> through $\pi/4$]; order matters. It is not individually one of the four elementary types under these definitions. In particular, its <determinant> is $1$, but it is not an <orthogonal matrix>, excluding both a <planar rotation> and an <orthogonal reflection>. It is not a scalar matrix, excluding a <uniform dilation>; its <eigenvalues> $\sqrt2+1$ and $\sqrt2-1$ exclude a pure <shear mapping>, whose <eigenvalues> are both $1$. As a symmetric <positive-definite matrix>, $B$ can also be described as stretching two perpendicular principal directions by these reciprocal factors, preserving area.