Expand the unknown in Fourier modes:
By Termwise differentiation of a Fourier series,
Also,
Therefore the coefficient of on the left-hand side is
The right-hand side has coefficients
because the coefficient of each of is and the constant coefficient is one. Hence the Fourier spectral system for a cosine-modulated second derivative is
Its coefficient array is an infinite tridiagonal matrix.
For a spectral truncation, retain the modes , set
and impose the displayed coefficient equation for every . This gives an explicit -dimensional tridiagonal system. The resulting finite Fourier series automatically satisfies the periodic boundary conditions.
Expand in the two-dimensional Fourier basis. Applying the derivative and product rules from part (a), the coefficient of the equation is
The normalization and compatibility conditions are
Thus, on , the infinite Fourier spectral method system is
For a square spectral truncation, choose
retain equations and unknowns indexed by , and set omitted coefficients to zero. This is the Fourier–Galerkin method: it projects the residual onto the retained Fourier modes. Other finite mode sets may be used in the same way.