Determine spectrum amplitudes for half-wave rectified sine
You have to integrate by parts twice. Leaving out constants you have

$$\int_0^{T/2}\sin(\omega_0t)e^{-jn\omega_0t}dt=-\frac{\cos(\omega_0t)}{\omega_0}e^{-jn\omega_0t}\bigg|_0^{T/2}-jn\int_0^{T/2}\cos(\omega_0t)e^{-jn\omega_0t}dt$$

If you again perform integration by parts on the integral on the right-hand side of the above equation you get the final result:

$$\int_0^{T/2}\sin(\omega_0t)e^{-jn\omega_0t}dt=\frac{1+(-1)^n}{\omega_0}+n^2\int_0^{T/2}\sin(\omega_0t)e^{-jn\omega_0t}dt$$

If $I$ is the integral on the left-hand side you have

$$I=\frac{1+(-1)^n}{\omega_0}+n^2I$$

and finally

$$I=\frac{1+(-1)^n}{\omega_0(1-n^2)}$$

Note that you have to consider the case $n=1$ separately. Also note that you could also compute the coefficients $c_n$ by direct integration using $\sin(\omega_0t)=(e^{j\omega_0t}-e^{-j\omega_0t})/2j$.