Finding $\int_0^{\pi/8} x\sin 2x\,dx$ I have a trigonometric equation, when integrated and evaluated should be a specific value. I cannot get that value.
The question: $$\int_0^{\pi/8} x\sin 2x\,dx$$
The answer should be 
$$\frac{4-\pi}{16\cdot 2^{1/2}}$$
--this is written in the book.
 A: Integration by parts is the "obvious" choice here, but I wanted to post an alternative method which I think is pretty darn cool. That's the Feynman-popularised (and later "The Big Bang Theory-popularised") trick of introducing a parameter and differentiating under the integral sign.
Let $\displaystyle f(x,k) = \int(-\cos kx)dx$
Note that $\displaystyle \frac{\partial f}{\partial k} = \int x\sin kx dx$
Now $\displaystyle f(x,k) = -\frac{1}{k}\sin kx$
So $\displaystyle \frac{\partial f}{\partial k} = \frac{1}{k^2}\sin kx - \frac{x}{k}\cos kx$
Hence $\displaystyle \int x\sin kx dx = \frac{1}{k^2}\sin kx - \frac{x}{k}\cos kx + C$
Note that we've solved a whole "class" of problems of the form $\displaystyle \int x\sin kx dx$. All that remains is to substitute $k=2$ to get the appropriate indefinite integral:
$\displaystyle \int x\sin 2x dx = \frac{1}{4}\sin 2x - \frac{x}{2}\cos 2x + C$
And finally work out the definite integral for the required bounds.
A: Hint: rewriting as $$\frac{1}{2}\int 2x\sin(2x)dx$$ we set $$2x=t$$ we obtain $$\frac{1}{4}\int t\sin(t)dt$$ and now integrate this by parts
A: Notice, using product rule as follows  $$\int_{0}^{\pi/8}x\sin (2x) dx$$
$$=\left[x\left(-\frac{1}{2}\right)\cos (2x)\right]_{0}^{\pi/8}-\int_{0}^{\pi/8}\left(-\frac{1}{2}\right)\cos (2x)dx$$
$$=\left[\frac{\pi}{8}\left(-\frac{1}{2}\right)\cos\frac{\pi}{4}-0\right]+\frac{1}{2}\left[\frac{1}{2}\sin (2x)\right]_{0}^{\pi/8}$$
$$=-\frac{\pi}{16}\frac{1}{\sqrt 2}+\frac{1}{2}\left[\frac{1}{2}\sin \frac{\pi}{4}-0\right]$$
$$=-\frac{\pi}{16\sqrt 2}+\frac{1}{4\sqrt 2}$$ $$=\frac{4-\pi}{16\sqrt 2}$$
