Example 1. Solve the equation $(x+y) d x+(x+2 y) d y=0$.
Solution. Here $P=x+y, \quad Q=x+2 y, \quad \frac{\partial P}{\partial y}=\frac{\partial Q}{\partial x}=1$. We have an equation in total differentials.

Find the function $u=u(x, y)$ from the condition $d u=(x+y) d x+(x+$ $+2 y) d y$. Since $d u=\frac{\partial u}{\partial x} d x+\frac{\partial u}{\partial y} d y$, then $\frac{\partial u}{\partial x}=x+y, \quad \frac{\partial u}{\partial y}=x+2 y$. From the first condition, we find $u=\int(x+y) d x+\varphi(y)=\frac{x^{2}}{2}+y x+\varphi(y)$, where $\varphi(y)$ is some function of $y$, determined from the second condition: $\frac{\partial u}{\partial y}=\frac{\partial}{\partial y}\left(\frac{x^{2}}{2}+y x+\varphi(y)\right)=x+\varphi^{\prime}(y)=x+2 y$.

From this, it follows that $\varphi^{\prime}(y)=2 y$, i.e., $\varphi(y)=y^{2}$, and then $u(x, y)=$ $=\frac{x^{2}}{2}+x y+y^{2}$

Answer. $\frac{x^{2}}{2}+x y+y^{2}=C$