Question:medium

Solve the differential equation \( (x+y)\,dy + (x-y)\,dx = 0 \), given that \( y(1) = 1 \).

Show Hint

The equation is homogeneous: put y = vx, separate the variables, integrate, and then use y(1) = 1.
Updated On: Oct 22, 2026
Show Solution

Solution and Explanation

Step 1: Expand and regroup the terms:
Open the brackets of $(x+y)\,dy + (x-y)\,dx = 0$.
\[ x\,dx + y\,dy + x\,dy - y\,dx = 0 \]
We group it as $(x\,dx + y\,dy) + (x\,dy - y\,dx) = 0$.

Step 2: Recognise two exact differentials:
We know $x\,dx + y\,dy = \frac12\, d(x^2+y^2)$.
Also $d\left(\tan^{-1}\frac{y}{x}\right) = \frac{x\,dy - y\,dx}{x^2+y^2}$, so $x\,dy - y\,dx = (x^2+y^2)\, d\left(\tan^{-1}\frac yx\right)$.

Step 3: Divide by x^2 + y^2:
Dividing the whole equation by $x^2+y^2$ gives the exact form below.
\[ \frac{1}{2}\cdot\frac{d(x^2+y^2)}{x^2+y^2} + d\left(\tan^{-1}\frac{y}{x}\right) = 0 \]
That is $d\left[\frac12\log(x^2+y^2) + \tan^{-1}\frac yx\right] = 0$.

Step 4: Integrate:
An exact differential equal to zero means the bracket is constant.
\[ \frac12\log(x^2+y^2) + \tan^{-1}\frac{y}{x} = C \]

Step 5: Apply the condition y(1) = 1:
At $x=1$, $y=1$ we have $x^2+y^2=2$ and $\tan^{-1}1=\frac{\pi}{4}$.
So $C=\frac12\log 2+\frac{\pi}{4}$.
A quick check: differentiating the answer gives back $\frac{dy}{dx}=\frac{y-x}{x+y}$.

Final Answer:
Multiplying by 2, the same result can be written as follows.
\[ \boxed{\log(x^2+y^2) + 2\tan^{-1}\frac{y}{x} = \log 2 + \frac{\pi}{2}} \]
Was this answer helpful?
0