# Orthogonal basis for $P_{2}(\mathbb{R})$

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?

-
I did a number of edits to improve the $\TeX$ usage, and one of those was that I wrote $\langle a,b \rangle$ where you had $<a,b>$. $\TeX$ is sophisticated. – Michael Hardy Apr 25 '12 at 17:40
Sweet, Thanks!! – adaptive Apr 25 '12 at 17:42

You forgot to plug in the values after integrating. Note that:

$$\int_0^1 x\,dx=\frac{1}{2}$$

and

$$\int_0^1 1\,dx=1$$

After these modifications you're done.

-
hmm, Thanks! Sorry, my calculus is very rusty. Is there ever a point where $\int x dx = \frac{x^2}{2}$? And is $\int_{0}^{1} x^2 dx = \frac{1}{3}$? – adaptive Apr 25 '12 at 17:40
If you have indefinite integral, then $\int xdx=\frac{x^{2}}{2}+C$, where $C$ is a constant. And yes to second question. Step by step it comes as: $\int_{0}^{1}x^{2}dx=/_{0}^{1}\frac{1}{3}x^{3}=\frac{1}{3}-0=\frac{1}{3}$. – T. Eskin Apr 25 '12 at 17:43
Any good resource (cheat sheet maybe?) I can use to refresh on this stuff (Integration and differentiation). I'm trying to remember this stuff 10 years later. – adaptive Apr 25 '12 at 17:45
There are some good free online integration tutor materials if you google, and most definitely some excellent textbooks available too. Too bad I learned these things from textbooks of my native language (which isn't English), so I don't know any books of this topic to recommend. :/ – T. Eskin Apr 25 '12 at 17:57