Answer: \(\dfrac{\mathrm{d}y}{\mathrm{d}x}=\cos2x-2x\sin2x\), and \(\displaystyle \int x\sin2x\,\mathrm{d}x=-\frac12x\cos2x+\frac14\sin2x+c\).
(a) Use the product rule on
\(y=x\cos2x\).
The derivative of \(x\) is \(1\), and the derivative of \(\cos2x\) is \(-2\sin2x\). Hence
\(\dfrac{\mathrm{d}y}{\mathrm{d}x}=1\cdot\cos2x+x(-2\sin2x)\).
So
\(\dfrac{\mathrm{d}y}{\mathrm{d}x}=\cos2x-2x\sin2x\).
(b) From part (a),
\(\dfrac{\mathrm{d}}{\mathrm{d}x}(x\cos2x)=\cos2x-2x\sin2x\).
Rearrange this to make \(x\sin2x\) the subject:
\(2x\sin2x=\cos2x-\dfrac{\mathrm{d}}{\mathrm{d}x}(x\cos2x)\),
so
\(x\sin2x=\frac12\cos2x-\frac12\dfrac{\mathrm{d}}{\mathrm{d}x}(x\cos2x)\).
Integrating both sides gives
\(\displaystyle \int x\sin2x\,\mathrm{d}x=\frac12\int\cos2x\,\mathrm{d}x-\frac12x\cos2x+c\).
Since \(\int\cos2x\,\mathrm{d}x=\frac12\sin2x\),
\(\displaystyle \int x\sin2x\,\mathrm{d}x=\frac14\sin2x-\frac12x\cos2x+c\).