Tricky trignometric integral. Any ideas? I have been scratching my head with this integral. Any ideas that I could try?
$$ \int_0^{\pi}\sin(\theta) \cos(\theta)^{n+m}\left(1-a\tan(\theta)\right)^m d\theta$$
 A: We have:
$$\begin{array}{ll}\int_0^\pi\sin(\theta)\cos(\theta)^{n+m}(1-a\tan(\theta))^md\theta&=\int_0^\pi\sin(\theta)\cos(\theta)^n(\cos(\theta)-a\sin(\theta))^md\theta\\&=\sum_{k=0}^m(-a)^{m-k}\binom{m}{k}\int_0^\pi \cos(\theta)^{n+k}\sin(\theta)^{m-k+1}d\theta\end{array}$$
And this integral I think you can easily solve using the usual methods.

How I would do it:
If $n+k$ is odd, then $\cos(\theta)^{n+k}$ is antisymmetric around $\frac{\pi}{2}$, and thus integration gives $0$.
If $n+k$ is even, we integrate by parts (integrating $\cos(\theta)^{n+k}\sin(\theta)$) to obtain for $k\neq m$:
$$\int_0^\pi\cos(\theta)^{n+k}\sin(\theta)^{m-k+1}d\theta=$$
$$=\left[\frac{1}{n+k+1}\cos(\theta)^{n+k+1}\sin(\theta)^{m-k}\right]_0^\pi-\int_0^\pi\frac{m-k}{n+k+1}\cos(\theta)^{n+k+2}\sin(\theta)^{m-k-1}=$$
$$-\frac{m-k}{n+k+1}\int_0^\pi\cos(\theta)^{n+k+2}\sin(\theta)^{m-k-1}=$$
$$=\cases{\int_0^\pi\cos(\theta)^{n+k+2l}\sin(\theta)d\theta\prod_{l=0}^{\frac{m-k}{2}}(-1)\frac{m-k-2l}{n+1+2l+k}&if $m-k$ is even\\ \int_0^\pi\cos(\theta)^{n+k+2l}d\theta\prod_{l=0}^{\frac{m-k-1}{2}}(-1)\frac{m-k-2l}{n+1+2l+k}&if $m-k$ is odd}$$
So the only thing left to do is to integrate for $m=k$ and for $m+1=k$ and sum. The integration is straightforward:
$$\int_0^\pi\cos(\theta)^{s}\sin(\theta)d\theta=\left[\frac{1}{s+1}\cos(\theta)^{s+1}\right]_0^{\pi}=-\frac{2}{s+1}$$
$$\int_0^\pi\cos(\theta)^sd\theta=\int_{S^1}\left(\frac{z+\frac{1}{z}}{2}\right)^sizdz=\cases{0 &if $s$ is odd\\ -2^{s-1}\pi\binom{s}{\frac{s}{2}}&else}$$
The resulting sum is quite a mess, but you can try to find a closed form if you want...
