# Fourier series of $cos(\omega_0 t)$ in continuous time

Can any one please help me with understanding how we can calculate the Fourier series of Cos(w0t) using the formula:

I saw that they did the following calculus, but I Don't really understand how we calculate the integral of Xs[k] in this case:

It'll be so helpful if someone can solve it step by step.

The summation distracts a little bit, since $\delta[k]=1 \iff k=0$, only two terms of the infinit sum are non-zero; the terms at $k=\pm 1$.

$\sum_{-\infty}^\infty=\dots+0+\frac{1}{2}\delta[0]e^{-j\omega_0t}+0+\frac{1}{2}\delta[0]e^{j\omega_0t}+0+\dots=$
$\frac{1}{2}e^{-j\omega_0t}+\frac{1}{2}e^{j\omega_0t}=cos(\omega_0t)$ (Complex cosine)

So just input $x(t)=\frac{1}{2}e^{-j\omega_0t}+\frac{1}{2}e^{j\omega_0t}$ into the formula, giving:

$$\frac1T\int_\alpha ^{\alpha+T} x(t) e^{-j\omega_0 kt}dt=\frac{1}{T}\int_0 ^{T} (\frac{1}{2}e^{-j\omega_0t}+\frac{1}{2}e^{j\omega_0t})e^{-j\omega_0 kt}dt$$
$$=\frac{1}{2T}\int_0 ^{T} (e^{-j\omega_0t(1+k)}+e^{j\omega_0t(1-k)})dt$$

Which can be easily solved. Note that $\alpha$ can be chosen arbitrary, usually $0$ or $T/2$.

They did not actually solve the integral, they just used a version of Euler's formula:

$$\cos(\omega_0t)=\frac12\left(e^{j\omega_0t}+e^{-j\omega_0t}\right)$$

which already is the Fourier series of $\cos(\omega_0t)$. Comparing $(1)$ to the formula for the Fourier series, you see that all coefficients are zero except for the ones with indices $k=1$ and $k=-1$, and they equal $\frac12$.