During exercising and example of Fourier Series , I encountered with an integration : $$ \frac{E\omega_o}{4\pi j}\int_{0}^{\frac{\pi}{\omega_o}}\Big[e^{-j\omega_o (n-1)t}-e^{-j\omega_o (n+1)t}\Big]dt $$
But next line answer is written as : $$ \frac{Ee^{-jn\frac{\pi}{2}}}{2\pi(1-n^2)}\Bigg( e^{\frac{-jn\pi}{2}}+e^{\frac{jn\pi}{2}} \Bigg) $$
But when I tried to solve this my answer became : $$ \frac{E\omega_o}{4\pi j}\frac{1}{j\omega_o(1-n^2)}\bigg[(1+n)e^{-j\pi (n-1)} +(1-n)e^{-j\pi (1+n)} -2 \bigg] $$
Where is my problem is? I checked my solution many times but don't find any.
FYI: main signal $\ x(t)=0 $ ; when $\ \frac{-\pi}{\omega_o}<t<0 $
& $\ x(t)=Esin\omega_o t $ ; when $\ 0<t<\frac{\pi}{\omega_o} $
Hint: $$\int_{0}^{\pi/\omega_0}\left(e^{-j\omega_0(n-1)t}-e^{-j\omega_0(n+1)t}\right)dt\\=-j\left(\frac{1-e^{-j\pi(n-1)}}{n-1}-\frac{1-e^{-j\pi(n+1)}}{n+1}\right)\\=-j\left(1+e^{-jn\pi}\right)\left(\frac{1}{n-1}-\frac{1}{n+1}\right)$$ where I have used the Euler's formula $e^{\pm j \pi}=-1$. I hope this clears things.