How do we prove $$\int\dfrac{\sin^nx}{\cos^mx}dx=\dfrac{\sin^{n-1}x}{(m-1)\cos^{m-1}x}-\dfrac{n-1}{m-1}\int\dfrac{\sin^{n-2}x}{\cos^{m-2}x}dx,m\ne-1?$$
At first I decided to take $m=n$. In this case we can write the given integral as $$-\int\dfrac{\sin^{n+2}x}{\cos^nx}d\cot x=-\dfrac{1}{1-n}\int\sin^2xd(\cot^{-n+1}x)=\\\dfrac{1}{n-1}\sin^2x\cot^{-n+1}x-\dfrac{1}{n-1}\int\cot^{-n+1}xd\sin^2x=\\\dfrac{1}{n-1}\dfrac{\sin^2x\cos^{-n+1}x}{\sin^{-n+1}x}-\dfrac{1}{n-1}\int\dfrac{2\sin x\cos x\cos^{-n+1}x}{\sin^{-n+1}x}dx$$
I really don't know how to proceed when $m$ and $n$ are not equal, though. We don't even know if $n>m$ (or the other way around) which seems to be important in my try which is for $n=m$. Any help would be appreciated.
I'm trying to solve the problem by integration by parts.