$$ \int_{0}^{T} e^{-in{\omega}t}\,e^{im{\omega}t}\,\text dt = 0 $$

$$ \begin{aligned} P(t) &= \sum_{n=-\infty}^{\infty} C_n e^{in{\omega}t}{\rm where}n~{\rm is~an~integer} \\ C_n &= \frac{1}{T} \int_{0}^{T} P(t)e^{-in{\omega}t}\,\text dt~~{\rm and~~}C_n~{\rm may~be~complex~and~which~for~} n = 0~{\rm becomes:}\\[0.1cm] C_0 &= \frac{1}{T} \int_{0}^{T} P(t)\,\text dt \end{aligned} $$

💡 This is often used for easier integration

Solving

Both way of writing the Fourier series give the same expressions we can split it

$$ P(t) = \sum_{n=-\infty}^{\infty} C_n e^{in{\omega}t} = C_0 + \sum_{n=1}^{\infty} \left [ C_n(+n) e^{in\omega t} + C_n(-n) e^{-in\omega t} \right ] $$

If $C_n$ is purely real or imaginary then we 2 cases

  1. $C_n(+n)=C_n(-n)$:

    $$ 2 \sum_{1}^\infty C_n(+n) \cos(n \omega t) $$

  2. $C_n(+n)=-C_n(-n)$:

    $$ 2i \sum_{1}^\infty C_n(+n) \sin(n \omega t) $$