How can I rewrite this expression? $A=\begin{pmatrix}3&-1\\-1&1\end{pmatrix}$; $U_\phi=\begin{pmatrix}\cos\phi&-\sin\phi\\\sin\phi&\cos\phi\end{pmatrix}$; $B=U_{-\phi}AU_\phi=\begin{pmatrix}\lambda&0\\0&\mu\end{pmatrix}$
I calculated that B can be written in terms of $U_\phi$ and $A$ if I set $\phi=\frac{\pi\cdot n}{2}-\frac{\pi}{8}$ and I was wondering if there is any way to somehow reverse or rearrange this equation to write $A$ in terms of $B$ and $U_\phi$. Is there any straightforward way similar to rearranging equations like $yx^2+2y+2yx=x$ where I would just solve for $x$ or $y$?
 A: We note that your rotation matrix, $\mathbf{U}_{\phi}$, is a orthogonal matrix, that is:
$$\mathbf{U}_{\phi}^{-1}=\mathbf{U}_{\phi}^{T}$$
Where $\mathbf{U}_{\phi}^{-1}$ is the inverse of $\mathbf{U}_{\phi}$, satisfying: $\mathbf{U}_{\phi}^{-1}\mathbf{U}_{\phi}=\mathbf{U}_{\phi}\mathbf{U}_{\phi}^{-1}=\mathbf{I}_{2\times 2}$ and $\mathbf{U}_{\phi}^{T}$ is the transpose of $\mathbf{U}_{\phi}$. 
We also note that:
$$\mathbf{U}_{-\phi} = \mathbf{U}_{\phi}^{T}=\mathbf{U}_{\phi}^{-1}$$
Therefore, if we have an equation like yours:
$$\mathbf{B}=\mathbf{U}_{-\phi}\mathbf{A}\mathbf{U}_{\phi}$$
We can isolate $\mathbf{A}$, by postmultiplying both sides by $\mathbf{U}_{\phi}^{-1} = \mathbf{U}_{-\phi}$ and then premultiplying by $\mathbf{U}_{-\phi}^{-1}=\mathbf{U}_{\phi}$:
$$\mathbf{U}_{\phi}\mathbf{B}\mathbf{U}_{-\phi}=\mathbf{A}$$
A: Well, based upon the matrices that you have shown, I would say this:
$$\det \left [ \begin{array}{ccc}
3 & -1 \\ -1 & 1
\end{array} \right ]=3+1=4 \neq 0$$
$$\det \left [ \begin{array}{ccc}
\cos \phi & -\sin \phi \\ \sin \phi & \cos \phi
\end{array} \right ]=\cos^2 \phi +\sin^2 \phi=1 \neq 0$$
$$\det \left [ \begin{array}{ccc}
\lambda & 0 \\ 0 & \mu
\end{array} \right ]=\lambda\mu-0=\lambda\mu \neq 0 \iff\lambda\neq0 \land \mu \neq 0$$
If the middle one above holds, then we know that the $U_\phi$ matrix is invertible (meaning that $C\times C^{-1}=I$. Going on that assumption from now on, we can solve for $A$. You gave the following relation:
$$B=U_{-\phi}AU_{\phi}$$
Left multiply by: $U_{-\phi}^{-1}$
$$U_{-\phi}^{-1}B=U_{-\phi}^{-1}U_{-\phi}AU_{\phi}$$
Right-multiply by $U_{\phi}^{-1}$
$$U_{-\phi}^{-1}BU_{\phi}^{-1}=U_{-\phi}^{-1}U_{-\phi}AU_{\phi}U_{\phi}^{-1}$$
Clear out the identities.
$$U_{-\phi}^{-1}BU_{\phi}^{-1}=A$$
