Integral $\int x\sin ax \cos x\, dx$ I'm looking for a quick and elegant  way to calculate the integral:
$$\int x\sin ax \cos x\, dx$$
It's doable by using $$\cos x=\frac{e^{ix}+e^{-ix}}2, ~~\sin ax=\frac{e^{iax}-e^{-iax}}{2i},$$
and then integrating by parts, but I find that solution too long and brute-force. Can you solve it alternatively?
Edit: 
$$\sin ax\cos x=\frac{\sin (a+1)x+\sin (a-1)x}2$$
does the trick.

Use Werner formula:
$$2\sin A\cos B=\sin(A+B)+\sin(A-B)$$
Now integrate by parts $$\int x\sin(px)\ dx=x\int\sin(px)\ dx-\int\left(\dfrac{dx}{dx}\int\sin(px)\ dx\right)dx$$
OR as $$\dfrac{d(x\cos(px))}{dx}=\cos(px)-px\sin(px)$$
Integrate both sides, $$x\cos(px)+K=\int\cos(px)\ dx-p\int x\sin(px)\ dx$$
