Energy integral using Chebyshev coefficients

chebyshev polynomialsintegrationnumerical methodsquadrature

I am trying to evaluate the following integral
\begin{equation}
E = \int_{-1}^1 f(x)g(x) \ dx
\end{equation}

I have the values for Chebyshev coefficients of the function $f(x) = \sum_{m=0}^{N-1} \hat{f}(m) \ T_m (x)$ and $g(x) = \sum_{m=0}^{N-1} \hat{g}(m) \ T_m (x)$ where $T_m(x)$ are Chebyshev polynomials of the first kind.

The discrete and continuous orthogonality relations on the Chebyshev polynomials are given by the following where in the discrete orthogonality relation $\{ x_i \}$ are the roots of the Chebyshev polynomial of the highest order i.e, $T_{N_r-1}(x)$:
\begin{equation}
\sum_i T_n(x_i) T_m(x_i) =
\begin{cases}
0 & \quad n \neq m \\
N_r/2 & \quad n=m \neq 0 \\
N_r & \quad n=m=0 \\
\end{cases}
\label{eq:disc_orth_cheb}
\end{equation}

\begin{equation}
\int_{-1}^1 T_n(x) T_m(x) \frac{dx}{\sqrt{1-x^2}} =
\begin{cases}
0 & \quad n \neq m \\
\pi/2 & \quad n=m \neq 0 \\
\pi & \quad n=m=0 \\
\end{cases}
\label{eq:cont_orth_cheb}
\end{equation}

Is there any way I can compute the integral $E$ in terms of $\hat{f}(m)$ and $\hat{f}(n)$?

The following attempt is incomplete since I am not sure the integral to sum conversion is complete. There is a missing factor but I cannot figure out what it can be..
\begin{align*}
E =& \int_{-1}^1 \ f(x)^2 \ dx \\
=& \sum_{m} \sum_{n} \sum_{i (?)} \hat{f}(m) \hat{f}(n) T_m(x_i) T_n(x_i) \\
=& \sum_{m} \sum_{n} \hat{f}(m) \hat{f}(n) \sum_{i (?)}T_m(x_i) T_n(x_i) \end{align*}

Applying discrete orthogonality relation, we can get the following
\begin{align*}
E=& \frac{N_r}{2} \sum_{m=0}^{N_r -1}g(m) \hat{f}(m)^2
\end{align*}

However, this relies on resolving the $(?)$ that arises when we write the definite integral in $x$ in terms of the sum over the value of the integrand at the discrete collocation points which are the Chebyshev roots $x_i$.

Best Answer

Let's plug the expansion $$ f(x) = \sum_{m=0}^{n-1} {\hat f}_m T_m(x)\\ g(x) = \sum_{m=0}^{n-1} {\hat g}_m T_m(x)\\ $$ into the bilinear form (with some fixed $\omega(x)$ weight function) $$ J(f, g) = \int_{-1}^1 f(x) g(x) \omega(x) dx = \int_{-1}^1 \left( \sum_{m=0}^{n-1} {\hat f}_m T_m(x) \right) \cdot \left( \sum_{k=0}^{n-1} {\hat g}_k T_k(x) \right) \omega(x) dx = \\ = \sum_{m,k=0}^{n-1} {\hat f}_m {\hat g}_k \int_{-1}^1 T_m(x) T_k(x) \omega(x) dx = \sum_{m,k=0}^{n-1} a_{mk} {\hat f}_m {\hat g}_k. $$ Here $$ a_{mk} = \int_{-1}^1 T_m(x) T_k(x) \omega(x) dx, \quad m, k = 0,\dots,n-1 $$ is a matrix which elements can be computed if $\omega(x)$ is known.

If $\omega(x) = \frac{1}{\sqrt{1-x^2}}$ then $$ a_{mk} = \begin{cases} 0, & m\neq k\\ \frac{\pi}{2}, &m = k > 0\\ \pi, &m = k = 0 \end{cases}. $$ So $$ \int_{-1}^1 \frac{f(x)g(x)}{\sqrt{1-x^2}} dx = \pi f_0 g_0 + \frac{\pi}{2} \sum_{m=1}^n f_m g_m. $$

If $\omega(x) = 1$ (as in your original question) then $$ a_{mk} = \int_{-1}^1 T_m(x) T_k(x) dx. $$ This matrix does not have a simple expression like above. But a closed form still exists: $$ T_m(x) T_k(x) = \cos m \arccos x \cos k \arccos x = \\ = \frac{1}{2} \left( \cos (m-k) \arccos x + \cos (m+k) \arccos x \right) = \frac{T_{|m-k|}(x) + T_{m+k}(x)}{2} $$

The $T_m(x)$ can be easily integrated (see the last property here): $$ \int_{-1}^1 T_m(x) dx = \begin{cases} \frac{2}{1 - m^2}, &m \text{ is even}\\ 0, &m \text{ is odd} \end{cases} $$ So $$ a_{mk} = \begin{cases} \frac{1}{1 - (m-k)^2} + \frac{1}{1 - (m+k)^2}, & m - k \text{ is even}\\ 0, & m - k \text{ is odd} \end{cases} $$ Collecting everything we get $$ \int_{-1}^1 f(x) g(x) dx = \sum_{\substack{k,m=0\\k + m \text{ is even}}}^{n-1} \left[ \frac{1}{1 - (m-k)^2} + \frac{1}{1 - (m+k)^2} \right] {\hat f}_m {\hat g}_k. $$ The bad news is that evaluating $\int_{-1}^1 f(x) g(x) dx$ requires $O(n^2)$ operations if only ${\hat f}_m, {\hat g}_m$ are known, while evaluating $\int_{-1}^1 \frac{f(x) g(x)}{\sqrt{1-x^2}} dx$ requires only $O(n)$.

Related Question