Using QR decomposition to find an orthonormal basis of a polynomial vector space

change-of-basisgram-schmidtlinear algebramatrices

I am doing the following exercise:

Let $P_{5}$ be the vector space of real polynomials with degree at most 5. Identify this space with the usual isomorphism on $\mathbb{R}^6$:

$$T\left( \displaystyle \sum_{i=0}^{5} a_{i}x^{i}\right) = (a_{0},a_{1}, \ldots, a_{5})$$

a) Find the symmetric matrix $A$ such that the inner product in $\mathbb{R}^6$, defined by $$\langle u, v \rangle = v^{T} \cdot A \cdot u$$ represents the inner product in $P_{5}$:

$$\displaystyle \langle u, v \rangle_{P} = \int_{-1}^{1} u(x)v(x) dx$$

b) Let $V$ be an orthonormal basis of eigenvectors of $A$ and $D$ the diagonal matrix with the eigenvalues of $A$. Define the basis $U = V \cdot D^{-1/2}$. Show that, on this basis, the inner product defined in a) is the usual inner product on the cannonical basis.

c) Use the QR decomposition of any software to find the orthonormal polynomials resulting from the Gram-Schmidt process applied to the basis $B = [1,x,x^2, \ldots, x^5]$. (Hint: use letter b)

Ok, a), and b) are easy. For a), one can compute the matrix by $a_{ij} = \langle e_{i},e_{j} \rangle_{P}$, where $e_{i} = x^{i-1}$, for $i = 1, \ldots 6$.

For b), just write $u$ in the cannonical basis $E$ as $u_{E} = U \cdot u_{U}$ where $u_{U}$ is the vector $u_{E}$ represented on the basis $U$. Therefore, computing $u_{E}^{T} \cdot A \cdot v_{E}$ gives the desired result.

I am struggling with letter c). My idea is: I write the vectors $e_{i}$ (which represents the basis $B$) of $\mathbb{R}^6$ on the basis $U$ and apply the QR decomposition on the matrix T which has on its colums the vectors $e_{i}$ on the basis $U$. Therefore, as a result, the matrix $Q$ will be an orthogonal matrix where its columns are orthonormal vectors represented on the basis $U$, then I return each vector to the cannonical basis and get the desired result. Is this right? It does not seem right to me, I think maybe I am misinterpretating the question.

Best Answer

Your interpretation sounds correct. The Graham-Schmidt process orthogonalizes a set of vectors with respect to the usual inner product, $\langle u, v \rangle = v^Tu$. If $u,v$ are written with respect to the basis $U$, then that inner product is equivalent to $\langle u_E, v_E \rangle_A := v_E^T \cdot A \cdot u_E$, which you have already shown corresponds to the standard inner product on $P_5$. So you want to take your basis $B$ for $P_5$, find the corresponding set of vectors of $\mathbb{R}^6$ via the canonical isomorphism, represent those vectors in base $U$, orthogonalize via Graham-Schmidt to get some vectors (still in base U), represent them in the canonical basis, and then find the corresponding polynomials, which will be an orthonormal basis for $P_5$.