x=1 & y=0
Now,
(x−y)dydx=x+2y⇒dydx=x+2yx−y
∵ The above equation is Homogenous Differential Equation,
∴ Let y=vx ___(1) ⇒dydx=v+xdvdx
⇒dydx=x+2yx−y⇒V+xdvdx=x+2vxx−vx
⇒xdvdx+V=1+2V1−V⇒xdvdx=1+2v1−v−v
⇒xdvdx=1+2v−v+v21−v⇒xdvdx=1+v+v21−v
⇒(1−v)dv1+v+v2=dxx
Integrating both sides, we have
∫(1−v)dv1+v+v2=∫dxx⇒∫(v−1)dv1+v+v2=−∫dxx
⇒12∫2v+1−3v2+v+1dv=−logx+C
⇒122v+1v2+v+1dv−32∫1v2+v+1dv=−logx+C
Let v2+v+1=t⇒(2v=1)dv=dt
⇒12∫dtt−32∫1(v+12)2+34dv=−logx+C
⇒12log|t|−32×2√3tan−1⎛⎜
⎜
⎜
⎜⎝v+12√32⎞⎟
⎟
⎟
⎟⎠=−logx+C[∵∫1x2+a2dx=1atan−1xa]
⇒12log|v2+v+1|−√3tan−1(2v+1√3)=−logx+C
⇒12log∣∣∣y2x2+yx+1∣∣∣−√3tan−1⎛⎜
⎜
⎜⎝2yx+1√3⎞⎟
⎟
⎟⎠=−logx+C [From eq. (1)]
For x=1 & y=0
12log|0+0+1|−√3tan−1(0+1√3)=−log1+C⇒0−√3π5=C
⇒C=−√3π6=−π2√3
⇒12log∣∣∣y2x2+yx+1∣∣∣−√3tan−1⎡⎢
⎢
⎢⎣2yx+1√3⎤⎥
⎥
⎥⎦=−logx−π2√3