Show that for every integer $n$,
$$\int_0^{\pi} \cos nt~\sin t~\mathrm{d}t = \begin{cases} \dfrac{2}{1-n^2} & \text{if } n \text{ is even} \\[10pt] 0 &\text{if } n \text{ is odd} \end{cases}$$
by using Euler's formulas relating trigonometric and exponential functions:
$$\cos x=\frac{1}{2}(\mathrm{e}^{ix}+\mathrm{e}^{-ix}), \ \ \ \sin x=\frac{1}{2i}(\mathrm{e}^{ix}-\mathrm{e}^{-ix})$$
(Here $i$ is the imaginary unit; remember that $\mathrm{e}^{\pi i} = -1$)
I am not sure how to go about doing this problem, if anyone could help it would be much appreciated, thank you for your help in advance.
Consider if the function is even or odd for $n$ even or odd (with respect to the mid point $\pi /2$), this will get your odd case dealt with. To deal with the even case, use the double angle formula repeatedly.