Consider $P_{2}(\mathbb{R})$ together with inner product:
$\langle p(x), q(x)\rangle = \int_{0}^{1} p(x)q(x) \, dx$
I am trying to come up with an orthogonal basis with respect to this inner product for
$p(x) = a + bx + cx^2$
Let $\alpha = \{ 1, x, x^2 \}$ standard basis for $P_{2}(\mathbb{R})$
Using the Gram-Schmidt process:
Let $v_1 = \alpha_1 = 1$
Let
$v_{2} = \alpha_{2} - P_{v_{1}}(\alpha_{2}) = \alpha_{2} - \frac{\langle\alpha_{2},v_{1}\rangle}{\langle v_{1}, v_{1}\rangle} \cdot v_{1} = x - \frac{\langle x, 1\rangle}{\langle 1,1\rangle} \cdot 1$
Since $\langle p(x), q(x)\rangle = \int_0^1 p(x)q(x) \, dx$,
$\langle x, 1\rangle = \int_0^1 x \cdot 1 \, dx = \int_0^1 x \, dx = \frac{x^2}{2}$
$\langle 1, 1\rangle = \int_0^1 1 \cdot 1 \, dx = \int_0^1 1 \, dx = x$
$\Rightarrow v_{2} = x - \frac{x^2}{2} \cdot \frac{1}{x} \cdot 1 = x - \frac{x}{2}$
I'm positive this is not correct, as the answer should be $v_2 = x - \frac{1}{2}$
What am I doing wrong?