<s>[INST] general solution of the differential equation $\frac{dy}{dx} + \frac{x+y+a}{x+y+b}=0$ I'm trying to find the general solution of the differential equation $\frac{dy}{dx} + \frac{x+y+a}{x+y+b}=0$ where a and b are constants.
I have tried puttting z=x+y thus, $\frac{dz}{dx} = 1 + \frac{dy}{dx}$. I subbed this into the equation to get $\frac{dz}{dx} = 1 -(\frac{z+a}{z+b})$ which I simplified to $\frac{b-a}{z+b}$ and I separated variables and integrated giving:
$$\frac{z^2}{2} +bz = (b-a)x +c$$
I then multiplied through by 2 and subbed z=x+y back however this did not give me the correct answer which is $(x+y+b)^2 = 2(b-a)(x+c)$. Does anyone know how to get to this answer?
 [/INST] Set $x+y+a=u$ so, $1+y'=u'$ and then $~~x+y+b=u-a+b~~$ so $~~~y'=-\frac{u}{u+b-a}$ or $$u'-1=\frac{-u}{u+b-a}$$ or $$u'=\frac{b-a}{u+b-a}$$ or $$(u+b-a)du=(b-a)dx$$ or $$\frac{u^2}{2}+(b-a)u=(b-a)x+C$$ wherein $x+y+a=u$. Now, by substiting $u$ we have: $$\frac{(x+y)^2}{2}+\frac{a^2}2+(x+y)b=(b-a)x+C$$ which is $$\frac{(x+y)^2}{2}+\frac{b^2}2+(x+y)b=(b-a)x+C-\frac{a^2}2+\frac{b^2}2=(b-a)x+k$$ and $k=C-\frac{a^2}2+\frac{b^2}2$. Therefore we get $$\frac{(x+y+b)^2}{2}=(b-a)x+(b-a)c$$ wherein $k=(b-a)c$
</s>