I am a bit confused by the complex Fourier Series in general, but I am working with complex Fourier Series on the form: $$\sum_{n=-\infty}^{\infty} c_ne^{inx}$$
Where the Fourier coefficient $c_n$ is defined as: $$ c_n = \frac{1}{2\pi} \int_{-\pi}^{\pi}f(y)e^{-iny}dy$$
I am then find the $c_0$ and the $c_n$ coefficient of the function on the interval $]-\pi, \pi]$ defined by:
$$f(x) := \begin{cases} 0, & \text{for $-\pi<x<0$} \\ sin(x), & \text{for $0\le x\le \pi $} \end{cases}$$
This is what I have done so far:
Note that $sin(x) = \frac{e^{ix} - e^-{ix}}{2i}$, so we have that
$$c_n = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{-inx}dx=\frac{1}{2\pi}\int_{-\pi}^{0}0(x)e^{-inx}dx+\frac{1}{2\pi}\int_{0}^{\pi}sin(x)e^{-inx}dx = \frac{1}{2\pi}\int_{0}^{\pi}(\frac{e^{ix} - e^{-ix}}{2i})e^{-inx}dx$$
What am I supposed to do here in order to find $c_0$ and $c_n$ ?
For $c_0$, you can simply do $$c_0=\frac{1}{2\pi}\int_{0}^{\pi}\sin(x)dx.$$And $$c_n=\frac{1}{2\pi}\int_{0}^{\pi}(\frac{e^{ix} - e^{-ix}}{2i})e^{-inx}dx=\frac{1}{4\pi i}\int_{0}^{\pi}e^{ix(1-n)} - e^{-ix(1+n)}dx\\=\frac{1}{4\pi i}\left[\int_{0}^{\pi}e^{ix(1-n)}dx -\int_{0}^{\pi} e^{-ix(1+n)}dx\right]$$ and integrating by parts.
EDIT: Something important missing so I add some more lines.
Bare in mind that the function is periodic on $\Large (-\pi,\pi]$, $$f(x)=\sum_{n=-\infty}^{\infty} c_ne^{inx}$$where $$c_n=\begin{cases} \frac{i}{4}&n=-1\\ -\frac{i}{4}&n=1\\ \frac{1}{\pi(1-n^2)}&n=2k\,\,\text{for some integer}\,k;k\ne1,-1\\ 0&\text{otherwise} \end{cases}$$ Since $$\frac{1}{4\pi i}\left[\int_{0}^{\pi}e^{ix(1-1)}dx -\int_{0}^{\pi} e^{-ix(1+1)}dx\right]=\frac{1}{4\pi i}\left[\pi -0\right]=\frac{-i}{4}.$$