Evaluate the general integral $\int \sin(ax) \sin^b(x) dx $ Evaluate the indefinite integral
$$I(a,b)=\int \sin(ax) \sin^b(x)\mathrm{d}x \hspace{40pt} a,b\in\mathbb{N}$$
How do we evaluate the above indefinite integral?
Here is a question with $a=2015$ and $b=2013$, I was thinking of generalising this integral , so I tried using complex numbers by letting $z=\cos x+i\sin x$ , therefore $\mathrm{d}z=i ~z \mathrm{d}x$ and $\sin(ax)=\Im{(z^a)}$, so our integral converts to $$\Im{\left[\int z^a \left(\frac{z^2-1}{2iz}\right)^b \frac{\mathrm{d}z}{iz}\right] }=\frac{1}{2^{b}}\Im{\left[\frac{1}{i^{b+1}}\int z^{a-b-1}(z^2-1)^b\mathrm{d}z\right]} $$
Should we proceed further by binomial theorem?
Or possibly, a recurrence relation can be made...
Or it could be that it is not possible to do by hand...
 A: Case $1$: $b$ is even
Then $\int\sin ax\sin^{2n}x~dx$
$=\int\dfrac{C_n^{2n}\sin ax}{4^n}~dx+\int\sum\limits_{k=1}^n\dfrac{(-1)^kC_{n+k}^{2n}\cos2kx\sin ax}{2^{2n-1}}~dx$
(according to https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Power-reduction_formulae)
$=\int\dfrac{(2n)!\sin ax}{4^n(n!)^2}~dx+\int\sum\limits_{k=1}^n\dfrac{(-1)^k(2n)!\sin((2k+a)x)}{4^n(n+k)!(n-k)!}~dx-\int\sum\limits_{k=1}^n\dfrac{(-1)^k(2n)!\sin((2k-a)x)}{4^n(n+k)!(n-k)!}~dx$
$=\sum\limits_{k=1}^n\dfrac{(-1)^k(2n)!\cos((2k-a)x)}{4^n(n+k)!(n-k)!(2k-a)}-\sum\limits_{k=1}^n\dfrac{(-1)^k(2n)!\cos((2k+a)x)}{4^n(n+k)!(n-k)!(2k+a)}-\dfrac{(2n)!\cos ax}{4^n(n!)^2a}~dx+C$
Case $2$: $b$ is odd
Then $\int\sin ax\sin^{2n+1}x~dx$
$=\int\sum\limits_{k=0}^n\dfrac{(-1)^kC_{n+k+1}^{2n+1}\sin((2k+1)x)\sin ax}{4^n}~dx$
(according to https://en.wikipedia.org/wiki/List_of_trigonometric_identities#Power-reduction_formulae)
$=\int\sum\limits_{k=0}^n\dfrac{(-1)^k(2n+1)!\cos((2k-a+1)x)}{2^{2n+1}(n-k)!(n+k+1)!}~dx-\int\sum\limits_{k=0}^n\dfrac{(-1)^k(2n+1)!\cos((2k+a+1)x)}{2^{2n+1}(n-k)!(n+k+1)!}~dx$
$=\sum\limits_{k=0}^n\dfrac{(-1)^k(2n+1)!\sin((2k-a+1)x)}{2^{2n+1}(n-k)!(n+k+1)!(2k-a+1)}-\sum\limits_{k=0}^n\dfrac{(-1)^k(2n+1)!\sin((2k+a+1)x)}{2^{2n+1}(n-k)!(n+k+1)!(2k+a+1)}+C$
