<s>[INST] Solve differential equation $(x^2-y^2+2x-y)dx+(x^2-y^2+x-2y)dy=0$ Solve the differential equation: $(x^2-y^2+2x-y)dx+(x^2-y^2+x-2y)dy=0$.
My attempt :
I factored and did some calculation to get $ dx+dy+\dfrac{xdx-ydy}{(x-y)(x+y+1)}=0.$
I am stuck after it . It could have been a lot easier if there were $xdy-ydx$. Will  partial fraction decomposition work here ?
 [/INST] Let
\begin{equation}
\begin{split}
x+y =z\\
x-y =\widetilde{z}
\end{split}
\end{equation}
Using this substitution, the differential equation you posted can be written as
\begin{equation}
\begin{split}
\left(z \widetilde{z}+ \widetilde{z} \right) \mathrm{d} z = -\frac{1}{2}\left( z \mathrm{d}\widetilde{z}+\widetilde{z} \mathrm{d}z\right)
\end{split}
\end{equation}
By just adding $-x\mathrm{d} x+ y\mathrm{d}y = -\frac{1}{2}\mathrm{d}(x^2-y^2)$ on both sides.
Now, this resulting equation can be easily solved by simplifying it as
\begin{equation}
\begin{split}
\frac{2}{z}\left(z+\frac{3}{2}\right) \mathrm{d}z = -\frac{\mathrm{d}\widetilde{z}}{\widetilde{z}}
\end{split}
\end{equation}
Giving
\begin{equation}
e^{2 z} z^3 \widetilde{z} = k
\end{equation}
Where $k$ is the integration constant.
Or,
The solution to the differential equation you posed is the solution to equation
$$e^{2(x+y)} (x+y)^3 (x-y) =k$$
</s>