# $\frac{dy}{dx}=1+\frac{2}{x+y}$ solution by an "integrating term"

I though about this trick and then found an example to apply it to: $$\frac{dy}{dx}=1+\frac{2}{x+y}$$ This is the trick: add $\frac{dx}{dx}=1$ to both parts $$\frac{dy}{dx}+\frac{dx}{dx}=1+\frac{2}{x+y}+1$$ Using the linearity of $d$ $$\frac{d(x+y)}{dx}=2\frac{1+(x+y)}{x+y}$$ $$\frac{(x+y)d(x+y)}{1+(x+y)}=2dx$$ $$d(x+y)-\frac{d(x+y)}{1+(x+y)}=2dx$$ $$-\frac{d(x+y)}{1+(x+y)}=2dx-d(x+y)$$ Now $2dx-d(x+y)=2dx-dx-dy=dx-dy=d(x-y)$ $$-\frac{d(x+y)}{1+(x+y)}=d(x-y)$$ $$\frac{d(1+x+y)}{1+(x+y)}=d(y-x)$$ Integrating: $$\ln|1+x+y|=(y-x)+\ln C$$ $$1+x+y=C\exp\left(y-x\right)$$ Is this a one-off case, or a particular example of a certain method? Does anyone know more examples of ODE's that can be solved similarly? I know the integrating multiplier theory quite well, but this one seems like something extra to that.

• I can't tell what happened when you went from dx to d(y-x). Jun 2, 2012 at 12:55
• I'll insert the missing steps Jun 2, 2012 at 13:01
• You are making a change of variables. Your new variable is $x+y$ rather than the original $y$. This substitution is suggested by the form of the right-hand side. Jun 2, 2012 at 13:34
• It's a nice idea, and aas you can see will work for quite a few variants. Your calculation was more messy than necessary. Let $u=x+y$. Then your first line can be rewritten as $\frac{du}{dx}= 2+\frac{2}{u}$. This is a separable DE, solve for $u$. This would have made the later calculations shorter and more transparent. Jun 2, 2012 at 14:00
• yes, I guess in the end it al boils down to changing the variable, though this "method" is meant suggest the change, or make it obvious. Thanks for your comments Jun 2, 2012 at 14:34

In general for equations of the form $y'(x)=f(ax+by+c)$, (where $a, b$ and $c$ are constantes $b\neq 0$), you can use the change of variables $u=ax+by+c$. You obtain the equation: $$y'=\frac{u'-a}{b}=f(u)$$ which can be solved using separation of variables: $$\frac{du}{b \,f(u)+a}=dx$$