The polynomial $1$ is obviously just $p_1$.
The polynomial $x$ is almost $p_2$, except $p_2$ has that constant $-\frac{1}{2}$. We want to get rid of that constant. Well, $p_1$ is also constant, so we can use that: scale $p_1$ so that it exactly matches the constant term we're trying to get rid of (but opposite sign), then add it. This gives $x=\frac{1}{2}p_1+p_2$.
But now what about $x^2$? Well, $x^2$ is almost $p_3+p_2$, except again, the constant term isn't quite right. So... using the above as an example, how do we correct the constant term to get $x^2$ in terms of this basis?
EDIT: I overlooked the bit about using orthogonality. Apologies. Here's a solution using orthogonality that's much more general than this specific circumstance:
There is a nice result (that you presumably have seen if this problem has been assigned) that says given an orthogonal basis $\{v_1,\ldots,v_n\}$ for a vector space with inner product $\langle\cdot, \cdot\rangle$, any vector $u$ in the space can be writen $u=\frac{\langle u, v_1\rangle}{|v_1|^2}\,v_1+\cdots+\frac{\langle u, v_n\rangle}{|v_n|^2}\,v_n\,.$ So for this problem, the $p_i$'s are the $v_i$'s, and the polynomials $1$, $x$, and $x^2$ each play the role of $u$.
..
– 2012-10-21