Given differential equation is
xydydx=(x+2)(y+2)
yy+2dy=x+2xdx
Integrating both sides,
∫yy+2dy=∫(1+2xdx)
⇒∫(1−2y+2)dy=∫(1+2xdx)
⇒y−2log|y+2|=x+2log|x|+C
Given that y = -1 when x = 1
Therefore, −1−2log|1|=1+2log|1|+C
⇒C=−2
Therefore the required solution is
y−2log|y+2|=x+2log|x|−2