The choice of inner product defines the notion of orthogonality.
The usual notion of being "perpendicular" depends on the notion of "angle" which turns out to depend on the notion of "dot product".
If you change the way we measure the "dot product" to give a more general inner product then we change what we mean by "angle", and so have a new notion of being "perpendicular", which in general we call orthogonality.
So when you apply the Gram-Schmidt procedure to these vectors you will NOT necessarily get vectors that are perpendicular in the usual sense (their dot product might not be $0$).
Let's apply the procedure.
It says that to get an orthogonal basis we start with one of the vectors, say $u_1 = (-1,1,0)$ as the first element of our new basis.
Then we do the following calculation to get the second vector in our new basis:
$u_2 = v_2 - \frac{\langle v_2, u_1\rangle}{\langle u_1, u_1\rangle} u_1$
where $v_2 = (-1,1,2)$.
Now $\langle v_2, u_1\rangle = 3$ and $\langle u_1, u_1\rangle = 3$ so that we are given:
$u_2 = v_2 - u_1 = (0,0,2)$.
So your basis is correct. Let's check that these vectors are indeed orthogonal. Remember, this is with respect to our new inner product. We find that:
$\langle u_1, u_2\rangle = 3(-1)(0) + (1)(0) + 2(0)(2) = 0$
(here we also happened to get a basis that is perpendicular in the traditional sense, this was lucky).
Now is the basis orthonormal? (in other words, are these unit vectors?). No they arent, so to get an orthonormal basis we must divide each by its length. Now this is not the length in the usual sense of the word, because yet again this is something that depends on the inner product you use. The usual Pythagorean way of finding the length of a vector is:
$||x||=\sqrt{x_1^2 + ... + x_n^2} = \sqrt{x . x}$
It is just the square root of the dot product with itself. So with more general inner products we can define a "length" via:
$||x|| = \sqrt{\langle x,x\rangle}$.
With this length we see that:
$||u_1|| = \sqrt{2(-1)(-1) + (1)(1) + 3(0)(0)} = \sqrt{3}$
$||u_2|| = \sqrt{2(0)(0) + (0)(0) + 3(2)(2)} = 2\sqrt{3}$
(notice how these are different to what you would usually get using the Pythagorean way).
Thus an orthonormal basis is given by:
$\{\frac{u_1}{||u_1||}, \frac{u_2}{||u_2||}\} = \{(\frac{-1}{\sqrt{3}}, \frac{1}{\sqrt{3}}, 0), (0,0,\frac{1}{\sqrt{3}})\}$
The standard method of orthogonalisation works like this:
1) take a basis $\{a_n\}$
2) take first vector $a_1$ , normalise it, call it the first vector in the new basis: $$b_1:=\frac{a_1}{\sqrt{\langle a_1,a_1\rangle}}.$$
3) take second vector $a_2$, find its component orthogonal to the first vector in the new basis: $$a'_2=a_2- \langle a_2,b_1\rangle b_1 ,$$ normalise it, then call it the second vector in the new basis:
$$b_2:=\frac{a'_2}{\sqrt{\langle a'_2,a'_2\rangle}}.$$
4) repeat for all consecutive vectors - orthogonalisation comes for all previous vectors in new basis: $$a_k'=a_k- \sum_{j=1}^{k-1} \langle a_k,b_j\rangle b_j,\quad b_k= \frac{a_k'}{\sqrt{\langle a_k',a_k'\rangle}}.$$
So, let's take a canonical basis in $P_2[x]$: $\{1,x,x^2\}$.
First vector is $1$. It's norm with respect to our inner product is $2\int_0^11\cdot 1dx =2$, hence the first vector in the new basis is $b_1=\frac{1}{\sqrt 2}$.
Second vector is $x$. The orthogonalisation yields $$x- \langle x,1/\sqrt 2\rangle 1/\sqrt 2= x-\frac{1}{\sqrt 2}\cdot2\int_0^1\frac{x}{\sqrt 2}dx =x-\frac 12.$$
Can you now normalise it (i.e. find the second vector in the new basis) and then find the third vector in the new basis?
Best Answer
Start by finding three vectors, each of which is orthogonal to two of the given basis vectors and then try and find a matrix $A$ which transforms each basis vector into the vector you've found orthogonal to the other two. This matrix gives you the inner product.
I would first work out the matrix representation $A'$ of the inner product with respect to the given basis, because then the columns of $A'$ are just the vectors that you've already found (since you want to transform each basis element into each of these vectors). It is important that you express the vectors you've found in terms of the basis given, and not the standard basis for this part.
Once you've done this, we can relate $A$ and $A'$ by $A = P^{\dagger}A'P$ where $P$ is the change of basis matrix from the given basis to the standard basis.