Skip to content

Homogeneous first-order ODE y' = (x-y)/(x+y)

Question

Solve the differential equation dydx=x−yx+y\dfrac{dy}{dx}=\dfrac{x-y}{x+y}.

Short answer

y2+2xy−x2=Cy^2+2xy-x^2=C. Rearranging, (x+y) dy=(x−y) dx(x+y)\,dy=(x-y)\,dx, i.e. x dy+y dx+y dy−x dx=0x\,dy+y\,dx+y\,dy-x\,dx=0, which is d ⁣(xy+y22−x22)=0d\!\left(xy+\tfrac{y^2}2-\tfrac{x^2}2\right)=0. (Substituting y=vxy=vx also works.) Explicitly, y=−x±2x2+Cy=-x\pm\sqrt{2x^2+C}.

Adapted from Zhou, A Practical Guide to Quantitative Finance Interviews, sec. 3.5 Ordinary Differential Equations, 'Separable ODE B', p.46; question and answer rewritten by SelfMadeQuant.com.

See the hint and the full worked solution in the question bank (free account).

Open the worked solution

Lessons behind this question