TITLE: How to find the orthogonal complement of a subspace?
QUESTION [10 upvotes]: I am trying to understand how to find the orthogonal complement of a subspace $M$ of a vector space $V$. 
From my understanding, $M^\perp$ is also a subspace of $V$ where all its vectors are perpendicular (orthogonal) to the columns of $M$, which would mean that the dot product of those vectors with each column of $M$ is $0$.
However, how do I find the $M^\perp$ subspace, when $M = \{ \vec{x} \in \mathbb{R}:  2x_2 + 3x_1 = 0\}$? In general, if there's a general approach, how does one attempt to find $M^\perp$ of an arbitrary $M$?
From my understanding, in this case, $M$ is the set of vectors in a plane that satisfy that equation, where $x_1$ and $x_2$ should respectively be the first and second components of the vector $\vec{x}$.

REPLY [11 votes]: Orthogonal complement is defined as subspace $M^\perp = \{ v\in V\,|\, \langle v, m\rangle = 0,\forall m\in M\}$. This is really a subspace because of linearity of scalar product in the first argument. Also, it is easy to see that $M = (M^\perp)^\perp$ and that $M\dotplus M^\perp = V$ (in finite dimensional case).
So, in your example you have $$M = \{ (x,y)\in \mathbb R^2\,|\, 3x + 2y = 0\} = \{ (x,y)\in \mathbb R^2\,|\, \langle(x,y),(3,2)\rangle = 0\}$$
i.e. $M$ is orthogonal complement of subspace spanned by $(3,2)$. But, by $M = (M^\perp)^\perp$, we then have that $M^\perp = \operatorname{span}\{(3,2)\}$.
It would be overkill in this example, but in general if you can find basis for $M$, you can always find $M^\perp$. Let's say that $M=\operatorname{span}\{e_1,\ldots,e_m\}$. Then $$\langle x,e_i\rangle= 0,\quad i=1,\ldots,m$$ is a homogeneous system of $m$ linear equations which you can solve and solution subspace will be orthogonal complement.