Find the standard matrix of a transformation

linear algebralinear-transformations

Let
$M:\mathbb{R}^2\ \rightarrow\mathbb{R}^2$ be the linear transformation that first reflects it through the line $x_1=x_{2}$, and then rotates each point counterclockwise around the origin by
$\frac{5 \pi}{4}$ radians.

Find the standard matrix of $M$

So I was thinking, since it's the line $x_1 = x_2$, looking at it graphically, I would have

$$\begin{pmatrix}
cos(x)&-sin(x)\\
sin(x)&cos(x)\\
\end{pmatrix}$$

which then becomes

$$\begin{pmatrix}
sin(x)&cos(x)\\
cos(x)&-sin(x)\\
\end{pmatrix}$$

which then becomes (using $x = \frac{5\pi}{4}$)
$$\begin{pmatrix}
-\frac{\sqrt{2}}{2}&-\frac{\sqrt{2}}{2}\\
-\frac{\sqrt{2}}{2}&\frac{\sqrt{2}}{2}\\
\end{pmatrix}$$

But that's the wrong answer. Would really appreciate some help with these, I don't fully understand how to algebraically find / convert these reflections yet.

Thanks!

Best Answer

The reflection through the line $x_1=x_2$ maps $\left(1,1\right)$ into itself and it maps $\left(-1,1\right)$ into $\left(1,-1\right)$. So, its matrix with respect to the standard basis is $\left[\begin{smallmatrix}0&1\\1&0\end{smallmatrix}\right]$. And the matrix of a counterclockwise rotation around the origin with angle $\frac{5\pi}4$ is$$\begin{bmatrix}-\frac1{\sqrt2}&\frac1{\sqrt2}\\-\frac1{\sqrt2}&-\frac1{\sqrt2}\end{bmatrix}.$$So, take$$\begin{bmatrix}-\frac1{\sqrt2}&\frac1{\sqrt2}\\-\frac1{\sqrt2}&-\frac1{\sqrt2}\end{bmatrix}.\begin{bmatrix}0&1\\1&0\end{bmatrix}=\begin{bmatrix}\frac1{\sqrt2}&-\frac1{\sqrt2}\\-\frac1{\sqrt2}&-\frac1{\sqrt2}\end{bmatrix}.$$