TITLE: Does orthogonality of vectors depend on the chosen basis?
QUESTION [7 upvotes]: geometrically, two vectors are "orthogonal" if there is a right angle between them, which we intuitively understand.
Algebraically, the definition of "orthogonal" members of a  vector space, is that the dot product between the two vectors is zero. This means that for vectors $a,b$, it is the case that $\sum_{i=1}^na_i\cdot b_i=0$. 
However, these coordinates depend on the chosen basis. If we take the standard Cartesian coordinate system, the bases are what we would intuitively call "orthogonal". However, the dot product is defined on the coordinates given a certain basis. 
Does this mean that if we take a different basis, the vectors that are orthogonal will be different? For example,  in the space of polynomials of order 2, if we take the bases $i = x, j = x^2$, then for example $(1,-1)\cdot (x,x^2)$ and $(1,1)\cdot (x, x^2)$ will be orthogonal, but if we take $i=x+x^2, j= x-x^2$, then those vectors will not be orthogonal.
Am I misunderstanding something here?

REPLY [4 votes]: As has been pointed out by others, you don't need a basis to define orthogonality -- you just need an inner product, which is an abstract version of the "dot product".
However, having said that, it is true that if you have a basis, you can use that basis to define an inner product via the usual dot product -- and in that setting your question is a perfectly reasonable one.
So let me restate your question.  Suppose you have a ($n$-dimensional) vector space $V$ with a basis $\mathcal{B}_1$.  With respect to that basis, any vectors can be represented as $n$-tuples.  Then you can define a dot product relative to that basis in the usual way, and relative to that dot product, some pairs of vectors will be orthogonal to one another.
Now change to a different basis, $\mathcal{B}_2$.  With respect to this new basis, every vector has a different representation as an $n$-tuple.  Relative to this second basis, we can define a different dot product, and relative to that new dot product, some pairs of vectors will be orthogonal to one another.
Your question is:  Are the vectors that are orthogonal to one another relative to basis $\mathcal{B}_1$ also orthogonal to one another relative to basis $\mathcal{B}_2$?
(For those who insist that this is really a question about inner products, and that you don't need a basis to talk about an inner product, please note that the question is really about two different inner products on the same space, each one induced by a choice of basis.  So the question can be reframed more abstractly as: when do two bases induce the same inner product?)
The answer is:  In general, no.  However, there is a specific set of conditions under which the answer is yes.  That condition is:

If the vectors in $\mathcal{B}_2$ are orthonormal  relative to the dot product define by $\mathcal{B}_1$, then orthogonality is preserved when changing basis.

Actually a more general property is true:  if the vectors in $\mathcal{B}_2$ are orthonormal to one another relative to the dot product define by $\mathcal{B}_1$, then all dot products are preserved when changing basis.
Note that this condition is symmetric, because if the vectors in $\mathcal{B}_2$ are orthonormal to one another relative to the dot product define by $\mathcal{B}_1$, then also the vectors in $\mathcal{B}_1$ will be orthonormal to one another relative to the dot product define by $\mathcal{B}_2$.
Equivalently, you can express this condition in terms of the change of basis matrix $M$:  We need the columns of $M$ to be an orthonormal set.  This, in turn, can also be expressed as the condition $M^TM = I$.  Matrices satisfying this condition are called orthogonal matrices.  (A better terminology would probably be to call them orthonormal matrices, but unfortunately the terminology is standard.)
Here is a simple proof of why this condition is the one you need.  Let $v,w$ be any two vectors in $V$.  Relative to the basis $\mathcal{B}_1$, they can be represented as column vectors $\bf{v}_1$, $\bf{w}_1$, and the dot product is just given by $\bf{v}^T_1 \bf{w}_1$, where $T$ indicates matrix transposition and the product is just matrix multiplication.  Similarly, relative to the basis $\mathcal{B}_2$, $v$ and $w$ can be represented as (different!) column vectors $\bf{v}_2$, $\bf{w}_2$, and the dot product is just given by $\bf{v}^T_2 \bf{w}_2$.
Now, the connection between these two representations is expressed by $\bf{v}_2 = \bf{M} \bf{v_1}$ and  $\bf{w}_2 = \bf{M} \bf{w_1}$, where $\bf{M}$ is the change-of-basis matrix.  Therefore we have:
$$\begin{align}  \bf{v}^T_2 \bf{w}_2 &= \left(\bf{Mv_1} \right)^T \bf{Mw_1} \\
&= \bf{v}^T_1 \bf{M}^T\bf{M} \bf{w}_1\\
&= \bf{v}^T_1 \left(\bf{M}^T\bf{M}\right) \bf{w}_1
\end{align}$$
so if the matrix $\bf{M}$ is orthogonal — that is, if $\bf{M}^T\bf{M}=\bf{I}$ — then we have $\bf{v}^T_2 \bf{w}_2 =\bf{v}^T_1 \bf{w}_1$, which shows that the dot product relative to the second basis produces the same value as the dot product relative to the first basis, and in particular that orthogonality is preserved when the basis is changed.