Let's write #y# as #y(x)#, to remind that it is a function of #x#.
Let #u(x)=xy(x)#.
#:. e^(u(x)) cos(u(x))=2#
Differentiate both sides with respect to #x# and use the product rule:
#[e^(u(x))]'cos(u(x))+e^(u(x))[cos((u(x))]'=0#
Using the chain rule, we get that:
#[e^(u(x))]'=u'(x)e^(u(x))#
#[cos(u(x))]'=-sin(u(x))*u'(x)#
As such,
#u'(x)e^(u(x))cos(u(x))-u'(x)e^(u(x))sin(u(x))=0#
#u'(x)e^(u(x))(cos(u(x))-sin(u(x))=0#
Finally, the derivative of #u# is
#u'(x)=[xy(x)]'=x'y(x)+xy'(x)=y(x)+xy'(x)#
As such, the derivative of our function is
#(y(x)+xy'(x))e^(xy(x))(cos(xy(x))-sin(xy(x)))=0#
#(y+x("d"y)/("d"x))e^(xy)(cosxy-sinxy)=0#
#y+x("d"y)/("d"x)=0 => ("d"y)/("d"x) = -y/x#