## 2 Introduction to Spectral Analysis
### Spectral Space Representation  
The function of interest for spectral space representation, \(f(x)\) is approximated with the finite sum as:  
\[f^{(N)}(x)=\sum\limits_{n=0}^{N-1}a_{n}P_{n}(x),x\in[a,b], \tag{4}\]  
with the condition of ortonormality (Equation (2)) giving the expansion coefficients as:  
\[a_{n}=\int\limits_{a}^{b}w(x)P_{n}(x)f(x)dx=\delta_{nm}, \tag{5}\]  
which has occasionally been referred to as the generalized Fourier coefficients. The \(a_{n}\) coefficients in Equation (5) stand for the spectral space representation of \(f(x)\). Then, a basis set should be chosen in order that the series Equation (1) provide a precise approximation of \(f(x)\) with a small number of terms. For an acceptable level of efficiency, the absolute values of the coefficients, \(|a_{n}|\), should diminish rapidly with rising \(n\)[62].  
Another choice of basis functions are the functions \(p_{n}(x)=\sqrt{w(x)}P_{n}(x)\), orthogonal according to  
\[a_{n}=\int\limits_{a}^{b}p_{n}(x)p_{m}(x)dx=\delta_{nm}. \tag{6}\]  
Then, it comes to the alternate expansion in a form:  
\[f^{(N)}(x)=\sum\limits_{n=0}^{N-1}b_{n}p_{n}(x), \tag{7}\]  
with the expansion coefficients:  
\[b_{n}=\int\limits_{a}^{b}f(x)p_{n}(x)dx. \tag{8}\]  
Another expansion option may be chosen in a form:  
\[f^{(N)}(x)=w(x)\sum\limits_{n=0}^{N-1}c_{n}P_{n}(x), \tag{9}\]  
for which the expansion coefficients are given as:  
\[c_{n}=\int\limits_{a}^{b}f(x)P_{n}(x)dx. \tag{10}\]  
The expansions defined by Equations (4), (7) and (9) labelled with the same \(f^{(N)}(x)\) may have totally different convergence resulting from the behaviour of \(f(x)\). However, for basis set with unit weight function such as Legendre polynomials and Fourier sines and cosines, these expansions are identical [62]. The concern regarding the approximations represented by Equations (4), (7) and (9) is whether the series converges and how quickly. The knowledge that the series expansion is convergent does not provide the practical information of how many terms \(N\) are required for the approximation \(f^{(N)}(x)\) to be a good approximation to the function \(f(x)\). A more detailed information about certain mathematical treatment of this subject may be found in the literature [50; 51; 52]. Careful and meticulous scholar may be also concerned in establishing the error of the series expansion, i.e., the difference between \(f(x)\) and \(f^{(N)}(x)\). Some detailed information is given in [53].  
valid for all \(N\). With the substitution of Equation (12) into Equation (4) and interchange of the summations, one can obtain the basic interpolation result  
\[f^{(N)}(x)=\sum_{i=1}^{N}I_{i}(x)f(x_{i}), \tag{20}\]  
with the interpolation function given by  
\[I_{i}^{(N)}(x)=w_{i}\sum_{n=0}^{N-1}P_{n}(x)P_{n}(x_{i}), \tag{21}\]  
satisfying  
\[I_{i}^{(N)}(x_{j})=\delta_{ij}, \tag{22}\]  
referred to as the \"coordinality\" condition. This result is valid for any \(N\), consistent with Equation (18). These interpolation functions play the main role in pseudo-spectral methods of solution.  
It is also of interest to notice that the interpolation functions are orthogonal:  
\[\int\limits_{a}^{b}w(x)I_{i}(x)I_{j}(x)dx=w_{i}w_{j}\sum_{n=0}^{N-1}P_{n}(x_{ i})P_{n}(x_{j})=\delta_{ij}, \tag{23}\]  
where the orthonormality of the basis functions, \(P_{n}(x)\), has been used.