Integrating a function of two variables in exact ODE In exact ODE of the form 
$$M(x,y)\,dx+N(x,y)\,dy=0$$ 
To get the solution : we may integrate $M$ with respect to $x$ or integrate $N$ with respect to $y.$
I want to know why when integrating for example $M$ w.r.t. $x,$ we consider $y$ as a constant that can be taken outside the integration sign .. is this a general rule? when integrating wrt a specific variable we have to consider all other variables as constants? or this happens here because we are integrating partial derivatives of a function? 
But I think that the solution to the exact ODE is a relation between x and y . This means that y depends on x or  that x depends on y.. So when integrating wrt x , how can we consider y independent on x ?
 A: I'll need a specific example to explain this.  Say, we have $3x^2y \,dx+ (x^3+ y^2)\,dy= 0$.  That's "exact" because the derivative of $3x^2y$ with respect to $y$, $3x^2$, is the same as the derivative of $x^3+ y^2$ with respect to $x$.
That means that there exist a function, $F(x, y)$ such that $\frac{\partial F} {\partial x}= 3x^2y$ and $\frac{\partial F}{\partial y}= x^3$.  Since the partial derivative of $F$ with respect to $x$ treats $y$ as a constant, we can "integrate" with respect to $x$, treating $y$ as a constant.  From $\frac{\partial F}{\partial x}= 3x^2y$ we get $F= x^3y$ plus a "constant".  I put "constant" in quotes because, since we are treating $y$ as if it were a constant, we really have $F= x^3y+ \phi(y)$ where $\phi$ can be any function of the single variable $y$.
Now differentiate that with respect to $y$: $\frac{\partial F}{\partial y} = x^3+ \phi'(y)$  and that must be equal to $x^3+ y^2$.  "Fortunately" the $x^3$ terms cancel (that had to happen as a result of the "mixed derivative test" that showed this equation was exact) so we must have $\phi'(y)= y^2$.  From that $\phi(y)= \frac{1}{3}y^3+ C$ where C now really is a constant.  That is, we have $F(x,y)= x^3y+ \phi(y)= x^3y+ \frac{1}{3}y^3+ C$.
Putting all of this together, we have $dF= 3x^2y\,dx+ (x^3+ y^2)\,dy= 0$ resulting in $F(x, y)= x^3y+ \frac{1}{3}y^3+ C= 0$ or $x^3y+ \frac{1}{3}y^2= -C$.
