# Differential equation $y'=-\frac{x+y}{x+2y}$

Differential equation. How do you solve this ?

$$y'=-\frac{x+y}{x+2y}$$

set $u = \dfrac yx$, then $y' = u'x + u$,

$$u'x + u = -\frac{1+u}{1+2u}$$ $$u'x = -\frac{2u^2+2u+1}{1+2u}$$ $$\frac{(1+2u)u'}{2u^2+2u+1} = -\frac1x$$

I solved it so far but I do not know anymore

• Hi and welcome to the site! Since this is a site that encourages and helps with learning, it is best if you show your own ideas and efforts in solving the question. Can you edit your question to add your thoughts and ideas about it? – 5xum Jan 12 '18 at 8:52
• Also, don't get discouraged by the downvote. I downvoted the question and voted to close it because at the moment, it is not up to site standards (you have shown no work you did on your own). If you edit your question so that you show what you tried and how far you got, I will not only remove the downvote, I will add an upvote. – 5xum Jan 12 '18 at 8:52
• Please can you edit your question, don't put vital details about a question into the comments. – 5xum Jan 12 '18 at 8:58
• Separable equation, fairly standard. – Jean-Claude Arbaut Jan 12 '18 at 9:15
• Hint: $$2\frac{(1+2u)u'}{2u^2+2u+1} =\frac{(2u^2+2u+1)'}{2u^2+2u+1}=(\ln(2u^2+2u+1))'$$ Can you proceed now? – Did Feb 24 '18 at 8:22

\begin{align*} y'&=-\frac{x+y}{x+2y}\\ xy'+2yy'&=-x-y\\ y+xy'+2yy'&=-x\\ (xy+y^2)'&=-x \end{align*} So if you denote $z=xy+y^2$, you have $$z'=-x$$ and you can get that \begin{align*} z&=-\frac{x^2}2+C\\ y^2+yx+\frac{x^2}2-C&=0 \end{align*} and now you can find $y$ using the quadratic formula: $$y=\frac{-x\pm\sqrt{4C-x^2}}2.$$