Solve the differential equation (y-xy')/(x+yy') = 2
Solve the differential equation $\frac{y-xy'}{x+yy'} = 2$.
Explanation of Method
Cross-multiplying yields a homogeneous first-order ODE, which is solved with the substitution \(y=vx\), reducing it to a separable equation whose integral produces an implicit solution in polar-like form \(\arctan(y/x)+\ln(x^2+y^2)=C\).
Rewrite as an explicit ODE
Cross-multiplying: \(y-xy' = 2(x+yy') = 2x+2yy'\), so \(y-2x = y'(x+2y)\), giving
\[y' = \frac{y-2x}{x+2y}.\]
Both numerator and denominator are homogeneous of degree 1, so the equation is homogeneous.
Substitute \(y=vx\)
With \(y=vx\), \(y'=v+xv'\), and
\[v+xv' = \frac{vx-2x}{x+2vx} = \frac{v-2}{1+2v}.\]
Hence
\[xv' = \frac{v-2}{1+2v} - v = \frac{-2(1+v^2)}{1+2v}.\]
Separate and integrate
\[\frac{1+2v}{1+v^2}\,dv = -\frac{2\,dx}{x}.\]
Splitting the left side, \(\displaystyle\int\frac{dv}{1+v^2}=\arctan v\) and \(\displaystyle\int\frac{2v\,dv}{1+v^2}=\ln(1+v^2)\), so
\[\arctan v + \ln(1+v^2) = -2\ln|x| + C_1.\]
Back-substitute \(v=y/x\)
Absorbing \(-2\ln|x|\) and \(\ln x^2\) together: \(\arctan\frac{y}{x} + \ln\bigl[x^2(1+y^2/x^2)\bigr] = C_1\), i.e.
\[\arctan\frac{y}{x} + \ln(x^2+y^2) = C.\]
Verify by implicit differentiation
Differentiating \(\arctan(y/x)+\ln(x^2+y^2)=C\) implicitly (verified with sympy) gives \(\dfrac{xy'-y}{x^2+y^2} + \dfrac{2x+2yy'}{x^2+y^2}=0\), which simplifies to \(y'(x+2y) = y-2x\), i.e. \(y'=\dfrac{y-2x}{x+2y}\) — exactly the ODE from Step 1. This also matches solving the original equation \(\frac{y-xy'}{x+yy'}=2\) directly for \(y'\).
Result
Final answer:
\[\boxed{\arctan\frac{y}{x} + \ln(x^2+y^2) = C}\]
Equivalently, \(x^2+y^2 = Ke^{-\arctan(y/x)}\) with \(K=e^C>0\). Verified by implicit differentiation reproducing \(y' = \dfrac{y-2x}{x+2y}\) exactly. The source's derivation and final answer are correct as given.