# Gram Schmidt Process involving integrals

Apply the Gram Schmidt Process to basis $B = \{1,x,x^2\}$ of all polynomials of degree at most $2$ with respect to the following inner product space to obtain an orthonormal basis:

$$\langle p(x), q(x) \rangle = \int_{-1}^{1} p(x)q(x)dx$$

• I've been doing problems like this but I never realized that the process was being applied to specific inner product spaces and this confused me.

• Does this question alter the Gram Schmidt process from the general algorithim on: https://www.wikiwand.com/en/Gram%E2%80%93Schmidt_process ?

Start with $1$, and normalized it so that $\|\alpha 1\|=1$. So, $$p_0 = \left(\frac{1}{\sqrt{2}}\right)1.$$ Next, take $x$ and subtract the projection of $x$ onto $p_0$: $$x - (x,p_0)p_0 = x -\left(\frac{1}{2}\int_{-1}^{1}xdx\right)1 = x.$$ Then normalize to obtain $$p_1 = \frac{1}{(x,x)^{1/2}}x=\frac{1}{\left(\frac{x^3}{3}|_{x=-1}^{x=1}\right)^{1/2}}x=\sqrt{\frac{3}{2}}x$$ Finally, start with $x^2$ and subtract the components along $p_0$ and $p_1$: $$x^2 - (x^2,p_1)p_1 - (x^2,p_0)p_0 \\ = x^2 - \left(\int_{-1}^{1}t^2 \sqrt{\frac{3}{2}}tdt\right)\sqrt{\frac{3}{2}}x - \left(\int_{-1}^{1}t^2\frac{1}{\sqrt{2}}dt\right)\frac{1}{\sqrt{2}} \\ = x^2 - \left(\left.\frac{3}{2}\frac{t^4}{4}\right|_{t=-1}^{1}\right)x-\left(\left.\frac{1}{2}\frac{t^3}{3}\right|_{t=-1}^{1}\right)1 = x^2 - \frac{1}{3}$$ Then normalize \begin{align} p_2 & = \frac{1}{(x^2-1/3,x^2-1/3)^{1/2}}(x^2-1/3) \\ & = \frac{1}{\left(\int_{-1}^{1}(t^2-1/3)^2dt\right)^{1/2}}(x^2-1/3) \end{align}

Fundamentally, the Gram Schmidt can be applied to all finite dimensional inner product spaces (it can also be applied to a specific variety of infinite dimensional spaces vector spaces, but lets ignore that for now). You just apply the algorithm.

However, finite dimensional methods on vector spaces never turn out to be too' general, for we are always working in some version of $\mathbf{R}^n$ -- in this case, a version of $\mathbf{R}^3$ with an inner product

$$\langle (x,y,z), (a,b,c) \rangle = 2xa + \frac{2}{3}(xc + yb + za) + \frac{2}{5}zc$$

The Gram Schmidt process says that, even if we allow ourselves to work in a general inner product space, we can always choose a basis $x_1, \dots, x_n$ such that there is a map $f: \mathbf{R}^n \to \mathbf{R}^n$, defined by

$$f(\sum a_ix_i) = \sum a_ie_i$$

such that

$$\langle v, w \rangle = f(v) \cdot f(w)$$

So all inner products spaces are really' just $\mathbf{R}^n$ with the dot product. Thus when you are trying to find an orthonormal basis in a vector space $V$, you are really just trying to recover the normal basis $e_1, \dots, e_n$ on $\mathbf{R}^n$, after forgetting where these elements are.