How does Leibniz' rule work with a double definite integral, when the limits of integration of the inside integral depend on the variable in the outside integral?
For example, how do we calculate the below?
$$ \frac{\mathrm{d}}{\mathrm{d}s} \left[ \int_0^s \int_0^{s-x} f(x,y) \,\mathrm{d}y \,\mathrm{d}x \right] $$
It seems that applying Leibniz' rule gives:
$$ \int_0^{s-s} f(s,y) \,\mathrm{d}y + \int_0^s \frac{\mathrm{d}}{\mathrm{d}s} \int_0^{s-x} f(x,y) \,\mathrm{d}y \,\mathrm{d}x $$
$$ = \int_0^{s-s} f(s,y) \,\mathrm{d}y + \int_0^s \int_0^{s-s} f(s,y) \,\mathrm{d}y \,\mathrm{d}x = 0 \, $$
which seems to be wrong (see below). Alternately, if we don't substitute $s$ for $x$ in the limit of integration, then what do we do with the left over $x$?
Obviously, if we could manually integrate the inside integral this problem goes away, so assume that there is no closed form for $\int f(x,y)\,\mathrm{d}y$.
Note: for the specific limits of integration I chose, this is a simplex with side length, $s$, so I would assume the answer is:
$$ \int_0^s f(x, s-x) \,\mathrm{d}x $$
...but I can't figure out how to derive this result, or why/how to apply Leibniz' rule.
Correction and Answer:
It seems that applying Leibniz' rule gives:
$$ \int_0^{s-s} f(s,y) \,\mathrm{d}y + \int_0^s \frac{\mathrm{d}}{\mathrm{d}s} \int_0^{s-x} f(x,y) \,\mathrm{d}y \,\mathrm{d}x $$
$$ = \int_0^{s-s} f(s,y) \,\mathrm{d}y + \int_0^s f(x,s-x) \,\mathrm{d}x = \int_0^s f(x,s-x) \,\mathrm{d}x \, $$