Given: dydx=y1+x−y2
⇒dydx=y1+x−y
⇒dydx−y1+x=−y
Now let 1+x=t⇒dydx=dydt
⇒dydt−yt=−y
⇒IF=e∫−y1dy
⇒IF=e−logy
⇒IF=elogy1
⇒IF=y1
So, the solution of the given differential equation is
yt=∫y1×(−y)dy
⇒y(1+x)=∫y1×(−y)dy
⇒y(1+x)=−y+c
Also, x(1)=1
⇒12=−1+c
⇒c=3
⇒y(1+x)=−y+3
Putting y=2
⇒2(1+x)=−2+3
⇒(1+x)=2
⇒x=1
⇒5x=5