Calculus Generalisation $$
\mbox{How should I integrate}\quad
\int_{0}^{\pi/2}
\cos^{2011}\left(\,x\,\right)\sin\left(\,2013x\,\right)\,\mathrm{d}x\ ?.
$$
I am stuck with the reduction formula which is coming out to be $\left(\,2n + 2\,\right)I_{n} = 1 + nI_{n-1}$. Also can this be generalised for
$$
\int_{0}^{\pi/2}\cos^{n}\left(\,x\,\right)
\sin\left(\,\left(\,n + 2\,\right)x\,\right)\,\mathrm{d}x
$$
 A: Let $$J(n) = \int_0^{\pi/2} \cos^n(x) \sin((n+2) x)\; dx $$
Using complex exponentials, we can write this as
$ J(n) = \text{Im}(A(n))$, where
$$ \eqalign{ A(n) &= \int_0^{\pi/2} \cos^n(x) e^{i(n+2)x} \; dx \cr
&= \int_0^{\pi/2} e^{2ix} 2^{-n}\left( e^{2ix+1}+1\right)^n\; dx}$$
The generating function of this, which should converge at least for $|t|<1$, is
$$ \eqalign{f(t) &= \sum_{n=0}^\infty A(n) t^n \cr &= \int_0^{\pi/2} e^{2ix} \sum_{n=0}^\infty ((e^{2ix}+1) t/2)^n \; dx\cr
&= \int_0^{\pi/2} \frac{2 e^{2ix}}{2-t-t e^{2ix}} \; dx\cr
& = \left. \frac{i \ln(2-t-t e^{2ix})}{t}\right|_{x=0}^{\pi/2}\cr
&= \frac{-i \ln(1-t)}{t}\cr
&= i \sum_{n=0}^\infty \frac{t^n}{n+1}}$$
Thus $A(n) = i/(n+1)$ and $J(n) = 1/(n+1)$.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\int_{0}^{\pi/2}\cos^{2011}\pars{x}\sin\pars{2013x}\,\dd x =
\Im\int_{0}^{\pi/2}\cos^{2011}\pars{x}\expo{2013x\ic}\,\dd x
\\[5mm] = &\
\left.\Im\int_{x = 0}^{x = \pi/2}\pars{z + 1/z \over 2}^{2011}z^{2013}
\,{\dd z \over \ic z}\,\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[5mm] = &\
\left.-\,{1 \over 2^{2011}}\,\Re\int_{x = 0}^{x = \pi/2}\pars{1 + z^{2}}^{2011}
\,z\,\dd z\,\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[5mm] = &\
{1 \over 2^{2011}}\,\Re\int_{1}^{0}\pars{1 - y^{2}}^{2011}
\pars{\ic y}\ic\,\dd y +
\,{1 \over 2^{2011}}\,\Re\int_{0}^{1}\pars{1 + x^{2}}^{2011}\ x\,\dd x
\\[5mm] = &\
{1 \over 2^{2012}}\int_{0}^{1}\pars{1 - y}^{2011}\,\dd y +
\,{1 \over 2^{2012}}\int_{0}^{1}\pars{1 + x}^{2011}\,\dd x
\\[5mm] = &\
{1 \over 2^{2012}}\,{1 \over 2012} +
{1 \over 2^{2012}}\,{2^{2012} - 1 \over 2012} =
\bbx{1 \over 2012}
\end{align}
