From the given differentiate each term of both sides with respect to x
#2=(x+2y)^2-xy-e^(3x+y^2)#
#d/dx(2)=d/dx(x+2y)^2-d/dx(xy)-d/dx(e^(3x+y^2))#
#0=2(x+2y)^(2-1)*d/dx(x+2y)-xdy/dx-y*d/dx(x)-e^(3x+y^2)*d/dx(3x+y^2)#
#0=2(x+2y)^(1)*(1+2y')-xy'-y*1-e^(3x+y^2)*(3+2yy')#
#0=(2x+4y)(1+2y')-xy'-y-e^(3x+y^2)(3+2yy')#
Expand then simplify
#0=2x+4y+4xy'+8yy'-xy'-y-3e^(3x+y^2)-2yy'e^(3x+y^2)#
Transpose those terms with y' to the left of the equation
#-4xy'-8yy'+xy'+2yy'e^(3x+y^2)=2x+4y-y-3e^(3x+y^2)#
factor out the #y'#
#(-4x-8y+x+2ye^(3x+y^2))y'=2x+4y-y-3e^(3x+y^2)#
simplify
#(-3x-8y+2ye^(3x+y^2))y'=2x+3y-3e^(3x+y^2)#
divide both sides by #(-3x-8y+2ye^(3x+y^2))#
#(-3x-8y+2ye^(3x+y^2))y'=2x+3y-3e^(3x+y^2)#
#cancel((-3x-8y+2ye^(3x+y^2))y')/cancel((-3x-8y+2ye^(3x+y^2)))#
#=(2x+3y-3e^(3x+y^2))/(-3x-8y+2ye^(3x+y^2))#
and
#y'=(2x+3y-3e^(3x+y^2))/(-3x-8y+2ye^(3x+y^2))#
God bless....I hope the explanation is useful.