Solve differential equation $ (dy/dx)(x^2) + 2xy = \cos^2(x)$ $(dy/dx)(x^2) + 2xy = \cos^2(x)$
$(dy/dx) + 2y/x = \cos^2 x$
I multiplied both sides by $e^{2\ln\ x + c}$, then rewrote the equation as
$(d/dx)(y* e^{2\ln\ x + c}) = (\cos^2(x)/x^2)*(e^{2\ln\ x + c})$
Now when I try to integrate, the right side becomes complicated. 
Am I going about this the wrong way? I'm following the textbook.

The left-hand side is the derivative of $x^2y$. Let $u=x^2y$. Solving the differential equation $\frac{du}{dx}=\cos^2 x$ is a routine integration.   
