Gram-Schmidt and inner product space for polynomials

54 Views Asked by At

Working on the following exercise: "$(f, g, h)$ is the basis of the polynomial space $P^2$ (so that $p_0 = 1, p_1 = x, p_2 = x^2$). If $f(x) = 2, g(x) = x^2 - x, h(x) = 3x$, use Gram-Schmidt's method to find an orthonormal basis (u, v, w) for the polynomial space $P^2$. Inner product is defined as $\langle \cdot, \cdot\rangle \colon P_n \times P_n \to \mathbb{R}$ with the formula $\langle p, q\rangle = a_n b_n + \cdots + a_1 b_1 + a_0 b_0$ for all $p,q\in P_n$."

I'm not sure I understood it correctly but here's my attempt at answering; am I using Gram-Schmidt right here? Never used it for anything but vectors before and our course models lack any guidelines on how to do it with polynomials.

$$u = \frac{f}{||f||} = \frac{2}{\sqrt{2\cdot2}} = 1$$ $$e_2 = g - \langle g, u\rangle u = (x^2 - x) - (0\cdot1 + (-1)\cdot0 + 2\cdot0)1 = x^2 - x$$ \begin{align*} v &= \frac{e_2}{||e_2||}\\ &= \frac{x^2 - x}{\sqrt{1\cdot 1 - 1\cdot (-1)}}\\ &= \frac{1}{\sqrt{2}} x^2 - \frac{1}{\sqrt{2}} x \end{align*}

\begin{align*}e_3 &= h - \langle h, v\rangle v - \langle h, u\rangle u\\ &= 3x - (\frac{1}{\sqrt{2}}\cdot 0 + 3 \cdot(- \frac{1}{\sqrt{2}}))(\frac{1}{\sqrt{2}}x^2 - \frac{1}{\sqrt{2}}x) - (0\cdot1 + (3)\cdot0)1\\ &= 3x - (- \frac{3}{\sqrt{2}})(\frac{1}{\sqrt{2}}x^2 - \frac{1}{\sqrt{2}}x) - 0\\ &= 3x + \frac{3}{2}x^2 - \frac{3}{2}x = \frac{3}{2}x^2 + \frac{3}{2}x\\ \end{align*}

\begin{align*}w &= \frac{e_3}{||e_3||}\\ &= \frac{\frac{3}{2}x^2 - \frac{3}{2}x}{\sqrt{2(\frac{3}{2})^2}}\\ &= \frac{\frac{3}{2}x^2 - \frac{3}{2}x}{\sqrt{\frac{9}{2}}}\\ &= \frac{\frac{3}{2}x^2 - \frac{3}{2}x}{\frac{3}{\sqrt{2}}}\\ &= \frac{\sqrt{2}}{2}x^2 - \frac{\sqrt{2}}{2}x\\ &= \frac{1}{\sqrt{2}}x^2 - \frac{1}{\sqrt{2}}x\\ \end{align*}

So the basis $\{u,v,w\} = \{1, \frac{1}{2}x^2 + 3\frac{1}{2}x, \frac{1}{\sqrt{2}}x^2 - \frac{1}{\sqrt{2}}x\}$.