# Inner Product on the space $P_2$

I would just like some confirmation on a problem and a small hint when starting the next. The initial question is:

Show that $⟨p,q⟩=p(0)q(0)+p(1)q(1)+p(2)q(2)$ defines an inner product on the space $P_2$ of polynomials of degree at most 2.

Here's my solution.

$$\langle p,q \rangle = \langle (p(1),p(2),...,p(n)), (q(1),q(2),...,q(n))\rangle = \sum_{n=0}^\infty p(n)p(n)$$ For a degree 2 polynomial, this becomes $$\sum_{n=0}^2 p(n)p(n) = p(0)q(0)+p(1)q(1)+p(2)q(2)$$ Therefore, this defines the inner product on the space of $P_2$.

The next problem is:

Apply the Gram-Schmidt algorithm to the basis $\{1,x,x^2\}$ for $P_2$ to construct a basis $\{p_0,p_1,p_2 \}$ that is orthogonal with respect to the inner product of the previous problem.

I'm not sure how to approach this problem. If I could get a hint on how to set this up with respect to the inner product of the previous problem, I could figure the rest out easily enough.

Thank you.

• For the first problem, they want you to verify that the given product satisfies the inner product axioms. For the second one, you literally just follow the Gram-Schmidt algorithm starting with $\{1,x,x^2\}$. What exactly are you getting held up on? Are you familiar with the Gram-Schmidt algorithm? – Bobbie D Mar 6 '17 at 21:27
• @BobbieD, are you referring to the $\langle u,v \rangle = \langle v,u \rangle$, etc axioms? Those are the only ones I have available to me, I'm not sure how to apply them here. – NoVa Mar 6 '17 at 21:32
• @BobbieD For the second part, I'm not sure what they mean by "orthogonal with respect to the inner product of the previous problem." – NoVa Mar 6 '17 at 21:33
• Those are the ones. For instance, to prove the one axiom you mention, just note that for every $p,q\in P_2$: \begin{align}\langle p, q\rangle &= p(0)q(0) + p(1)q(1) + p(2)q(2) \\ &= q(0)p(0) + q(1)p(1) + q(2)p(2) \\ &= \langle q, p\rangle\end{align} – Bobbie D Mar 6 '17 at 21:34
• I'll write up an answer on problem 2. Give me a few minutes. – Bobbie D Mar 6 '17 at 21:39

## 1 Answer

How to perform the Gram-Schmidt algorithm:

Our new orthonormal basis will be $\{b_1, b_2, b_3\}$. But first let's just find an orthogonal basis $\{c_1, c_2, c_3\}$ and then we'll normalize it.

Start with $c_1 = 1$. OK, the first one was easy.

Now for $c_2$, we want to take the second basis vector in $\{1, x, x^2\}$ and subtract out its projection onto $c_1$:

\begin{align}c_2 &= x - \operatorname{proj}_{1}(x) \\ &= x - \frac{\langle 1,x\rangle}{\langle 1,1\rangle}1 \\ &= x - \frac{(1)(0) + (1)(1) + (1)(2)}{(1)(1)+(1)(1)+(1)(1)}1 \\ &= x - 1\end{align}

For $c_3$, we want to take $x^2$ and subtract out its projections onto $c_1$ and $c_2$:

\begin{align} c_3 &= x^2 - \operatorname{proj}_{x-1}(x^2) - \operatorname{proj}_{1}(x^2) \\ &= x^2 - \frac{\langle x-1,x^2\rangle}{\langle x-1,x-1\rangle}(x-1) - \frac{\langle 1,x^2\rangle}{\langle 1,1\rangle}1 \\ &= x^2 - \frac{(-1)(0) + (0)(1) + (1)(4)}{(-1)(-1) + (0)(0) + (1)(1)}(x-1) - \frac{(1)(0) + (1)(1) + (1)(4)}{(1)(1) + (1)(1) + (1)(1)}1\\ &= x^2 -2(x-1)-\frac 53 \\ &= x^2 - 2x +\frac 13 \end{align}

Now just normalize each of these by dividing each $c_i$ by $\sqrt{\langle c_i,c_i\rangle}$ to get your $b_i$'s and you're done.

• This helped a lot, thank you. One more question, though. For the integration involved with $\sqrt{\langle c_i, c_i \rangle}$, are the bounds from 0 to 2 because of $\langle p,q \rangle$ in the first problem? – NoVa Mar 6 '17 at 23:41
• @Kosta Why do you think there's an integration involved? Remember $\langle p,q\rangle$ is defined (in the exercise) as $p(0)q(0) + p(1)q(1) + p(2)q(2)$. So for instance \begin{align}\langle c_2, c_2\rangle &= \langle x-1, x-1\rangle \\ &= (0-1)(0-1)+(1-1)(1-1)+(2-1)(2-1) \\ &= 2\end{align} – Bobbie D Mar 7 '17 at 2:03
• That's just one particular inner product. We're using a different inner product in this exercise. In this exercise the inner product on $P_2$ is defined to be $\langle p, q\rangle = p(0)q(0) + p(1)q(1) + p(2)q(2)$. There are infinitely many inner products. This is the one we care about in this exercise. – Bobbie D Mar 7 '17 at 2:11
• It should always be specified which inner product you're using -- except sometimes for $\Bbb R^n$ where if it's not specified it means $$\langle (x_1,\dots, x_n),(y_1,\dots, y_n)\rangle = \sum_{i=1}^n x_iy_i$$ as that is the so called "standard inner product" on $\Bbb R^n$. But in every other case someone has to tell you which inner product you're supposed to use (or of course if you're working on your own problem then use whichever is most convenient). – Bobbie D Mar 7 '17 at 2:15
• I guess your textbook author really likes that one... But any bilinear function which satisfies all of those inner product axioms is an inner product. And that's not the one that's used in this exercise. – Bobbie D Mar 7 '17 at 2:16