\((x^2 + xy)\,dy = (x^2 + y^2)\,dx\)
Show solutionHide solution
Show homogeneity. Write the differential equation as \[ (x^2+y^2)\,dx-(x^2+xy)\,dy=0. \] Here \(M=x^2+y^2\) and \(N=-(x^2+xy)\). Both are homogeneous functions of degree \(2\), since replacing \((x,y)\) by \((tx,ty)\) multiplies each by \(t^2\). Equivalently, for \(x\neq0\) and \(x+y\neq0\), \[ \frac{dy}{dx}=\frac{x^2+y^2}{x^2+xy} =\frac{1+(y/x)^2}{1+y/x}, \] which depends only on \(y/x\). Hence the equation is homogeneous.
Solve. Let \(y=vx\), so \(v\) is a function of \(x\). Then \[ \frac{dy}{dx}=v+x\frac{dv}{dx}. \] Substitute into the differential equation: \[ v+x\frac{dv}{dx} =\frac{1+v^2}{1+v}. \] Thus \[ x\frac{dv}{dx} =\frac{1+v^2}{1+v}-v =\frac{1-v}{1+v}. \] Separating variables, \[ \frac{dx}{x}=\frac{1+v}{1-v}\,dv. \] Integrate: \[ \ln|x|=\int\left(\frac{2}{1-v}-1\right)dv =-2\ln|1-v|-v+C. \] Therefore \[ \ln|x|+2\ln|1-v|+v=C. \] Since \(v=y/x\), this becomes \[ \ln|x|+2\ln\left|1-\frac yx\right|+\frac yx=C. \] Simplifying, \[ 2\ln|x-y|-\ln|x|+\frac yx=C, \] or, after exponentiating and absorbing the constant, \[ \frac{(x-y)^2}{|x|}\,e^{y/x}=c \quad(c>0). \] On an interval on which \(x\) has a fixed sign, this can be written as \[ \boxed{(x-y)^2e^{y/x}=C x}. \] The limiting case \(C=0\) gives the solution \(y=x\). The solution is understood on intervals where \(x\neq0\) and the original equation is defined; the curve \(y=-x\) is not a solution because it would make the original coefficient \(x^2+xy\) vanish without satisfying the equation identically.