A troubling differential equation: $(xy+2y+x+2)y’=e^{-y}(x+3)$

calculusordinary differential equationsrecreational-mathematicssolution-verification

Of course, I found this to be sort of troubling, you might not.

So this is a differential equation that I came up with about 3 days ago that has taken me quite a while to solve (for some reason):$$(xy+2y+x+2)y'=e^{-y}(x+3)$$which although I did solve it, I really am not sure if I made any incorrect assumptions while solving it or if my solution is incorrect. Here is my solving process:

Right away I noticed that I could factor the $xy+2y+x+2$ as $(x+2)(y+1)$, and dividing both sides by $x+2$ gets$$(y+1)y'=(e^{-y})\dfrac{x+3}{x+2}$$and then I can multiply both sides by $e^y$ gets$$(y+1)y'e^y=\dfrac{x+3}{x+2}$$which we can rewrite as$$(y+1)e^ydy=\dfrac{x+3}{x+2}dx$$and this is where I feel like I might have made a mistake somewhere. I know the integral on the right hand is $x+\ln|x+2|+c_0$, but the left hand side is a bit weird. I know I can write the left hand side as$$\int(y+1)e^ydy=\int ye^y+e^ydy=\int ye^ydy+e^y+c$$but I was unsure on how to evalute $\int ye^ydy$. I decided to use IBP (integration by parts) and got that the integral on the left hand side was equal to $\int(y+1)e^ydy=ye^y+c_1$ which now we can subtract $c_1$ from both sides and then take Lambert's $W$ function to find that$$y(x)=W(x+\ln|x+2|+b),b=c_0-c_1$$but my question is

Is my solution correct, or did I make any incorrect assumptions/get the wrong solution?

Best Answer

While my answer is correct, aside from that I could have seen straightforwardly that $$\dfrac d{dy}(ye^y)=(y+1)e^y\implies\int ye^ydy=(y-1)e^y$$here is the verification of my answer:

We want that $(y+1)y'e^y=\frac{x+3}{x+2}$.

We use the fact that $W(z)e^{W(z)}=z$ to get that[1]$$W(x+\ln|x+2|+b)e^{W(x+\ln|x+2|+b)}=x+\ln|x+2|+b$$And, to differentiate $W(z)$, we use the chain rule[2]:$$\dfrac d{dx}W(f(x))=\dfrac{W(f(x))f'(x)}{f(x)(1+W(f(x))}$$to get that[1]$$\ W'(x+\ln|x+2|+b)\cdot\left[\left(1+\frac1{|x+2|}\right)\cdot e^{W(x+\ln|x+2|+b)}+W(x+\ln|x+2|+b)\cdot(e^{W(x+\ln|x+2|+b)}\cdot\left(1+\frac1{|x+2|}\right)\right]=1+\frac1{|x+2|}$$which for $x\overset{\text{approx.}}\geq\frac23-b$ is defined in the reals and is equivalent to $x+3$[3], as that is the domain of the function $W(x+\ln|x+2|+b)$.


Sources


[1]Scipio Aemilianus, "How do I take $\dfrac d{dx}W(x+\ln|x+2|+c)$?"
[2]Claude Leibovici, "How do I take $\dfrac d{dx}W(x+\ln|x+2|+c)$?"
[3]

Related Question