Solve $\frac{dy}{dx}=\frac{y}{x+y}$ I know how to solve this by taking $u=y/x$ and substituting. Here's another approach I tried:

*

*rearranging gives  $xdy+ydy=ydx$

*integrating on both sides gives   $xy+\frac{y^2}{2}=xy+c$
Is this approach so far correct?  Thanks!
 A: One more way, this ODE can be re-written as
$$\frac{xdy-ydx}{y^2}=-\frac{dy}{y}$$
$$\implies -d(\frac{x}{y})=-d(\ln y)$$
Upon integration both sides, we get
$$\frac{x}{y}=\ln y+C.$$
A: Another approch : The differential equation can also be rearranged as $$\frac{dx}{dy} = \frac{x+y}{y}$$
On further simplification,
$$\frac{dx}{dy} - \frac{x}{y} = 1$$ This is a linear differential equation of form,
$$\frac{dx}{dy}+P(y)x = Q(y)$$
Here $P(y) = \frac{-1}{y}$ and $Q(y) = 1$.
Its Integrating factor is given by
$$I.F = e^{-\int(1/y) dy} $$ on solving
$I.F = \frac{1}{y}$
Solution of linear differential equation is given as
$$x\frac{1}{y} = \int \frac{1}{y}dy + C$$
Upon integrating we obtain the solution
$$\frac{x}{y}= ln(y) +C $$
A: When you integrate with multiple variables involved, your constant becomes a function of the variables you are not integrating with (Because effectively what you are doing is finding an anti partial derivative). So
$$\int xdy=xy+f(x),$$
where $f(x)$ is ANY function that only depends on $x$ and is your constant of integration.  Similarly, you'll get a $g(y)$ in your attempt instead of a $c$.
A: The DE is homogeneous so substitute $y=t(x)x$ and the DE becomes a separable DE.
$$xdy+ydy=ydx$$
No you can't integrate this the way you did because $y=y(x)$ is a function of $x$ so how to integrate $y(x)$  ?
$$\int y(x) dx =?$$
And your answer does not solve the DE:
$$xy+\frac{y^2}{2}=xy+c \implies y =C$$
And the constant function ( $y=0$ is indeed a solution) is not a solution of the original DE.
Instead you can integrate the DE this way:
$$xdy+ydy=ydx$$
$$-xdy+ydx=ydy$$
Divide by $y^2$:
$$d\left (\dfrac {x}{y} \right)=\dfrac {dy}{y}$$
Integrate.
$$\dfrac {x}{y} -\ln {y}=C$$
