Orthgonal complement of $U=\{X\in M_2(\mathbb R): X=\left(\begin{array}{cc} a+2b&a-b\\ b&a \end{array}\right), a, b\in\mathbb R\}?$ Let $M_2(\mathbb R)$ endowed with the inner product $\langle A, B\rangle=\textrm{tr}(B^TA)$. What would be an easy way to find the orthogonal complement of $$U=\{X\in M_2(\mathbb R): X=\left(\begin{array}{cc}
a+2b&a-b\\ b&a
\end{array}\right), a, b\in\mathbb R\}?$$ Thanks.
 A: You can check that $U$ is a linear subspace of $M_2(\mathbb R)$ with basis
$T=\left(\begin{array}{cc}
1&1\\ 0&1
\end{array}\right) $ and $Q=\left(\begin{array}{cc}
2&-1\\ 1&0
\end{array}\right)$. It has dimension 2; its complement $U^\sharp$ in $M_2(\mathbb R^2)$ has also dimension $2$.
Take any $X=\left(\begin{array}{cc}
x&y\\ z&w
\end{array}\right)$ in   $M_2(\mathbb R)$; then
$$\langle X,T\rangle=\langle X,Q\rangle=0$$
implies  $X=\left(\begin{array}{cc}
-\frac{1}{3}(w+y)&y&
\\  -\frac{2}{3}w+\frac{1}{3}y&w
\end{array}\right),$ for all $w,y\in\mathbb R$. 
A: $\langle A, B\rangle=\textrm{tr}(B^TA)$ is actually the usual dot product of $\operatorname{vec}(A)$ and $\operatorname{vec}(B)$ (the operation $\operatorname{vec}\pmatrix{x&z\\ y&w}$ means the vector $(x,y,z,w)^T$; for more, see vectorisation on Wikipedia). So, the problem boils down to finding the orthogonal complement of the subspace $\{a(1,0,1,1)^T+b(2,1,-1,0)^T\}$. Since each of the two basis vectors contains a zero entry, we see that the first and third entries are free variables and the second and fourth are dependent variables. Hence the orthogonal complement is given by $\{(x,z-2x,z,-x-z)^T\}$. Converting this back to a matrix form, the answer is
$U^\perp=\left\{\pmatrix{x&z\\ z-2x&-x-z}:x,z\in\mathbb{R}\right\}$.
