Proof for exact differential equations shortcut? Today in my math class, we learned about exact differential equations. During class, our teacher first taught us the accepted way to solve exact equations, but then, told us of a shortcut that one of her students had apparently discovered several years ago, where you integrate both components, and "merge" the common terms.
For example, if I have the following equation: $(x^2 + y^2)dx +  (2xy + \cos{y})dy = 0$, then the shortcut would be the following:
$$\begin{align}
\int(x^2 + y^2)dx \;\;\;\;\; & and\;\;\;\;\;\; \int (2xy + \cos{y})dy \\
\frac{1}{3}x^3 + xy^2  \;\;\;\;\; & and\;\;\;\;\;\; xy^2 + \sin{y}
\end{align}$$
Because $xy^2$ is a term common to both expressions, I would "merge" the equation into the following to get the final solution:
$$\frac{1}{3}x^3 + xy^2 + \sin{y} = c$$
Our teacher then told us that neither her nor the student was able to formally prove why this works, and so cautioned us against relying on this (specifically, she told us we were only allowed to use this method to double-check our work in our upcoming quiz).
Given that my teacher had difficulties figuring out how this works, I feel ill-equipped to try and prove how and why this works on my own. Can somebody help me understand or prove (or disprove) the validity of this shortcut? 
Edit: I corrected the final equation from $\frac{1}{3} + xy^2 + \sin{y} = c$ to $\frac{1}{3}x^3 + xy^2 + \sin{y} = c$

We can see what's going on if we write things out in full. Because the differential form is exact, we know
$$(x^2 + y^2)dx +  (2xy + \cos{y})dy = df(x,y)$$
for some function $f(x,y)$, and our plan is to obtain $f(x,y)$ through anti-differentiation from our knowledge of its partial derivatives. The two integrals you calculated:
$$\int (x^2 + y^2) \, dx = \frac{1}{3} x^3 + x y^2$$
$$\int 2xy + \cos y \, dx = x y^2 + \sin y $$
gave specific anti-derivatives, but not the complete solution spaces to this anti-differentiation problem. If we obtain the complete solution by remembering to include the constant of integration (which is an arbitrary function of the other variable):
$$\int (x^2 + y^2) \, dx = \frac{1}{3} x^3 + x y^2 + C_1(y)$$
$$\int 2xy + \cos y \, dx = x y^2 + \sin y + C_2(x)$$
things become more clear. We know that $f(x,y)$ must be in both solution spaces, and that is what the process of "merging" solutions is doing: it is finding the class of functions that match both forms.
The complete candidate solution space for $f$ is
$$ f(x,y) = \frac{1}{3} x^3 + x y^2 + \sin y + C_3$$
In fact, the solution method doesn't introduce spurious solutions, so every candidate solution really is a solution.
