# Show that the Gram Matrix G(B) is Positive Definite

Suppose we have $$\boldsymbol P_{\leqslant 1}=\operatorname{span}\{1,x\}$$ that is an inner product space with respect to $$\int^1_0p(x)q(x)dx$$.

Consider the basis $$B=\left\{b_1 = 1, b_2 = x\right\}$$.

Finding the Gram matrix $$G(B)$$ I would have

$$G(B)=\begin{bmatrix}\int^1_01dx & \int^1_0xdx\\ \int^1_0xdx & \int^1_0x^2dx \end{bmatrix} = \begin{bmatrix}1&\frac12\\\frac12&\frac13\end{bmatrix}$$

I want to show that $$G(B)$$ is positive definite.

It is obvious that $$G(B)$$ is symmetric since $$G_{12} = G_{21}$$.

Now, to calculate the eigenvalues, I have found that

$$\lambda_1 = \frac{4+\sqrt{13}}{6}$$

$$\lambda_2 = \frac{4-\sqrt{13}}{6}$$

Since $$4 > \sqrt{13}$$, then $$\lambda_2 > 0$$.

Is this enough to show that this is positive definite?

The reason that I am skeptical is because I had a homework question similar to the one above, but with a longer basis and with $$\textbf{P}_{\leq 2}=\operatorname{span}\{1,x,x^2\}$$ :

consider the basis $$B = \{b_1 = 1, b_2 = x, b_3 = x^2\}$$

The Gram matrix is then

$$G(B)=\begin{bmatrix}1&\frac12&\frac13\\\frac12&\frac13&\frac14\\\frac13&\frac14&\frac15\end{bmatrix}$$

I attempted to show that $$G(B)$$ is positive definite by first showing that the matrix is symmetric, and that its eigenvalues $$\lambda$$ are positive. However, it seems to be extremely unfeasible to find the eigenvalues of $$G(B)$$. Is there another way I could go about and prove this?

There are a lot of ways to prove that a matrix is positive definite, but sometimes working from the definition $x^TAx > 0$ if $x$ nonzero is easiest. In this case you'll see that the Gramian being positive-definite is very general, much more so than looking at monomials.

Let $\langle \cdot, \cdot\rangle$ be your inner product $\langle p, q\rangle = \int_0^1p(x)q(x)dx$.
Let $B$ be a basis for your inner product space and $G$ be the Gramian matrix with $G_{ij} = \langle B_i, B_j\rangle$.

Assume $x$ nonzero.
Then $$x^TGx =\sum_{i,j}x_iG_{ij}x_j =\sum_{i,j}x_i \langle B_i, B_j\rangle x_j$$

Now you can use properties of the inner product. Linearity in the first term allows simplification to $\sum_j \langle \sum_i x_i B_i, B_j \rangle x_j$, and then linearity in the second term allows simplification to $\langle \sum_i x_i B_i, \sum_j x_j B_j \rangle = \langle y, y \rangle$ for some $y$, and $\langle y, y \rangle$ realizes zero iff $y$ is $0$. But if $x$ is nonzero, then $B$ being a basis implies that $y$ is nonzero, in which case $\langle y, y, \rangle$ is strictly greater than $0$.

Putting it together you get that $$x \not= 0 \implies x^TGx > 0$$

We didn't need to reference the particular inner product as definite integral anywhere in this proof. So although it's probably good for intuition to see how the Gram matrix is positive definite for this particular case, the most important part is that the Gram matrix inherits its properties straight from the inner product, and in particular if you're dealing with real numbers/functions: the Gram matrix is symmetric because the inner product is symmetric, and the Gram matrix is positive definite because the inner product is bilinear and positive definite.

• One question. I am actually supposed to prove that the inner product is positive definite by showing that $G(B)$ is positive definite, so I assume I won't be able to assume that $\langle y, y \rangle$ is positive definite in the first place. Is there a way to do this? Commented Mar 22, 2017 at 14:28
• Have you learned about Sylvester's criterion? A matrix is positive definite if and only if it's leading minors are all positive. For small matrices you can make use of direct computation, but also you can proceed inductively because the Gram matrix for $\mathbb{P_{\leq n}}$ is embedded in the Gram matrix $\mathbb{P_{\leq m}}$ for $n < m$. Your problem reduces to showing that the determinant of the Gramian is positive. Commented Mar 22, 2017 at 22:07
• I ended up using the cholesky decomposition actually. It gives me the factorized form of $A^TG(B)A$ and helps me see that it is a positive definite matrix. Commented Mar 22, 2017 at 23:34