# Find the matrix of $\langle f, g \rangle = \displaystyle\int_0^1 f(t) g(t) \, \mathrm dt$ with respect to the basis $\{1,t,\dots,t^n\}$

Let $V$ be the vector space over $\mathbb{R}$ consisting of all polynomials of degree $\leqslant n$. If $f,g\in V$, let

$$\langle f,g \rangle = \int_\limits{0}^{1}f(t)g(t)dt$$

Find the matrix of this scalar product with respect to the basis $\{1,t,\dots,t^n\}$.

What does it mean to find a matrix of the scalar product?

#### Solutions Collecting From Web of "Find the matrix of $\langle f, g \rangle = \displaystyle\int_0^1 f(t) g(t) \, \mathrm dt$ with respect to the basis $\{1,t,\dots,t^n\}$"

If $k,l\in\{0,1,\ldots,n\}$, then$$\langle t^k,t^l\rangle=\int_0^1t^kt^l\,\mathrm dt=\frac1{k+l+1}.$$Therefore, the matrix of this scalar product is$$\begin{pmatrix}1&\frac12&\frac13&\ldots&\frac1{n+1}\\\frac12&\frac13&\frac14&\ldots&\frac1{n+2}\\\frac13&\frac14&\frac15&\ldots&\frac1{n+3}\\&\vdots&&\ddots&\vdots\\\frac1{n+1}&\frac1{n+2}&\frac1{n+3}&\ldots&\frac1{2n+1}\end{pmatrix}.$$

Let

$$f (t) = f_0 + f_1 t + \cdots + f_n t^n = \begin{bmatrix} f_0\\ f_1\\ \vdots\\ f_n\end{bmatrix}^\top \underbrace{\begin{bmatrix} 1\\ t\\ \vdots\\ t^n\end{bmatrix}}_{=: \mathrm v (t)} = \mathrm f^\top \mathrm v (t)$$

$$g (t) = g_0 + g_1 t + \cdots + g_n t^n = \begin{bmatrix} g_0\\ g_1\\ \vdots\\ g_n\end{bmatrix}^\top \begin{bmatrix} 1\\ t\\ \vdots\\ t^n\end{bmatrix} = \mathrm g^\top \mathrm v (t)$$

Hence,

$$\langle f, g \rangle = \int_0^1 f(t)g(t) \,\mathrm dt = \mathrm f^\top \underbrace{ \left( \int_0^1 \mathrm v (t) \,\mathrm v^\top (t) \,\mathrm dt \right)}_{=: \mathrm H_{n+1}} \mathrm g = \color{blue}{\mathrm f^\top \mathrm H_{n+1} \,\mathrm g}$$

where $\mathrm H_{n+1}$ is the $(n+1) \times (n+1)$ Hilbert matrix.

Since $<t^{i},t^{j}>=\int_0^1t^{i+j}dt=\frac{1}{i+j+1}$ for $i,j=0,…,n$ the product is represented by the following $(n+1)\times(n+1)$-matrix

$\begin{pmatrix}1&\frac{1}{2}&\frac{1}{3}&.&.&.\frac{1}{n+1}\\\frac{1}{2}&\frac{1}{3}&.&.&.&.\frac{1}{n+2}\\ .&.&.&.&.&.&\\.&.&.&.&.&.&\\ \frac{1}{n+1}&.&.&.&.&\frac{1}{2n+1}\end{pmatrix}$