Example 3.25. Verify that the expression

$$
\left(3 x^{2} y+4 y^{4}-5\right) d x+\left(x^{3}+8 x y\right) d y
$$

is a total differential and find the function given the differential.
Solution. 1) We have $P(x, y)=3 x^{2} y+4 y^{4}-5, Q(x, y)=$ $=x^{3}+8 x y$ - continuous and continuously differentiable in $E^{2}$.

2) Check the equality $\frac{\partial P}{\partial y}=\frac{\partial Q}{\partial x}: \frac{\partial P}{\partial y}=$ $=3 x^{2}+8 y ; \frac{\partial Q}{\partial x}=3 x^{2}+8 y \Rightarrow \frac{\partial P}{\partial y}=\frac{\partial Q}{\partial x}$.
3) Find

$$
\begin{gathered}
\int P d x=\int\left(3 x^{2} y+4 y^{4}-5\right) d x=x^{3} y+4 x y^{2}-5 x+U(y) \\
\int Q d y=\int\left(x^{3}+8 x y\right) d y=x^{3} y+4 x y^{2}+V(x)
\end{gathered}
$$

(Note that when integrating with respect to one variable, the other is considered constant.) Comparing both obtained results of integration for the desired function $f(x, y)$, we conclude that if we add $-5 x$ from the first expression to the known terms of the second expression for the function $f(x, y)$, then both expressions for $f(x, y)$ lead to the result:

$$
f(x, y)=x^{3} y+4 x y^{2}-5 x+C, C=\text { const. }
$$