Section 2.7 Spectral Methods
Consider the set of functions \(C^\infty(\Bbb R)\text{.}\) This is a vector space, just as \(C^\infty[0,1]\) we saw earlier, but, unlike that space, it does not have a countable basis. An analogue of a bases for this space is an integral transform. Possibly the most well-known is the Fourier transform, defined as
\begin{equation*}
\hat u(k)=\int\limits_{-\infty}^\infty u(x)\,e^{-ikx}\,dx
\end{equation*}
For some type of functions, e.g. if \(u\in L^2(\Bbb R)\text{,}\) it is defined also the inverse Fourier transformation
\begin{equation*}
u(x)=\frac{1}{2\pi}\int\limits_{-\infty}^\infty \hat u(k)\,e^{ikx}\,dk.
\end{equation*}
Using Fourier Transform to solve ODEs. The main advantage of applying a Fourier transform is the following:
\begin{equation*}
u'(x) = \frac{1}{2\pi}\int\limits_{-\infty}^\infty ik\,\hat u(k)\,e^{ikx}\,dk.
\end{equation*}
In other words, \(d/dx\) corresponds in the momentum space to multiplication by \(ik\text{!}\) For example, consider \(-u''(x)+u(x)=f(x)\text{.}\) In momentum space the ODE just becomes the algebraic equation
\begin{equation*}
k^2\hat u(k)+\hat u(k)=\hat f(k)
\end{equation*}
so that \(\hat u(k)=\hat f(k)/(1+k^2)\) and finally we get the ODE solution
\begin{equation*}
u(x) = \frac{1}{2\pi}\int\limits_{-\infty}^\infty\frac{\hat f(k)}{1+k^2}\,e^{ikx}\,dk\,.
\end{equation*}
Fourier series. Consider now a bounded interval \([0,L]\text{.}\) Then \(C^\infty[0,L]\) has countable bases and the Fourier transform becomes a Fourier series:
\begin{equation*}
u(x) = \sum_{k=-\infty}^\infty \hat u_k e^{2\pi ikx/L},
\end{equation*}
with
\begin{equation*}
\hat u_k = \frac{1}{L}\int\limits_{0}^L u(x) e^{-2\pi ikx/L}dx.
\end{equation*}
Notice tht, in particular,
\begin{equation*}
(u')_k = ik u_k.
\end{equation*}
Hence any ODE or PDE under Fourier transform becomes an algebraic equation, so that we can solve it and then use the inverse transformation to get the solution in \(x\) after cutting the infinite series to \(N\text{.}\)
Discrete Fourier trasform. In calculations, the segment \([0,L]\) is replaced by the regular mesh \(\{0,h,2h,\dots,L\}\) with \(N+2\) nodes, namely \(h=L/(N+1)\text{.}\) Suppose we want to solve a Dirichlet problem on \([0,L]\text{,}\) so that
\begin{equation*}
u(x)=\sum_{k=1}^\infty a_k \sin(\pi kx/L)
\end{equation*}
Then (Discrete Fourier Transform)
\begin{equation*}
u_l=u(l h)=\sum_{k=1}^N a_k \sin(\pi kl/(N+1))\,,\;1\leq l\leq N
\end{equation*}
is a \(N\times N\) system in \(a_1,\dots,a_N\text{.}\) Its solution is the Inverse Discrete Fourier Transform
\begin{equation*}
a_k=\frac{2}{N+1}\sum_{l=1}^N u_l\sin(\pi kl/(N+1))\,.
\end{equation*}
[to be continued...]