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

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

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