Answer
The solution of the differential equation is given by
$$
\frac{2x}{y+x}+ln | y+x|=c_{1}
$$
where $ c_{1}=-c$ is an arbitrary constant.
Work Step by Step
$$
y^{'}=\frac{dy}{dx}=\frac{x+3y}{x-y} \quad (*)
$$
Divide each term in the numerator and denominator by the highest power of $ x$ , namely $x$. We obtain
$$
y^{'}=\frac{dy}{dx}=\frac{1+3(\frac{y}{x})}{1-(\frac{y}{x})} =f(x,y)
$$
where $f(x,y)$ can be expressed as a function of the ratio $\frac{y}{x}$ only .
Thus eq. (*) is homogeneous.
Now we assume a new dependent variable $ v = \frac{y}{x }$
and we can express
$$
y^{'}=\frac{dy}{dx}=x \frac{dv}{dx}+v =\frac{1+3v}{1-v}
$$
$$
x \frac{dv}{dx} =\frac{1+3v}{1-v} -v= \frac{v^{2}+2v+1}{1-v} \quad (**)
$$
The differential equation (**) is separable and can be written as
$$
[\frac{1-v}{{{v^{2}+2v+1}}}] dv= \frac{dx}{x}
$$
by using partial fractions and some simplifications the provisos differential equation can be written as
$$
[\frac{2}{{(v+1)^{2}}}-\frac{1}{{v+1}}] dv= \frac{dx}{x}
$$
integrating the left side with respect to $v$ and the right side with respect to $x$ gives
$$
\int{\frac{2 dv}{{(v+1)^{2}}}} -\int{ \frac{dv}{v+1}}=\int{ \frac{dx}{x}}
$$
we obtain
$$
\frac{-2}{v+1} -ln | (v+1)|= ln | x |+ c
$$
where c is an arbitrary constant.
we can obtain $v$ implicitly in terms of $ x$ as the follows
$$
\frac{-2}{v+1} -ln | x(v+1)|= c
$$
we find the solution of Eq. (*) by replacing $v$ by $ y/x $ in the previous expression,
$$
\frac{-2}{(\frac{y}{x})+1} -ln | x((\frac{y}{x})+1)|= c
$$
this implies that
$$
\frac{-2x}{y+x} -ln | y+x|= c
$$
Hence the solution of eq. (*) is given by
$$
\frac{2x}{y+x}+ln | y+x|=c_{1}
$$
where $ c_{1}=-c$ is an arbitrary constant.