I am a little surprized by the assertion of Halls of Ivy that the two expressions are equal whenever they both exist, as I cannot find any reference for such a strong statement in my tiny library of analysis books. Can you give me one?
Counterexamples seem to exist to even the finite interval case for such a strong assertion, viz. Gelbaum and Olmsted, Counterexamples in analysis, page 123, the function f(x,y) = (x^3/y^2) e^(-x^2/y), if y > 0, and 0, if y = 0.
defined in the closed upper half plane y ≥ 0. The problem is this function, although continuous in each variable separately, is not continuous at (0,0) as a function of two variables. Then the integral from y=0 to y=1, of (∂f/∂x)(0,y) dy is zero, while d/dx of the integral of f(x,y)dy evaluated at x =0, is 1.
(Note the roles of the variables x and y are interchanged from the case here.)
Is there something different about the open interval case?
actually here is a simpler example given me by a friend, that seems to work in the present setting as well:
let f(x,y) = 1, if 0≤ y ≤ 1, and 0 ≤ x ≤ y^2 (1-y)^2,
and f(x,y) = 0 elsewhere.
Then for fixed x, as a function of y, this is equal to 1 at most on a short interval and zero elsewhere. Hence, given any y, for all but at most one x, the derivative ∂/∂y(f(x,y)) exists and is zero. In particular the integral wrt x, over the whole real line, of the derivative ∂/∂y(f(x,y)) is zero as a function of y.
On the other hand, for fixed y between 0 and 1, the integral wrt x, over the whole real line, equals y^2 (1-y)^2, while for other y, it equals zero. Thus the derivative d/dy of the integral of f(x,y)dx equals 2y(1-y)(1-2y), for 0 ≤ y ≤ 1, and 0 elsewhere.
hence the integral of the derivative does not equal the derivative of the integral.
Does this seem ok? I am pretty weak at real analysis.