As it is a kinda famous integral I thought I would find something on MSE but I didn't so here I am. If there is, link it in the comments and I will delete the question.
How do I evaluate $$\int_{-\pi}^{\pi} \cos(ax) \sin^n(bx) dx$$ $$a,b,n \in \mathbb{Z}, b\neq0, n\geq 0$$
The answer is $$\begin{cases} (-1)^{n/2} (-1)^m \frac{2 \pi}{2^n} \binom{n}{m} & n \text{ even},\ |a| = |b (2m-n)| \\ 0 & \text{otherwise} \end{cases}$$ $$m \geq 0$$
If $n$ is odd, you are integrating an odd function over an interval that is symmetric with respect to the origin, hence the answer is $0$. If $n$ is even, compute the Fourier cosine series of $\sin^n(bx)$ by exploiting the De Moivre identity and the binomial theorem. Since: $$\int_{-\pi}^{\pi}\cos(ax)\cos(mx)\,dx = \pi\cdot \delta_{a,m},$$ the integral will be $\pm\pi$ times a binomial coefficient times a power of two iff $b\mid a$, zero otherwise.