I have a differential equation with homogeneous coefficient:
$$ (x+y) dx - (x-y) dy = 0 $$
Functions $ P(x) = x+y$ and $ Q(x) = - x-y $ are both homoegeneous functions of order 1. So I can use substitusion:
$$ y = ux, dy = udx + xdu $$
(because it will lead to a differential equation in which the variables are separable)
So after this substitution I'm obtaining result:
$$ (u+ux)dx - (x-ux)(udx + xdu) = 0 $$
After simplification I have:
$$ x^{2} (u-1)du + x(1+u^{2})dx = 0 $$
Now I'm dividing both sides by $x^{2} \cdot (1+u^{2})$ and I'm obtaining:
$$ \frac{u-1}{1+u^{2}}du + \frac{dx}{x} = 0 $$
Next, because:
$$ \int \frac{u-1}{1+u^{2}}du = \frac{1}{2} \ln|u^{2} +1 | - \arctan(u) +C $$
and:
$$ \int \frac{dx}{x} = \ln| x| + C$$
I have a solution:
$$ \frac{1}{2} \ln| u^{2} + 1| - \arctan(u) + \ln|x| = C$$
$$ \frac{1}{2} \ln|\frac{y^{2}}{x^{2}} +1| - \arctan(\frac{y}{x}) + \ln|x| = C $$
After simplification, I can obtain result:
$$ \frac{1}{2} \ln( x^{2} + y^{2}) - \arctan(\frac{y}{x}) = C $$
In book from this exercise from there is a little diffrent answer :
$$ \arctan(\frac{y}{x}) - \frac{1}{2} \ln(x^2 + y^2) = C $$
Is my solution incorrect? I will be grateful for an explanation
Both solutions are correct. Note that $C$ is an arbitrary constant. Therefore, one may define $C=-k$ on your solution: $$\frac{1}{2}\ln(x^2+y^2)-\arctan\left(\frac{y}{x}\right)=-k$$ Multiplying both sides by $-1$, we obtain the same solution the book obtained: $$\arctan\left(\frac{y}{x}\right)-\frac{1}{2}\ln(x^2+y^2)=k$$