Problem 247
Medium Further Methods

Solve xyy' - y^2 = (x+y)^2e^(-y/x)

Solve $xyy' - y^2 = (x+y)^2e^{-y/x}$.

Explanation of Method

The equation is homogeneous of degree 2, so the substitution \(y = vx\) reduces it to a separable equation in \(v\) and \(x\). Care is needed with the resulting integral \(\\int \\dfrac{ve^v}{(1+v)^2}\\,dv\), whose antiderivative must be checked by differentiation.

Substitute \(y = vx\)

With \(dy/dx = v + x\\,dv/dx\), the equation becomes \(v^2x^2 + vx^2\\dfrac{dv}{dx} - v^2x^2 = x^2(1+v)^2e^{-v}\), which simplifies to \(vx\\dfrac{dv}{dx} = (1+v)^2e^{-v}\).

Separate variables

\[ \\frac{ve^v}{(1+v)^2}\\,dv = \\frac{dx}{x}. \]

Integrate the left side (with a sign correction)

Differentiating the candidate antiderivative \(\\dfrac{e^v}{1+v}\) gives \(\\dfrac{d}{dv}\\!\\left[\\dfrac{e^v}{1+v}\\right] = \\dfrac{e^v(1+v) - e^v}{(1+v)^2} = \\dfrac{ve^v}{(1+v)^2}\), which exactly matches the integrand. (An earlier working sometimes writes \(-e^v/(1+v)\) here; differentiating that expression gives \(-ve^v/(1+v)^2\), the wrong sign, and does not match the integrand — sympy's integrate confirms the correct antiderivative is \(+e^v/(1+v)\).) Hence \[ \\int\\frac{ve^v}{(1+v)^2}\\,dv = \\frac{e^v}{1+v} + C_1. \] So \(\\dfrac{e^v}{1+v} = \\ln|x| + C\).

Back-substitute \(v = y/x\)

\(1+v = (x+y)/x\), so \[ \\frac{e^{y/x}}{(x+y)/x} = \\frac{xe^{y/x}}{x+y} = \\ln|x| + C. \]

Verify

Writing the implicit solution as \(F(x,y) = \\dfrac{xe^{y/x}}{x+y} - \\ln x - C = 0\) and computing \(y' = -F_x/F_y\) with sympy, then eliminating \(e^{y/x}\) using the relation \(e^{y/x} = \\dfrac{(x+y)(\\ln x + C)}{x}\) itself, reduces \(y'\) to exactly \(\\dfrac{y}{x} + \\dfrac{x+y}{y(\\ln x + C)}\), which is identical to \(y'\) obtained by solving the original equation for \(y'\) and substituting the same relation for \(e^{-y/x}\). The difference simplifies symbolically to \(0\); a numeric check (e.g. \(x=2\), \(C=0.5\)) also confirms \(xyy'-y^2\) and \((x+y)^2e^{-y/x}\) agree to numerical precision. \(\\checkmark\)


Result

Final answer:

Boxed result: \[ \\boxed{\\dfrac{xe^{y/x}}{x+y} = \\ln|x| + C} \] equivalently \(xe^{y/x} = (x+y)(\\ln|x|+C)\). (Note: the source manuscript's intermediate antiderivative had a sign error, \(-e^v/(1+v)\) instead of the correct \(+e^v/(1+v)\); the boxed answer above is the corrected result, verified directly against the original equation.)