Suppose $M(x,y)$ and $N(x,y)$ are $\mathcal{C}^1$ functions on some open set in the plane. Suppose also that we have $M(x,y) dx + N(x,y) dy = 0, f_x(x,y) = M(x,y)$ and $M_y = N_x$. The author shows that $f_y(x,y) = N$ in the following manner:
$$f_x(x,y) = M(x,y) \Rightarrow f(x,y) = \int M(x,y)\ dx + g(y) \Rightarrow f_y(x,y) = \frac{\partial}{\partial y} \int M(x,y) \ dx + g'(y) = N(x,y)$$
I am confused by the last equality. By the Leibniz integral rule we have:
$$\frac{\partial}{\partial y} \int M(x,y) \ dx + g'(y) = \int N_x(x,y) \ dx + g'(y) = N(x,y)+ (h(x) + g'(y))$$
My question is, how does the $g'(y)$ term vanish? I'm guessing that I'm looking over some chain rule fact, but I'm not seeing it right now.
First of all, we're not working on integral curves of $M\,dx+N\,dy=0$ here. We're just talking about integrating $df=M\,dx+N\,dy$ if we know the $1$-form is closed — presumably on a convex set. The author cannot possibly show that if you define $f(x,y)$ as an arbitrary antiderivative of $f_x = M$, then it follows that $f_y=N$. [For example, take $M=2xy$, $N=x^2+2y$. $f(x,y)=\int M\,dx = x^2y + g(y)$. Obviously, I must choose $g(y)=y^2+C$ to get $f_y=N$.] What should be written there is that we can choose $g(y)$ appropriately to make it work.
The indefinite integrals make this all very confusing and hazy. Let's write a definite integral instead. Assume that our domain is a convex domain containing the origin. Set $$f(x,y) = \int_0^x M(t,y)dt + g(y).$$ Then we'll have $$\frac{\partial f}{\partial y} = \int_0^x \frac{\partial M}{\partial y}(t,y)dt + g'(y) = \int_0^x \frac{\partial N}{\partial x}(t,y)dt + g'(y) = N(x,y)-N(0,y)+g'(y).$$ We now choose $g(y)$ so that $g'(y)=N(0,y)$ (which we obviously can do), and then we're happy.
P.S. Hi :)