A definite integral in Calculus I I see the following integral but I could not solve it:
$$\int_0^{\pi/2}\cos^mx\sin(mx)dx={1\over 2^{m+1}}(2+{2^2\over 2}+\cdots+{2^m\over m})$$
for each natural number m. Can you help me?
 A: $$
\begin{align}
\int_0^{\pi/2}\cos^m(x)\sin(mx)\,\mathrm{d}x
&=\operatorname{Im}\left(\int_0^{\pi/2}\left(\frac{e^{ix}+e^{-ix}}2\right)^me^{imx}\,\mathrm{d}x\right)\tag{1}\\
&=\frac1{2^m}\operatorname{Im}\left(\int_0^{\pi/2}\sum_{k=0}^{m-1}\binom{m}{k}e^{(2m-2k)ix}\,\mathrm{d}x\right)\tag{2}\\
&=\frac1{2^m}\operatorname{Im}\left(\sum_{k=0}^{m-1}\binom{m}{k}\frac{(-1)^{m-k}-1}{(2m-2k)i}\right)\tag{3}\\
&=\frac1{2^{m+1}}\sum_{k=0}^{m-1}\binom{m}{k}\frac{1-(-1)^{m-k}}{m-k}\tag{4}\\
&=\frac1{2^{m+1}}\sum_{k=1}^m\binom{m}{k}\frac{1-(-1)^{k}}k\tag{5}\\
&=\frac1{2^{m+1}}\sum_{k=1}^m\binom{m}{k}\int_0^1\left(x^{k-1}-(-x)^{k-1}\right)\mathrm{d}x\tag{6}\\
&=\frac1{2^m}\int_0^1\frac{(1+x)^m-(1-x)^m}{(1+x)-(1-x)}\mathrm{d}x\tag{7}\\
&=\frac1{2^{m+1}}\int_{-1}^1\frac{(1+x)^m-(1-x)^m}{(1+x)-(1-x)}\mathrm{d}x\tag{8}\\
&=\frac1{2^{m+1}}\sum_{k=0}^{m-1}\int_{-1}^1(1+x)^{m-k-1}(1-x)^k\,\mathrm{d}x\tag{9}\\
&=\frac12\sum_{k=0}^{m-1}\int_0^1x^{m-k-1}(1-x)^k\mathrm{d}x\tag{10}\\
&=\frac1{2m}\sum_{k=0}^{m-1}\frac1{\binom{m-1}{k}}\tag{11}\\
&=\bbox[5px,border:2px solid #C0A000]{\frac1{2^{m+1}}\sum_{k=0}^{m-1}\frac{2^{k+1}}{k+1}}\tag{12}
\end{align}
$$
Explanation:
$\phantom{0}(1)$: $\cos(x)=\frac{e^{ix}+e^{-ix}}2$ and $\operatorname{Im}(e^{imx})=\sin(mx)$
$\phantom{0}(2)$: Binomial Theorem
$\phantom{0}(3)$: integrate each term of the sum (the integral for $k=m$ is $\frac\pi2\in\mathbb{R}$)
$\phantom{0}(4)$: take the imaginary part
$\phantom{0}(5)$: substitute $k\mapsto m-k$
$\phantom{0}(6)$: $\frac1k=\int_0^1x^k\,\mathrm{d}x$
$\phantom{0}(7)$: Binomial Theorem
$\phantom{0}(8)$: integrand is even
$\phantom{0}(9)$: $\frac{x^m-y^m}{x-y}=x^{m-1}+x^{m-2}y+x^{m-3}y^2+\dots+y^{m-1}$
$(10)$: substitute $x\mapsto2x-1$
$(11)$: Beta function
$(12)$: equation $(15)$ below

Sum of the Reciprocals of Binomial Coefficients
As in equation $(8)$ from this answer,
$$
\begin{align}
a_n
&=\sum_{k=0}^n\frac1{\binom{n}{k}}\\
&=\frac1{n!}\sum_{k=0}^nk!(n-k)!\\
&=1+\frac1{n!}\sum_{k=0}^{n-1}k!(n-k-1)!\big[(n+1)-(k+1)\big]\\
&=1+\frac{n+1}n\,a_{n-1}-(a_n-1)\tag{13}\\
\frac{2^n}{n+1}\,a_n&=\frac{2^n}{n+1}+\frac{2^{n-1}}n\,a_{n-1}\tag{14}
\end{align}
$$
To get $(14)$, we add $a_n$ to both sides of $(13)$ and multiply by $\frac{2^{n-1}}{n+1}$. Solving $(14)$ yields
$$
\sum_{k=0}^n\frac1{\binom{n}{k}}=\frac{n+1}{2^n}\sum_{k=0}^n\frac{2^k}{k+1}\tag{15}
$$
A: Using Chebyshev polynomials of the second kind and the substitution $x\mapsto\frac{\pi}{2}-x$ we have:
$$\begin{eqnarray*}I(m)=\int_{0}^{\pi/2}\cos^m(x)\sin(mx)\,dx &=& \int_{0}^{\pi/2}\cos^m(x)\sin(x) U_{m-1}(\cos x)\,dx \\ &=& \int_{0}^{\pi/2}\sin^m(x)\cos(x)U_{m-1}(\sin x)\,dx\\ &=&\int_{0}^{1} x^m\,U_{m-1}(x)\,dx\end{eqnarray*}$$
but $U_m(x)=2x\cdot U_{m-1}(x)-U_{m-1}(x)$, hence:
$$ 2^m\cdot I(m) = \int_{0}^{1}(2x)^m U_{m-1}(x)\,dx = \int_{0}^{1}(2x)^{m+1} U_{m-2}(x)\,dx - \int_{0}^{1}(2x)^m U_{m-3}(x)\,dx $$ 
any by using integration by parts twice, we get:
$$ 2^{m+1}\cdot I(m) = \frac{2^m}{m}+ 2^m\cdot I(m-1) $$
from which the claim follows by induction.
A: Clever solution, Jack d'Aurizio, with Chebyshev polynomials of the second kind.
Here is another one, using only Euler's formulas:
$I(m)=\Im \int_0^{\pi/2}(\dfrac{e^{ix}+e^{-ix}}{2})^m e^{imx}dx$
$I(m)=\dfrac{1}{2^m} \Im \int_0^{\pi/2}(e^{2ix}+1)^mdx \ \ \ (*)$
$I(m)=\dfrac{1}{2^m} \Im \int_0^{\pi/2}(e^{2ix}+1)^{m-1}(e^{2ix}+1)dx$
$I(m)=\dfrac{1}{2^m} \Im \int_0^{\pi/2}(e^{2ix}+1)^{m-1}e^{2ix}dx+\dfrac{1}{2^m}\Im \int_0^{\pi/2}(e^{2ix}+1)^{m-1}dx \ \ \ (**)$ 
Let A (resp. B) be the first (resp. 2nd) term in the RHS of (**).
The integral in A is easily calculated as $f(\pi/2)-f(0)=i\dfrac{1}{2m}$ because $f(x)=\dfrac{-i}{2m}(e^{2ix}+1)^{m}$ is a  primitive function ; thus, taking the imaginary part, and dividing by $2^m$: $A= \dfrac{1}{(2^m)2m}$.
B is clearly equal to $\dfrac{1}{2}I(m-1)$ (using property (*)).
One gets, in this way, the same recurrence relationship as in Jack's solution.
