Integrar por partes,
$$\begin{align} I & = \int {1 \over (a\sin x + b\cos x)^n } dx\\ & = -\frac{1}{a^2+b^2}\int {1 \over (a\sin x + b\cos x)^{n-2} } d\left({a\cos x - b\sin x\over a\sin x + b\cos x} \right) \\ & = -\frac{1}{a^2+b^2}{a\cos x - b\sin x\over (a\sin x + b\cos x)^{n-1}} -\frac{n-2}{a^2+b^2}\int {(a\cos x - b\sin x)^2\over (a\sin x + b\cos x)^{n} } dx\\ &= -\frac{1}{a^2+b^2}{a\cos x - b\sin x\over (a\sin x + b\cos x)^{n-1}} + \frac{n-2}{a^2+b^2} \int {dx \over (a\sin x + b\cos x)^{n-2} } +(n-2)I \\ \end{align}$$
donde $(a\cos x - b\sin x)^2 = (a^2+b^2) - (a\sin x + b\cos x)^2 $ se utiliza. Así, $$I=\frac{A\sin x+ B\cos x}{(a\sin x+b\cos x)^{n-1}}+C \int \frac{dx}{(a\sin x+b\cos x)^{n-2}}$$
donde $A=bc,\>B =-ac,\> C = (n-2)c$ con $c={1\over (n-1)(a^2 + b^2)}$ .