\begin{gather*}
\frac{dy}{dx} = \frac{x + 3y}{x - y}\implies
\frac{dy}{dx} = \frac{x+3y}{x-y} = \frac{1+3(\frac{y}{x})}{1 - (\frac{y}{x})}
\end{gather*}
Let $v = \frac{y}{x}, y=xv$
\begin{gather*}\frac{dy}{dx} = v+x \frac{dv}{dx}\implies\\
x \frac{dv}{dx} = \frac{dy}{dx} -v = \frac{1+3v}{1-v} - v = \frac{(1+v)^2}{1-v}\implies\\
\frac{1-v}{(1+v)^2}dv = \frac{1}{x}dx\implies
\int \frac{1-v}{(1+v)^2}dv = \int \frac{1}{x}dx\implies\\
-\frac{2}{1+v} - \ln (1+v) + c = \ln x\implies\\
-\frac{2}{1+(\frac{y}{x})} - \ln (1+(\frac{y}{x})) + c = \ln x\implies\\
c-\frac{2x}{x+y} = \ln (x (1+\frac{y}{x})) \implies\\
c-\frac{2x}{x+y} = \ln (x+y)\implies\\
\frac{2x}{x+y} + \ln (x+y) = c\implies
x + y = Ce^{-\frac{2x}{x+y}}
\end{gather*}
I improved formatting. V.I.