Integrate expression with 3 multiplications $\int_0^{\frac\pi4}{x\cos(x)\sin(2nx)}dx$ Specifically I want to integrate the following:
$$\int_0^{\frac\pi4}{x\cos(x)\sin(2nx)}$$
I do know that
$$\frac4{\pi}\int_0^{\frac\pi4}{x\cos(x)\sin(2nx)} = \dfrac{-16\cos(n\pi)}{(4n^2-1)^2{\pi}}$$
I just have no idea how to integrate it. I tried using trig identities to simplify the expression something by parts could be used for, but I got a very wrong answer.
 A: Let
$$I(n)=-\frac12\int_0^{\frac\pi2}{\cos(x)\cos(2nx)}dx
= \frac{\cos n\pi}{2(4n^2-1)}
$$
Then
$$\frac4\pi\int_0^{\frac\pi2} x\cos(x)\sin(2nx)dx
=\frac4\pi\frac {dI(n)}{dn}
= -\frac{16n\cos n\pi}{(4n^2-1)^2\pi}
$$
A: Using prostapheresis formulas:
$$\sin(p)+\sin(q)=2\cdot\sin\left(\frac{p+q}{2}\right)\cdot\cos\left(\frac{p-q}{2}\right)$$
One can write:
$$\left\{\begin{matrix}
\frac{p+q}{2}=2nx
\\\frac{p-q}{2}=x
\end{matrix}\right.$$
Which leads to:
$$\left\{\begin{matrix}
q=(2n-1)x
\\p=(2n+1)x
\end{matrix}\right.$$
So:
$$\int_0^{\pi/4}{x\cos(x)\sin(2nx)}=\frac{1}{2}\int_{0}^{\pi/4}x\cdot\sin((2n+1)x)dx+\frac{1}{2}\int_{0}^{\pi/4}x\cdot\sin((2n-1)x)dx$$
Evaluating, one get:
$$\frac{1}{2}\cdot\left[-\frac{x\cdot\cos((2n+1)x)}{2n+1}+\frac{\sin((2n+1)x)}{(2n+1)^2}\right]_{0}^{\pi/4}+\frac{1}{2}\cdot\left[-\frac{x\cdot\cos((2n-1)x)}{2n-1}+\frac{\sin((2n-1)x)}{(2n-1)^2}\right]_{0}^{\pi/4}$$
Now, $(2n+1)x=(2n-1)x+2x$. For $x=\frac\pi4$, one have:
$$\sin\left(\frac{(2n+1)\pi}4\right)=\sin\left(\frac{(2n-1)\pi}4+\frac\pi2\right)=\sin\left(\frac{(2n-1)\pi}4\right)$$
And:
$$\cos\left(\frac{(2n+1)\pi}4\right)=\cos\left(\frac{(2n-1)\pi}4+\frac\pi2\right)=-\cos\left(\frac{(2n-1)\pi}4\right)$$
Can you take it from here?
A: Using $$\cos x \sin 2 n x=\frac{1}{2}[\sin (2 n+1) x+\sin (2 n-1) x],$$
we have
$$
\begin{aligned}
&\quad \int_0^{\frac{\pi}{2}} x \cos x \sin 2 n x d x\\& =\frac{1}{2}\left[\int_0^{\frac{\pi}{2}} x[\sin (2 n+1)+\sin (2 n-1) x] d x\right] \\
& =-\frac{1}{2} \int_0^{\frac{\pi}{2}} x d\left(\frac{\cos (2 n+1) x}{2 n+1}+\frac{\cos (2 n-1) x}{2 n-1}\right) \\
& =-\frac{1}{2}\left(x\left[\frac{\cos (2 n+1) x}{2 n+1}+\frac{\cos (2 n-1) x}{2 n-1}\right]_0^{\frac{\pi}{2}}-\int_0^{\frac{\pi}{2}} \frac{\cos (2 n+1) x}{2 n+1} d x-\frac{\cos (2 n-1) x}{2 n-1} d x\right) \\
& =\frac{1}{2}\left[\frac{\sin (2 n+1) x}{(2 n+1)^2}+\frac{\sin (2 n-1) x}{(2 n-1)^2}\right]_0^{\frac{\pi}{2}}\\&= \frac{(-1)^n}{2\left(4n^2-1\right)^2}\left[(2 n-1)^2-(2 n+1)^2\right]\\&=-\frac{4 n \cos n \pi}{\left(4 n^2-1\right)^2}
\end{aligned}
$$
