# Gram Schmidt process for defined polynomials

I would like to know whether I have made mistakes in this Gram-Schmidt process as I kept getting mixed up with the vectors.

Using the vector space $$P_1$$ defined by the inner product

$$ = ∫_{-1}^1 p(x)q(x)dx$$ Find an orthonormal basis {$$e_1, e_2$$} using the Gram-Schmidt process for the set of vectors $$u_1 = 1+ x$$ $$u_2 = 1 + 3x$$

Using the process

$$v_1 = u_1 = 1 + x$$

$$v_2 = u_2 - \frac{}{||v_1||^2}v_1$$ $$= \frac{<1 + x, 1 + 3x>}{<1 + x, 1 + x>}(1 + x)$$

$$= \frac{4}{8/3}(1 + x)$$ $$= \frac{3}{2}(1 + x)$$ $$= \frac{3}{2} + \frac{3}{2}x$$

Now,

$$1 + 3x - \frac{3}{2} + \frac{3}{2}x$$ results in $$\frac{-1}{2} + \frac{9}{2}x$$

Thus, the orthogonal basis is $$(1 + x, \frac{-1}{2} + \frac{9}{2}x)$$

The orthonormal basis would then be $$e_1 = \frac{v_1}{||v_1||} e_2 = \frac{v_2}{||v_2||}$$

$$e_1 = \frac{1 + x}{\sqrt8/3}$$

$$e_2 = \frac{-1/2 + 9x/2}{\sqrt14}$$ which appears to be rather messy. So, what did I do wrong?

You have made a mistake while subtracting $$(1+3x)$$ and $$\frac32+\frac32x$$. The result is $$v_2=-\frac12+\frac32x$$ which is orthogonal to $$v_1$$.