I solved the following: \begin{align} \frac{dy}{y}&=\frac{dy'}{2y'+wy}\\ \ln y + \ln C &= \frac{1}{2} \ln \left(2y'+wy\right)\\ 2\ln y + \ln C &= \ln \left(2y'+wy\right)\\ C &= \frac{2y'}{y^2} + \frac{w}{y}\\ \end{align}
I isolated the constant since the purpose of solving is to find the differential invariant. However the answer given is: $$ \frac{y'}{y^2}+\frac{w}{y} $$
where am I going awry?