I assume that $W$ is meant to be the space of polynomials of degree at most 2, and with a root at 1. Is that right?
To find a basis, consider the fundamental theorem of algebra. The elements of $W$ must all have $(x-1)$ as a factor. Consider the monomial $u=(x-1)$, and construct a basis from there that is analogous to the usual basis (which would be an excellent basis for constructing the space of polynomials with a root at zero).
For your second question, once you have found a basis, you just use the Gramm-Schmidt process. Just remember that the projection of $\mathbf{v}$ onto the one dimensional vector space spanned by the unit vector $\mathbf{u}$ is just $$\langle \mathbf{u},\mathbf{v}\rangle \mathbf{u}$$
The vector $$\mathbf{v}'=\mathbf{v}-\langle \mathbf{u},\mathbf{v}\rangle \mathbf{u}$$ (often called the error term) is therefore orthogonal to $\mathbf{u}$, so $\{\mathbf{v}',\mathbf{u}\}$ is an orthogonal basis for the space $\textrm{Span}(\mathbf{u},\mathbf{v})$.
To project $\mathbf{w}$ onto the two dimensional space $\textrm{Span}(\mathbf{u},\mathbf{v})$, just take the sum of the projections of $\mathbf{w}$ onto the orthogonal basis vectors $\mathbf{u}$ and $\mathbf{v}$.
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
Let $p(x)=x^4+ax^3+bx^2+cx+d$.
Thus, $$16+8a+4b+2c+d=0$$ and $$6\cdot9+3a\cdot3+b=0,$$ which gives $$b=-54-9a,$$ $$d=200+24a-2c$$ and $$p(x)=x^4-54x^2+200+a(x^3-9x^2+24)+c(x-2).$$