Find the standard matrix of a transformation

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!

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}.$$

• Why is the first row, second column the one that is positive rather than second row second column? We are first supposed to reflect, correct? If so, $-sin(x)$ will be in the second row second column I believe? Jun 6, 2021 at 23:23
• Because it's the matrix$$\begin{bmatrix}\cos\left(\frac{5\pi}4\right)&-\sin\left(\frac{5\pi}4\right)\\\sin\left(\frac{5\pi}4\right)&\cos\left(\frac{5\pi}4\right)\end{bmatrix}.$$ Jun 7, 2021 at 6:15
• No, I am not reflecting first. The matrix that I wrote is the matrix of a counterclockwise rotation around the origin with angle $\frac{5\pi}4$. After having computed that matrix, I multiply it by the matrix corresponding to the reflection. Jun 7, 2021 at 13:35
• In this problem, it is stated that the first transformation is the reflection. In that other problem, the reflection is the second transformation. Jun 7, 2021 at 21:57
• At no point I wrote that I first take the counterclockwise rotation and then the reflection. Take a look at my answer. I computed the matrix $R$ corresponding to the reflection, I computed the matrix $O$ corresponding to the counterclockwise rotation and then I wrote that the answer is $O.R$. By this order. The matrix $R$ is on the right since it is the first operation and the matrix $R$ is on the left since it is the second operation. The operations are written from the right to the left. Jun 14, 2021 at 2:19