Why does this Fourier series have a finite number of terms?

I am learning about Fourier series in class and the basic form of a Fourier Series is

$$a_{0}+\sum_{n=1}^{\infty} [a_{n}\cos(nx)+b_{n}\sin(nx)]$$

so a fourier series should have an infinity number of terms.

I was reading the book and it says that the fourier series of $\cos^{2}(3x)$ is $\frac{1}{2}+\frac{1}{2}\cos(6x)$. I am assuming the $\frac{1}{2}$ is the $a_{0}$ term. If this is the fourier series, why does it not have an infiniti number of terms like the form above? Why does it only stop at one term after the $\frac{1}{2}$ term?


Solution 1:

Well, you can still think of it as having an infinite number of terms, just that most terms are zero.

For a similar example, consider the Taylor series of $1 + x + x^2$. Since everything past the second derivative is zero, all the coefficients of terms with power greater than $2$ are zero, so the series expansion is just the function itself. A similar thing is happening with the Fourier transform: $\cos^2(3x)$ is orthogonal to the terms whose coefficients are not $a_0$ and $a_6$, so their contribution to the Fourier decomposition is zero.

Solution 2:

It doesn't stop. They are just all zero. $a_n = 0$. So you can write $\frac{1}{2} + \frac{1}{2}cos(6x) + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + 0 \dots$ if you want.

Solution 3:

One 'practical' reason could be, that the function, you are trying to approximate using a sinusoidal series is itself a sinusoidal function. So it is not an approximation but an exact description. cos^2 3x = 1/2 + cos 6x/2 (using the trig identity).

The same thing happens with polynomial functions, when you try to approximate them with Taylor series. (Taylor series approximation is nothing but, trying to approximate a function using a polynomial.)

Solution 4:

Let's say you want to expand a function $f$ using whatever basis functions (call them $b_n$). Then if your $f$ is already a linear combination of a finite number of $f_n$'s you expansion will be finite too. It works both ways. Finite linear combination means finite expansion and finite expansion means finite linear combination.

In the case of fourier series, the basis functions are sines and cosines. Since you are getting only a finite expansion, then your function is made up of a bunch of (finite number of) sines and cosines. It doesn't matter what it may "look" like.

Same thing happens with Taylor expansion. When using Taylor expansions, the basis functions are $1,x,x^2,x^3,x^4,...$ so if a function had a finite Taylor expansion then it itself must be a polynomial. And its true, polynomials (and only polynomials) have a finite Taylor expansion. Just for giggles, try $f(x)=\cos(3\arccos(x))$. You will see that it has a finite Taylor expansion and hence it is a polynomial.