# Definite integral as dot product

I was reading examples of dot products and I came across the following:

In the vector space $$P_n(\mathbb{R})$$ of polynomials with degree less or equal to $$n$$ we consider the following dot product:$$\langle p(x),q(x)\rangle:=\int _{0} ^1 p(x)q(x)dx\quad$$

I don't see why this is a dot product. In particular I don't see how it is positive definite.

$$\langle p(x),p(x)\rangle=\int _{0} ^1 (p(x))^2 dx\quad$$

Why is the above always greater or equal to zero?

• $a^{2} \geq 0$ for any real number $a$. – Kavi Rama Murthy Feb 15 at 9:19
• @KaviRamaMurthy thanks. I wasn't seeing that $x$ was fixed and therefore $\int _{0} ^1 (p(x))^2 dx\quad$ was a number – Yagger Feb 15 at 9:25
• You mean "$b$" (upper bound of integration) is fixed. In the integral, $x$ is the variable of integration and is not fixed: it runs from 0 to 1. – KCd Feb 15 at 9:29
• It is very important to note that $\int_0^1 f(x) dx =0$ only implies that $f(x)=0$ on $[0,1]$, not on all of $\mathbb{R}$. But since polynomials are very rigid objects, and a non-zero polynomial of degree $n$ can have $n$ roots at most, if a polynomial becomes constant on an interval, it must be constant on $\mathbb{R}$. – stressed out Feb 15 at 19:15
• It is the continuous version of the standard dot product in dimension $n$. Instead of $\sum_{k=1}^n p_k q_k$, you replace the sum with an integral to get $\int_0^1 p(x) q(x) \, dx$. – Jair Taylor Feb 15 at 19:15

Obviously, $$p(x)^2 \geq 0$$ for any $$x \in \mathbb{R}$$. Hence, $$\int_0^1 p(x)^2 \mathrm{d}x \geq 0$$. However, this was the easy part of the first condition for something to be an inner product. The harder part of proving that what you have defined is indeed an inner product is to show that it is non-degenerate, i.e. $$\langle p(x), p(x) \rangle = 0 \implies p(x) = 0$$ and I believe you haven't shown this if you got stuck in showing that it's non-negative.
It is a well known theorem in Riemann integration that if $$f(x) \geq 0$$ for all $$x\in [a,b]$$ then
$$\int_a^b f(x) \mathrm{d}x = 0 \implies f(x) = 0 \text{ on the interval } [a,b]$$
Here, you have $$p(x)^2 \geq 0$$ for any $$x$$ in $$[0,1]$$. Hence, the above theorem implies that $$p(x)=0$$ on $$[0,1]$$.
So, the polynomial $$p(x)$$ has infinitely many roots! Therefore, $$p(x)$$ must be the zero polynomial because a non-zero polynomial of degree $$n$$ can have $$n$$ roots at most.
Remark: In general, the aforementioned theorem about Riemann integration only implies that $$f(x)=0$$ on the interval of integration, not all of $$\mathbb{R}$$. However, polynomials are very rigid objects in the sense that if a polynomial becomes constant on an interval, it must be constant everywhere. So, in this particular problem, the fact that we are defining the inner product on polynomials of degree at most $$n$$ is crucial and should not be overlooked.