# Differentiation under the Integral Sign

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.

• Note that $N_x$ in the final displayed equation should be $N$. But there are more serious issues ... Feb 7, 2017 at 22:05

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.
• Yes, I noticed my typo at the end and that I deleted a function of just $x$, say $h(x)$ after integrating $N_x$. It definitely wasn't pointed out that we are choosing $g$ in this way. I wrote literally what was given to me. This threw me off for hours. I knew it wasn't working, but I couldn't convince myself that what he wrote was incorrect. Thanks a lot! Feb 7, 2017 at 22:08
• I don't like what was given to you. I assume this is an ODE class and we're trying to integrate $M\,dx+N\,dy=0$ by finding $f$ and setting $f=\text{constant}$. But even in multivariable calculus, you have to go through this algorithm to choose $g$ correctly ... Feb 7, 2017 at 22:11
• What was being accomplished was to show necessary and sufficient conditions for $M\ dx + N \ dy$ to be exact i.e $M \ dx + N \ dy = 0$ is an exact differential equation. I am going to the Summer Graduate school in Montreal on Dynamical systems and one of the prerequisites is differential equations. I haven't taken this course in some time so I'm reading a book on my own right now. My plan of study was to just read this book which is very non-rigorous then move to a intermediate book and so on. Feb 7, 2017 at 22:13