I have to calculate the Fourier coefficients of $ \sin (2 \pi f_0 t) $.
I try to apply the definition and afterwards I start to rewrite $\sin$ with Euler formulas:
$$ \frac{1}{f_0}\int_{\frac{-\pi}{2}}^{\frac{\pi}{2}} \frac{e^{2 i \pi f_0 t} - e^{-2 i \pi f_0 t}}{2i}e^{-2 i \pi f_0 t}dt .$$ I obtained $ \frac{1}{2f_0i} [\pi + \frac{\sin(4\pi f_0) \frac{\pi}{2}}{2\pi f_0}]$. But the result should be $\frac{1}{2}e^{-i\frac{\pi}{2}} $ if k = 1 $\frac{1}{2}e^{i\frac{\pi}{2}} $ if $k = -1$ and $0$ if $k $ is different from $1$.
Can you help me to understand how to solve this exercise ?
The intuition of Fourier series is that a periodic function can be expressed as the sum of sinusoidal functions with frequencies equal to $kf_0$, or multiples of the fundamental frequency (which is $f_0$). Since the given function is a(one) sinusoid, $sin(2\pi{f_0}t)$, we should immediately get that the non-zero Fourier coefficients will be only at $k=\pm 1$, so
$c_k = 0$ at $k\neq\pm1 $.
Now, for $k=1$, we proceed to the definition (formula is copied from your question, but corrected): $$c_k = \frac{1}{T_0}\int_{0}^{T_0} \frac{e^{2 i \pi f_0 t} - e^{-2 i \pi f_0 t}}{2i}e^{-2 i \pi f_0 t}dt.$$ Where $T_0 = 1/f_0$. Solving that, we have:
$$\begin{align} c_k &= \frac{1}{2i T_0}\int_{0}^{T_0} {(e^{2 i \pi f_0 t}e^{-2 i \pi f_0 t} - e^{-2 i \pi f_0 t}e^{-2 i \pi f_0 t})}dt\\ &= \frac{1}{2i T_0}\int_{0}^{T_0} 1 - e^{-4 i \pi f_0 t}dt\\ ...&= \frac{1}{2i T_0}(T_0 - \frac{1-e^{-4i\pi}}{4i\pi f_0}) \end{align}$$
but $e^{-4\pi i} = cos(-4\pi) + i\ sin(-4\pi) = 1 + 0i = 1$, so we are left with $$c_k = \frac{1}{2i T_0} (T_0) = \frac{1}{2i}.$$
The given answer ($c_k=\frac{1}{2} e^{-i \frac{\pi}{2}}$ for $k=1$), will just be equal to $\frac{1}{2i}$, because $e^{-i \frac{\pi}{2}} = cos(-\frac{\pi}{2}) + i\ sin(-\frac{\pi}{2}) = 0 + (-1)i= -i = \frac{1}{i}.$
The case for $k=-1$ is similar to the computation above.