Let y =vx

=>dy/dx=v+xdv/dx

Now given equation is

x^2dy+(xy+y^2)dx=0

=> dy/dx=-y/x -(y/x)^2

=>v+xdv/dx=-v-v^2

=>xdv/dx=-v^2-2v

=>dx/x=dv/(-v^2-2v)

=>dx/x=-dv/(v(v+2))

=>dx/x=1/2[dv/(v+2)-dv/v]

Integrating we get

=>2logx=log(v+2)-logv +logc

=>log[(vx^2)/(v+2)]=logc

=>xy/((y/x+2)=c

=>x^2y/(2x+y)=c