Evaluate trig function integral I was struggling to evaluate this integral:
$$\int x\sin^2(4x)\;dx$$
Every time I try again I end up with a different answer, my most recent answer I came up with is 
$$-\frac1{12} x\cos^3(4x) + \frac1{16}\sin^4(4x) + C$$
but I was wrong again.
I don't have a reference for what the answer actually is because we have to do the work online and we don't know the correct answer until we submit the correct one. I was just seeing if anyone could point me the right direction. 
Thank you!
-Frank

Using $\cos 2A = 1 - 2\sin^2 A$ we get
$$\int x\sin^2 4x\,\mathbb d x = \int \tfrac12 x(1-\cos 8x)\, \mathbb d x$$
And
$$\int x\cos 8x \, \mathbb d x = \tfrac18x\sin 8x - \tfrac18 \int \sin 8x \, \mathbb d x$$
So $$\int x\sin^2 4x\,\mathbb d x = - \tfrac1{16}x\sin 8x +\int \tfrac12 x  + \tfrac1{16} \int \sin 8x \, \mathbb d x$$
