Solve the differential equation:
This is a homogeneous differential equation, where the substitution (or ) transforms it into a separable equation. A function is homogeneous of degree zero if it can be expressed as a function of the ratio .
First, we rearrange the given equation to express :
\begin{align*} (x-y) \, dx + x \, dy &= 0 \\ x \, dy &= -(x-y) \, dx \\ \frac{dy}{dx} &= \frac{-(x-y)}{x} \\ \frac{dy}{dx} &= \frac{-x + y}{x} \end{align*}
Since the right-hand side can be written as , this confirms the equation is homogeneous (function of ).
Substitution: Let , where is a function of .
Differentiating with respect to using the product rule:
Substituting into equation (1):
\begin{align*} x\frac{du}{dx} + u &= \frac{-x + ux}{x} \\ x\frac{du}{dx} + u &= \frac{x(-1 + u)}{x} \\ x\frac{du}{dx} + u &= -1 + u \end{align*}
Subtracting from both sides:
\begin{align*} x\frac{du}{dx} &= -1 \\ x \, du &= -dx \\ du &= -\frac{dx}{x} \end{align*}
Integrating both sides:
\begin{align*} \int du &= \int -\frac{1}{x} \, dx \\ u &= -\ln|x| + C \end{align*}
Rearranging and substituting back :
\begin{align*} u + \ln|x| &= C \\ \frac{y}{x} + \ln|x| &= C \end{align*}
Multiplying through by gives the general solution:
Or equivalently: