dy/dx = (x+2y)/(x-y)
This is a homogeneous differential equation.
Substitute y = vx and dy/dx = v + x dv/dx
⇒ v + x dv/dx = (x + 2vx)/(x - vx) = (1 + 2v)/(1 - v)
⇒ x dv/dx = (1 + 2v)/(1 - v) - v = (1 + 2v - v + v²)/(1 - v) = (1 + v + v²)/(1 - v)
⇒ (1 - v)/(1 + v + v²) dv = dx/x
Integrate both sides,
∫(1 - v)/(1 + v + v²) dv = ∫ dx/x
−∫(2v + 1 - 3)/(2(1 + v + v²)) dv = lnx + c
(1/2)∫(2v + 1)/(1 + v + v²) dv - (3/2)∫ 1/(1 + v + v²) dv = -lnx + C
(1/2)ln(|1 + v + v²|) - (3/2)∫ 1/((v + 1/2)² + 3/4) dv = -lnx + C
(1/2)ln(|1 + v + v²|) - (3/2) * [2/√3 tan⁻¹((2v + 1)/√3)] = -lnx + C
⇒ (1/2)ln(|1 + v + v²|) - √3 tan⁻¹((2v + 1)/√3) = -lnx + C
Resubstitute v = y/x,
⇒ (1/2)ln(|1 + y/x + y²/x²|) - √3 tan⁻¹((2y + x)/(√3x)) = -lnx + C
⇒ (1/2)ln(|x² + xy + y²|/x²) - √3 tan⁻¹((2y + x)/(√3x)) + lnx = C