I would like to ask some help on complex fourier series. For this fourier series, its quite hard for me because it look confusing when solving it. This is my question
1) Find the complex form of the Fourier Series expansion of
$$f(x)=\cos ax, \quad -\pi< x <\pi. $$
Someone please show me some work done and steps to solve it so that I can understand better. I'm a beginner in maths.
Expand $\cos (ax) = \frac{1}{2} (e^{iax}+e^{-iax})$.
Then $\hat{f_n} = \frac{1}{2 \pi} \int_{-\pi}^{\pi} \cos (ax) e^{-inx} dx = \frac{1}{2 \pi} \frac{1}{2}\int_{-\pi}^{\pi} (e^{iax}+e^{-iax}) e^{-inx} dx = \frac{1}{4 \pi} \int_{-\pi}^{\pi} (e^{i(a-n)x}+e^{-i(a+n)x}) dx$.
This is a straightforward integration. Take care when $a$ is an integer (in which case the Fourier series is trivially obtained from the above expansion).
If $a \in \mathbb{Z}$, then the formula for $\cos$ gives $f_n = \frac{1}{2} \delta_{|n||a|}$ (ie, $f_n = \frac{1}{2}$ iff $n = \pm a$).
If $a \notin \mathbb{Z}$, then $\hat{f_n} = \frac{1}{4 \pi} \int_{-\pi}^{\pi} (e^{i(a-n)x}+e^{-i(a+n)x}) dx = \frac{1}{4 \pi}( \left.\frac{e^{i(a-n) x}}{i (a-n)}\right|_{-\pi}^{\pi} + \left.\frac{e^{-i(a+n) x}}{-i (a+n)}\right|_{-\pi}^{\pi})$, noting that $e^{i n \pi} = (-1)^n$, we have
$$ \hat{f_n} = \frac{1}{4 \pi i} (-1)^n( \frac{e^{i a\pi} - e^{-i a\pi}}{a-n} - \frac{e^{-i a\pi} - e^{i a\pi}}{a+n}) \\ = \frac{1}{4 \pi i} (-1)^n (e^{i a\pi} - e^{-i a\pi})(\frac{1}{a-n} + \frac{1}{a+n})\\ = \frac{1}{2 \pi}(-1)^n \sin ( a \pi) \frac{2 a}{a^2-n^2} \\ = \frac{1}{ \pi}(-1)^{n+1} \sin ( a \pi) \frac{a}{n^2-a^2} $$