Answer
$$\frac{{\pi - 2}}{8}$$
Work Step by Step
$$\eqalign{
& \int_0^{\pi /4} {x\cos 2x} dx \cr
& {\text{Integrate by parts}} \cr
& {\text{Let }}u = x,{\text{ }}du = dx \cr
& dv = \cos 2xdx,{\text{ }}v = \frac{1}{2}\sin 2x \cr
& {\text{Integration by parts formula }} \cr
& \int {\underbrace x_u} \underbrace {\cos 2xdx}_{dv} = \underbrace {\left( x \right)}_u\underbrace {\left( {\frac{1}{2}\sin 2x} \right)}_v - \int {\underbrace {\frac{1}{2}\sin 2x}_v} \underbrace {dx}_{du} \cr
& {\text{Multiply}} \cr
& \int {x\cos 2x} dx = \frac{x}{2}\sin 2x - \frac{1}{2}\int {\sin 2x} dx \cr
& \int {x\cos 2x} dx = \frac{x}{2}\sin 2x + \frac{1}{4}\cos 2x + C \cr
& {\text{Therefore,}} \cr
& \int_0^{\pi /4} {x\cos 2x} dx = \left[ {\frac{x}{2}\sin 2x + \frac{1}{4}\cos 2x} \right]_0^{\pi /4} \cr
& = \left[ {\frac{{\left( {\pi /4} \right)}}{2}\sin 2\left( {\frac{\pi }{4}} \right) + \frac{1}{4}\cos 2\left( {\frac{\pi }{4}} \right)} \right] - \left[ {\frac{0}{2}\sin 0 + \frac{1}{4}\cos 0} \right] \cr
& {\text{Simplify}} \cr
& = \left( {\frac{\pi }{8} + 0} \right) - \left( {0 + \frac{1}{4}} \right) \cr
& = \frac{\pi }{8} - \frac{1}{4} \cr
& = \frac{{\pi - 2}}{8} \cr} $$