Linear First Order ODE/x y' + y = x^2 cosine x

Theorem
The linear first order ODE:
 * $x \, \dfrac {\mathrm d y} {\mathrm d x} + y = x^2 \cos x$

has the solution:
 * $y = 2 \cos x + x \sin x - \dfrac 2 x \sin x + \dfrac C x$