Solving a first order non-linear homogenous ODE Original problem is:
$$
\frac{dy}{dx} = \frac{3y + x}{3x + y}
$$
After substituting multiplying the top and bottom by $\frac{1}{x}$ and substituting $v = \frac{y}{x}$ I arrived at
$$
\frac{1}{x}dx = \frac{3+v}{1-v^2}dv 
$$
After integrating initially using partial fractions and getting:
$$
\ln |x| = \frac{3}{2}\ln(1+v) - \frac{3}{2}\ln(1-u) - \frac{1}{2}\ln(1-v^2) 
$$
I went to wolfram alpha and found the simplified version of the integral was
$$
\ln |x| = \ln(1+v) - 2\ln(1-v)
$$
Which made my final answer without solving for y
$$
\ln|x| = \ln\frac{1+\frac{y}{x}}{\left(1-\frac{y}{x}\right)^2}
$$
The answer in the textbook, however, was:
$$
\ln|x| = \ln \left(\left(1+\frac{y}{x}\right) \left(1-\frac{y}{x}\right)^2\right)
$$
Where did I go wrong?

As:
$$\frac{dy}{dx} = \frac{3y + x}{3x + y}\stackrel{v=y/x}\implies x\frac{dv}{dx}+v=\frac{3v+1}{3+v}\implies x\frac{dv}{dx}=\frac{1-v^2}{3+v}\implies \frac{dx}{x}=\frac{v+3}{1-v^2}dv$$
Then partial fractions:
$$\frac{dx}{x}=\left(\frac{2}{1-v}+\frac{1}{1+v}\right )dv$$
So:
$$\ln|x|=-2\ln|1-v|+\ln|1+v|+c$$
So:
$$x=k\frac{1+v}{(1-v)^2}=k\frac{1+y/x}{(1-y/x)^2}$$
So your answer is correct, as a proof I can present a maxima output:

Converting last output:
$$k'x=\frac{1+y/x}{(1-y/x)^2}$$
