Coordinates Depend on the Inner Product and Basis
Coordinates are not limited to vectors written as columns in \(\mathbb{R}^n\). A polynomial, a function in a finite-dimensional function space, or a matrix can also be expressed in a basis. When the basis is orthonormal, inner products give the coordinates directly. The essential practical point is to use the inner product and the ordered basis that have actually been specified: coefficients that work in one basis need not be coordinates in another.
Throughout the examples, the spaces are real and finite-dimensional. An inner product on a real vector space is a symmetric, bilinear function \(\langle\cdot,\cdot\rangle\) such that \(\langle\mathbf{v},\mathbf{v}\rangle\geq 0\), with equality exactly when \(\mathbf{v}=\mathbf{0}\). A list \(\mathcal{B}=(\mathbf{q}_1,\dots,\mathbf{q}_n)\) is an orthonormal basis if it is a basis and \(\langle\mathbf{q}_i,\mathbf{q}_j\rangle=1\) when \(i=j\), and \(0\) otherwise. The same notation applies when the space elements are polynomials, functions, or matrices rather than column vectors.
Proof. Because \(\mathcal{B}\) is a basis, there are unique scalars \(c_1,\dots,c_n\) such that \(\mathbf{v}=\sum_{j=1}^n c_j\mathbf{q}_j\); by definition, these scalars are the entries of \([\mathbf{v}]_{\mathcal{B}}\). Fix an index \(k\). Bilinearity and orthonormality give $$ \langle\mathbf{v},\mathbf{q}_k\rangle =\left\langle\sum_{j=1}^n c_j\mathbf{q}_j,\mathbf{q}_k\right\rangle =\sum_{j=1}^n c_j\langle\mathbf{q}_j,\mathbf{q}_k\rangle =c_k. $$ This holds for each \(k\), so the inner products are exactly the coordinates. \(\square\)
For complex inner-product spaces with the convention that the first slot is linear and the second is conjugate-linear, the same statement holds: the \(k\)-th coordinate is \(\langle\mathbf{v},\mathbf{q}_k\rangle\). This follows from the same proof, because the coefficient \(c_j\) is in the first slot. All computations below are over \(\mathbb{R}\).
Polynomial Coordinates from an Integral
Let \(P_2\) be the real vector space of polynomials of degree at most two. Specify its inner product by $$ \langle f,g\rangle=\int_{-1}^{1}f(x)g(x)\,dx. $$ Consider the ordered list $$ \mathcal{B}=(q_0,q_1,q_2),\qquad q_0(x)=\frac{1}{\sqrt{2}},\quad q_1(x)=\sqrt{\frac{3}{2}}\,x,\quad q_2(x)=\sqrt{\frac{5}{8}}\,(3x^2-1). $$
These polynomials are orthonormal for the specified inner product. For \(q_0\), the squared norm is \(\frac12\int_{-1}^1 1\,dx=1\). For \(q_1\), it is \(\frac32\int_{-1}^1x^2\,dx=\frac32\cdot\frac23=1\). For \(q_2\), use \(\int_{-1}^1 x^4\,dx=\frac25\) and \(\int_{-1}^1 x^2\,dx=\frac23\): $$ \langle q_2,q_2\rangle =\frac58\int_{-1}^1(9x^4-6x^2+1)\,dx =\frac58\left(\frac{18}{5}-4+2\right)=1. $$ The products \(q_0q_1\) and \(q_1q_2\) are odd, so their integrals over \([-1,1]\) are zero. Also, $$ \langle q_0,q_2\rangle =\sqrt{\frac{5}{16}}\int_{-1}^1(3x^2-1)\,dx =\sqrt{\frac{5}{16}}\left(2-2\right)=0. $$ There are three orthonormal, hence linearly independent, polynomials in \(P_2\); since \(P_2\) has dimension three, this list is a basis.
Worked Example: Coordinates of a Polynomial
Find the coordinates of \(f(x)=2+3x-x^2\) in the ordered orthonormal basis \(\mathcal{B}\) above.
The first coordinate is its inner product with \(q_0\). Integrating each term gives $$ \langle f,q_0\rangle =\frac{1}{\sqrt{2}}\int_{-1}^1(2+3x-x^2)\,dx =\frac{1}{\sqrt{2}}\left(4+0-\frac23\right) =\frac{5\sqrt{2}}{3}. $$
For the second coordinate, the terms \(2x\) and \(-x^3\) are odd, so their integrals vanish: $$ \langle f,q_1\rangle =\sqrt{\frac32}\int_{-1}^1(2x+3x^2-x^3)\,dx =\sqrt{\frac32}\left(0+3\cdot\frac23-0\right) =\sqrt{6}. $$
For the third coordinate, the constant part contributes zero because \(\int_{-1}^1(3x^2-1)\,dx=0\), and the part involving \(3x\) is odd. Thus $$ \begin{aligned} \langle f,q_2\rangle &=\sqrt{\frac58}\int_{-1}^1(-x^2)(3x^2-1)\,dx\\ &=\sqrt{\frac58}\left(-3\cdot\frac25+\frac23\right) =\sqrt{\frac58}\left(-\frac{8}{15}\right) =-\frac{2\sqrt{10}}{15}. \end{aligned} $$ Therefore $$ [f]_{\mathcal{B}}= \begin{bmatrix} 5\sqrt{2}/3\\ \sqrt{6}\\ -2\sqrt{10}/15 \end{bmatrix}. $$
Check: Reconstruct the polynomial using these coordinates: $$ \frac{5\sqrt2}{3}q_0+\sqrt6\,q_1-\frac{2\sqrt{10}}{15}q_2 =\frac53+3x-\frac13(3x^2-1) =2+3x-x^2. $$ The reconstruction agrees with \(f\).
Function Coordinates on a Specified Interval
For a function space, the interval in the integral is part of the inner-product definition and cannot be omitted. Let \(V=\operatorname{span}\{1,\cos x,\sin x\}\), the real vector space of functions on \([0,2\pi]\) generated by these three functions. Use $$ \langle f,g\rangle=\int_0^{2\pi}f(x)g(x)\,dx. $$ An orthonormal basis is $$ \mathcal{C}=\left(\frac{1}{\sqrt{2\pi}},\frac{\cos x}{\sqrt{\pi}},\frac{\sin x}{\sqrt{\pi}}\right). $$ Indeed, \(\int_0^{2\pi}1\,dx=2\pi\), while \(\int_0^{2\pi}\cos^2x\,dx=\int_0^{2\pi}\sin^2x\,dx=\pi\). The cross integrals are zero: the integrals of \(\sin x\), \(\cos x\), and \(\sin x\cos x\) over this full period all vanish. The list is therefore orthonormal; as it spans \(V\), it is a basis.
Worked Example: Coordinates of a Trigonometric Function
Find the coordinates of \(h(x)=2+3\cos x-4\sin x\) in \(\mathcal{C}\).
Take inner products with the basis functions one at a time. For the constant basis function, $$ \left\langle h,\frac{1}{\sqrt{2\pi}}\right\rangle =\frac{1}{\sqrt{2\pi}}\int_0^{2\pi}(2+3\cos x-4\sin x)\,dx =\frac{4\pi}{\sqrt{2\pi}} =2\sqrt{2\pi}. $$ For the cosine basis function, the constant and sine terms integrate to zero, leaving $$ \left\langle h,\frac{\cos x}{\sqrt{\pi}}\right\rangle =\frac{1}{\sqrt{\pi}}\left(3\int_0^{2\pi}\cos^2x\,dx\right) =\frac{3\pi}{\sqrt{\pi}}=3\sqrt{\pi}. $$ Similarly, the constant and cosine terms contribute zero to the sine coordinate: $$ \left\langle h,\frac{\sin x}{\sqrt{\pi}}\right\rangle =\frac{1}{\sqrt{\pi}}\left(-4\int_0^{2\pi}\sin^2x\,dx\right) =-4\sqrt{\pi}. $$ Hence $$ [h]_{\mathcal{C}}= \begin{bmatrix} 2\sqrt{2\pi}\\ 3\sqrt{\pi}\\ -4\sqrt{\pi} \end{bmatrix}. $$
Check: Multiplying each coordinate by its corresponding basis function gives $$ 2\sqrt{2\pi}\frac{1}{\sqrt{2\pi}} +3\sqrt{\pi}\frac{\cos x}{\sqrt{\pi}} -4\sqrt{\pi}\frac{\sin x}{\sqrt{\pi}} =2+3\cos x-4\sin x=h(x). $$
Matrix Coordinates with the Frobenius Inner Product
Let \(M_{2\times2}(\mathbb{R})\) be the real vector space of \(2\times2\) matrices. Its Frobenius inner product is the sum of the products of corresponding entries: $$ \langle\mathbf{A},\mathbf{B}\rangle =a_{11}b_{11}+a_{12}b_{12}+a_{21}b_{21}+a_{22}b_{22}. $$ Thus, for this inner product, a matrix is treated as a vector of its entries, while the matrix itself remains the object whose coordinates are being found.
Use the following ordered list: $$ \mathcal{D}=(\mathbf{Q}_1,\mathbf{Q}_2,\mathbf{Q}_3,\mathbf{Q}_4), $$ $$ \mathbf{Q}_1=\frac{1}{\sqrt2}\begin{bmatrix}1&0\\0&1\end{bmatrix},\quad \mathbf{Q}_2=\frac{1}{\sqrt2}\begin{bmatrix}1&0\\0&-1\end{bmatrix},\quad \mathbf{Q}_3=\frac{1}{\sqrt2}\begin{bmatrix}0&1\\1&0\end{bmatrix},\quad \mathbf{Q}_4=\frac{1}{\sqrt2}\begin{bmatrix}0&1\\-1&0\end{bmatrix}. $$ Each matrix has two nonzero entries, each with squared value \(1/2\), so its squared norm is \(1\). The inner product of \(\mathbf{Q}_1\) and \(\mathbf{Q}_2\) is \((1-1)/2=0\); that of \(\mathbf{Q}_3\) and \(\mathbf{Q}_4\) is \((1-1)/2=0\). Each matrix in the first pair has nonzero entries in diagonal positions, while each in the second pair has nonzero entries off the diagonal, so their cross inner products are zero. This verifies orthonormality. The four matrices form a basis because the space has dimension four and the list of four orthonormal matrices is linearly independent.
Worked Example: Coordinates of a Matrix
Find the coordinates of $$ \mathbf{A}=\begin{bmatrix}1&2\\3&4\end{bmatrix} $$ in the basis \(\mathcal{D}\).
Using the Frobenius inner product, compute each entry of the coordinate vector: $$ \begin{aligned} \langle\mathbf{A},\mathbf{Q}_1\rangle&=\frac{1+4}{\sqrt2}=\frac5{\sqrt2},& \langle\mathbf{A},\mathbf{Q}_2\rangle&=\frac{1-4}{\sqrt2}=-\frac3{\sqrt2},\\ \langle\mathbf{A},\mathbf{Q}_3\rangle&=\frac{2+3}{\sqrt2}=\frac5{\sqrt2},& \langle\mathbf{A},\mathbf{Q}_4\rangle&=\frac{2-3}{\sqrt2}=-\frac1{\sqrt2}. \end{aligned} $$ Consequently, $$ [\mathbf{A}]_{\mathcal{D}}= \begin{bmatrix} 5/\sqrt2\\ -3/\sqrt2\\ 5/\sqrt2\\ -1/\sqrt2 \end{bmatrix}. $$
Check: The weighted sum of basis matrices is $$ \begin{aligned} \sum_{i=1}^4[\mathbf{A}]_{\mathcal{D},i}\mathbf{Q}_i &=\frac52\begin{bmatrix}1&0\\0&1\end{bmatrix} -\frac32\begin{bmatrix}1&0\\0&-1\end{bmatrix}\\ &\quad+\frac52\begin{bmatrix}0&1\\1&0\end{bmatrix} -\frac12\begin{bmatrix}0&1\\-1&0\end{bmatrix}\\ &=\begin{bmatrix}1&2\\3&4\end{bmatrix}. \end{aligned} $$ Each of the four entries matches \(\mathbf{A}\), so the coordinates reconstruct the matrix.
Inner Products Can Be Computed from Coordinates
Proof. The coordinate expansions give \(\mathbf{u}=\sum_{i=1}^n a_i\mathbf{q}_i\) and \(\mathbf{v}=\sum_{j=1}^n b_j\mathbf{q}_j\). By bilinearity and orthonormality, $$ \langle\mathbf{u},\mathbf{v}\rangle =\sum_{i=1}^n\sum_{j=1}^n a_i b_j\langle\mathbf{q}_i,\mathbf{q}_j\rangle =\sum_{i=1}^n a_i b_i. $$ All terms with \(i\ne j\) vanish, and the terms with \(i=j\) have \(\langle\mathbf{q}_i,\mathbf{q}_i\rangle=1\). \(\square\)
This proposition is useful when the coordinates are already known: it gives an inner product without returning to integrals, function values, or matrix entries. In a complex inner-product space with the first slot linear, the corresponding expression is \(\sum_{i=1}^n a_i\overline{b_i}\), because scalars in the second slot are conjugated.
Common Pitfall: Forgetting the Basis Normalization
For \(f(x)=2+3x-x^2\), it is tempting to call \((2,3,-1)^\top\) its coordinates in the polynomial basis \(\mathcal{B}\). That is incorrect: these are the coefficients of \(f\) in the monomial list \((1,x,x^2)\), not in \(\mathcal{B}\). For example, the first basis polynomial is \(q_0=1/\sqrt2\), not \(1\), so its coordinate cannot be read off as the constant coefficient of \(f\). The correct coordinates, found by inner products, are \((5\sqrt2/3,\sqrt6,-2\sqrt{10}/15)^\top\); the reconstruction above verifies them.
The same issue occurs for functions. On \([0,2\pi]\), \(\cos x\) has squared norm \(\pi\), not \(1\). Treating \((1,\cos x,\sin x)\) as orthonormal would assign the wrong coordinates. With the specified orthonormal basis, the cosine basis function is \(\cos x/\sqrt\pi\); for \(h(x)=\cos x\), its coordinate is $$ \left\langle\cos x,\frac{\cos x}{\sqrt{\pi}}\right\rangle =\frac{\pi}{\sqrt{\pi}}=\sqrt{\pi}, $$ not \(1\). Always check both the inner product and the normalization of the listed basis before using the coefficient formula.
Check Your Understanding
For each problem, state the inner product and ordered basis you use, then verify the coordinates by reconstruction.
- In \(P_2\) with \(\langle f,g\rangle=\int_{-1}^1 f(x)g(x)\,dx\), find the coordinates of \(1+x\) in \((q_0,q_1,q_2)\).
- In the trigonometric function space on \([0,2\pi]\), find the coordinates of \(1-\cos x+2\sin x\) in \(\mathcal{C}\).
- Using the Frobenius inner product and basis \(\mathcal{D}\), find the coordinates of \(\begin{bmatrix}2&0\\1&-1\end{bmatrix}\).
- Explain why the monomial coefficients of a polynomial are not automatically its coordinates in an orthonormal polynomial basis.
- State the coordinate formula for \(\langle\mathbf{u},\mathbf{v}\rangle\) in a real orthonormal basis and identify where orthonormality is used in its proof.