xy'=y+x^2 cos(x)
[y=uv=>y'=u'v+uv']
xu'v+xuv'=uv+x^2 cos(x)
xu'v+u(xv'-v)=x^2 cos(x)
(*) xv'-v=0=> dv/v=dx/x => v=x
xu'x=x^2 cos(x)
u'=cos(x)
u=sin(x)+C
y=x(sin(x)+C)
xy'=y+x^2 cos(x)
[y=uv=>y'=u'v+uv']
xu'v+xuv'=uv+x^2 cos(x)
xu'v+u(xv'-v)=x^2 cos(x)
(*) xv'-v=0=> dv/v=dx/x => v=x
xu'x=x^2 cos(x)
u'=cos(x)
u=sin(x)+C
y=x(sin(x)+C)