Solve $\int \sin ^m\left(x\right)\cos ^n\left(x\right)$ $$\int \sin ^m\left(x\right)\cos ^n\left(x\right)$$ m,n are natural numbers and I'm asked to find the recurrent formula for this integral.
Now I know there are three cases to look at namely:
$$ m>n$$
$$ m<n$$
$$ m=n$$ 
The last case I'm able to solve, but I'm not sure about the first two.
I'm using integration by parts so for example if we take the first case:
$$u=\sin ^m\left(x\right)\cos ^{n-1}\left(x\right)$$
$$dv\:=\:\int \cos \left(x\right)$$
Did I choose the wrong u and dv, because I am not able to solve it. At one point I get something like this: $\int \sin ^m\left(x\right)\cos ^{n-2}\left(x\right)$ in the expression and that's quite problematic.
 A: I may have a different approach, provided that you know some cute things like Binomial Expansion and fractional summations.
Let's start with this (this will work for every $n$ and $m$):
$$z = \sin(x) ~~~~~ \text{d}z = \cos(x) = \sqrt{1 - \sin^2(x)} = \sqrt{1 - z^2}\ \text{d}x$$
Thus
$$\text{d}x = \frac{\text{d}z}{\sqrt{1 - z^2}} ~~~~~~~ \cos^n(x) = [\cos(x)]^n = \left(\sqrt{1 - \sin^2(x)}\right)^n = (1 - z^2)^{n/2}$$
Substituting into the integral and we get
$$\int z^m(1 - z)^{n/2}\frac{\text{d}z}{\sqrt{1 - z^2}} = \int z^m(1 - z^2)^{n/2 - 1/2}\ \text{d}z$$
Let's not call for simplicity $n/2 - 1/2 = \alpha$. Now we use the Binomial Expansion:
$$(1 - z^2)^{\alpha} = \sum_{k = 0}^{\alpha} \binom \alpha k (-z^2)^k\ \text{d}z$$
Thus substituting we get:
$$\sum_{k = 0}^{\alpha} \binom \alpha k (-1)^k\int z^{m+2k}\ \text{d}z$$
A trivial integration will lead us to
$$\sum_{k = 0}^{\alpha} \binom \alpha k (-1)^k \frac{z^{m+2k+1}}{m+2k+1}$$
Now substituting back for $z = \sin(x)$, and $\alpha = \frac{n-1}{2}$ we have
$$\boxed{\sum_{k = 0}^{\frac{n-1}{2}} \binom{\frac{n-1}{2}}{ k} (-1)^k \frac{\sin^{m+2k+1}(x)}{m+2k+1}}$$
Simple proof
Supposing we have $n = m = 1$, namely we are integrating $\int\sin(x)\cos(x)\ \text{d}x$ then we have
$$\frac{n-1}{2} = 0 ~~~~~~~ m + 2k + 1 = 1 + 0 + 1 = 2$$
thence
$$\int\sin(x)\cos(x)\ \text{d}x = \sum_{k = 0}^{0} \binom{0}{0} (-1)^0 \frac{\sin^{2}(x)}{2} = \frac{\sin^2(x)}{2}$$
A: Integration by parts yields:
$$\int\sin^m(x)\cos^n(x)dx=-\frac1{m+1}\sin^{m+1}(x)\cos^{n+1}(x)-\frac{n+1}{m+1}\int\sin^{m+2}(x)\cos^{n}(x)dx$$
Turning this around, you get:
$$\frac{n+1}{m+1}\int\sin^{m+2}(x)\cos^{n}(x)dx=-\left(\frac1{m+1}\sin^{m+1}(x)\cos^{n+1}(x)+\int\sin^m(x)\cos^n(x)dx\right)$$
$$\int\sin^{m+2}(x)\cos^{n}(x)dx=-\left(\frac1{n+1}\sin^{m+1}(x)\cos^{n+1}(x)+\frac{m+1}{n+1}\int\sin^m(x)\cos^n(x)dx\right)$$
And so, if $m$ is even, the solution will eventually be found.  If $m$ is odd, you could use $\int\sin(x)\cos^n(x)dx=-\cos^{n+1}(x)$
I shall attempt at the general solution, but it will be messy.
$$\int\sin^{m+2}(x)\cos^{n}(x)dx=-\frac1{n+1}\sin^{m+1}(x)\cos^{n+1}(x)+\frac{m+1}{(n+1)^2}\sin^{m-1}(x)\cos^{n+1}(x)-\frac{(m+1)(m-1)}{(n+1)^3}\sin^{m-3}(x)\cos^{m+1}(x)\dots$$
$$\int\sin^{m+2}(x)\cos^{n}(x)dx=\cos^{m+1}(x)\sum_{i=0}^{\infty}\frac{(-1)^{i+1}(m+i)!}{m!(n+1)^{i+1}}\sin^{m-2i+1}(x)$$
Only use the summation until $m-2i+1=0,1$, then evaluate the last remaining integral.  I don't believe the summation converges.
