Question:

Solve the differential equation \((x-y)\dfrac{dy}{dx}=x+2y\).

Show Hint

Substitute y=vx (homogeneous equation), separate variables, and complete the square in the denominator.
Updated On: Sep 23, 2026
Show Solution
collegedunia
Verified By Collegedunia

Solution and Explanation

Step 1: Recognize this as a homogeneous equation and substitute \(y=vx\):
\(\dfrac{dy}{dx}=v+x\dfrac{dv}{dx}\). The equation \((x-y)\dfrac{dy}{dx}=x+2y\) becomes \(x(1-v)\left(v+x\dfrac{dv}{dx}\right)=x(1+2v)\), i.e. \((1-v)\left(v+x\dfrac{dv}{dx}\right)=1+2v\).

Step 2: Expand and isolate the \(x\,dv/dx\) term:
\[ v-v^2+x(1-v)\dfrac{dv}{dx}=1+2v \]
\[ x(1-v)\dfrac{dv}{dx}=1+2v-v+v^2=v^2+v+1 \]

Step 3: Separate variables:
\[ \dfrac{1-v}{v^2+v+1}\,dv=\dfrac{dx}x \]

Step 4: Integrate the left side by splitting \(1-v=-\tfrac12(2v+1)+\tfrac32\):
\[ \int\dfrac{1-v}{v^2+v+1}dv=-\dfrac12\ln(v^2+v+1)+\sqrt3\tan^{-1}\!\left(\dfrac{2v+1}{\sqrt3}\right) \]
(using \(\int\dfrac{2v+1}{v^2+v+1}dv=\ln(v^2+v+1)\) and completing the square \(v^2+v+1=(v+\tfrac12)^2+\tfrac34\)).

Step 5: Equate to \(\ln|x|+C\) and substitute back \(v=y/x\):
\[ -\dfrac12\ln\!\left(\dfrac{x^2+xy+y^2}{x^2}\right)+\sqrt3\tan^{-1}\!\left(\dfrac{x+2y}{x\sqrt3}\right)=\ln|x|+C \]
The \(\ln x^2\) term combines with \(\ln|x|\) on the right and simplifies to:

Final Answer:
\[ \boxed{\sqrt3\tan^{-1}\!\left(\dfrac{x+2y}{\sqrt3\,x}\right)-\dfrac12\ln(x^2+xy+y^2)=C} \]
Was this answer helpful?
0
0