Closed form solution for $\int_{0}^{2\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x dx$ I am trying to calculate Fourier series coefficients (by hand) and the integrals I need to solve are of the following type
$$I(N,M,n,m)=\int_{0}^{2\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x dx,$$
in which $N,M,n,m \in \{0,1,2,3\}$. I tried to use WolframAlpha / Maple to come up with a general formula because doing all the $4^4$ cases would make it impossible for me to work with that list but both didn't give a result.

It would be great if there was a way to obtain a simple closed form solution. If that is not possible is there a way to get very accurate approximation for $I(N,M,n,m)$?

 A: $$I(N,M,n,m)=\int_{0}^{\pi}|\cos^N x|\sin^M x\cos^n x\sin^m x dx \\+\int_{\pi}^{2\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x,dx$$
Set $u =x-\pi$ 
$$\int_{\pi}^{2\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x,dx\\=\int_{0}^{\pi}|\cos^N x||\sin^Mx |\cos^n (x+\pi)\sin^m (x+\pi),dx $$
So that 
$$I(N,M,n,m)=\int_{0}^{\pi}|\cos^N x|\sin^M x\cos^n x\sin^m x dx \\+(-1)^{n+m}\int_{0}^{\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x,dx$$

But $\cos(x+\pi) = -\cos x$ and $\sin(x+\pi) = -\sin x$ Hence,

\begin{split}
I(N,M,n,m)&=&\int_{0}^{\pi}|\cos^N x|\sin^M x\cos^n x\sin^m x dx \\
&+&(-1)^{n+m}\int_{0}^{\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x,dx\\
&=&[1+(-1)^{n+m}]\int_{0}^{\pi}|\cos^N x||\sin^M x|\cos^n x\sin^m x,dx\\
 &=&[1+(-1)^{n+m}]\int_{0}^{\frac{\pi}{2}}\cos^N x\sin^M x\cos^n x\sin^m x dx \\
&+&[1+(-1)^{n+m}]\int_{\frac{\pi}{2}}^{\pi} |\cos^N x||\sin^M x|\cos^n x\sin^m x dx
\end{split}

Setting  $ t= \pi-x$  and noticing that  $\cos(\pi-x) = -\cos x$ and $\sin(\pi-x) = \sin x$ We get ,

$$\int_{\frac{\pi}{2}}^{\pi} |\cos^N x||\sin^M x|\cos^n x\sin^m x dx = (-1)^n\int^{\frac{\pi}{2}}_{0} \cos^N x\sin^M x \cos^n x\sin^m x dx$$
 Therefore, 
\begin{split}
I(N,M,n,m)&=&
 [1+(-1)^{n+m}]\int_{0}^{\frac{\pi}{2}}\cos^N x\sin^M x\cos^n x\sin^m x dx \\
&+&[1+(-1)^{n+m}]\int_{\frac{\pi}{2}}^{\pi} |\cos^N x||\sin^M x|\cos^n x\sin^m x dx\\
&=& [1+(-1)^{n+m}][1+(-1)^{n}]\int_{0}^{\frac{\pi}{2}}\cos^N x\sin^M x\cos^n x\sin^m x dx
\end{split}
and
$$ [1+(-1)^{n+m}][1+(-1)^{n}]= [1+(-1)^{m}+(-1)^{n}+(-1)^{n+m}]$$

Conclusion 
  $$\bbox[yellow]{I(N,M,n,m) =[1+(-1)^{m}+(-1)^{n}+(-1)^{n+m}]\int_{0}^{\frac{\pi}{2}}\cos^{N+n} x\sin^{M+m} xdx }$$

Also note the following relation with Beta function and Gamma function \url{https://fr.wikipedia.org/wiki/Fonction_b%C3%AAta}.
$$\frac{\Gamma(x)\Gamma(y)}{\Gamma(x+y)} =B(x,y) = 2\int_{0}^{\frac{\pi}{2}}\cos^{2x-1} t\sin^{2y-1} tdt ,~~x>0,y>0$$ 
So that , 
$$\bbox[yellow]{I(N,M,n,m) =\frac{1}{2}[1+(-1)^{m}+(-1)^{n}+(-1)^{n+m}]B\left(\frac{M+m+1}{2},\frac{n+N+1}{2}\right)\\=\frac{1}{2}[1+(-1)^{m}+(-1)^{n}+(-1)^{n+m}] \frac{\Gamma\left(\frac{M+m+1}{2}\right)\Gamma\left(\frac{N+n+1}{2}\right)}
{\Gamma\left(\frac{M+N+m+n+2}{2}\right)}}$$
A: Hint: An easy way is to use the following identity which is quite easy to prove

which is an easy consequence of Integration, trigonometry, gamma/beta functions
