Determine indefinite-integral: $$\text{I}=\int \sin^{n-1}x\sin\left[(n+1)x\right]\text{d}x$$
My tried:
$$\text{I}=\int \sin^{n-1}x\sin\left[(n+1)x\right]\text{d}x=-\int\sin^{n-2}x\sin\left[(n+1)x\right]d(\cos x)$$
$$=- \sin^{n-2}x\sin\left[(n+1)x\right]\cos x+\int \left[(n-2)\sin^{n-3}x\sin\left[(n+1)x\right]\right]\cos^2xdx$$
$$+\int \sin^{n-2}x (n+1)\cos\left[(n+1)x\right]\cos xdx$$
$$=- \sin^{n-2}x\sin\left[(n+1)x\right]\cos x+(n-2)\int \sin^{n-3}x\sin\left[(n+1)x\right]dx-(n-2)I$$
$$+(n+1)\int \sin^{n-2}x\cos\left[(n+1)x\right]\cos xdx$$
Come here I don't know how, please help me.
Switching to exponential notation we have sin(n+1)x = $ \dfrac{e^{i(n+1)x} - e^{i(n-1)x}}{2i}$ and $sin^{(n-1)}x = \big [ \dfrac{e^{ix} - e^{-ix}}{2i}]^{n-1}$.
Using the binomial theorem this last is $ \dfrac {\sum_{k=0}^{n-1}\binom{n}{k} u^{n-k}v^k}{(2i)^{n-1}}$ where u = $ e^{ix}$ and v = $e^{-ix}$.
These two factors can be multiplied out, giving you two sums, both in $e^{irs}$ where r varies as per what is being multiplied; with $(2i)^n$ in the denominator. Sums of exponential functions are easily integrated.
When you are done you will have two sums of length n, which you can then integrate easily. When done likely it can be recombined to form a sum of powers of sinrx and cosrx, where r is not a constant but whatever number it turns out to be.