# Leibniz rule of a product

Why can't I apply Leibniz' rule in the following way?

$$\frac{d}{ds} g(s)\int_0^\infty f(s,x,u) \, du = \int_0^\infty \frac{d}{ds}g(s)f(s,x,u)\,du,$$

assuming $gf$ and $(gf)'$ are continuous on $[0,+\infty]\times [s_0,s_1]$ for some $s_0<s_1\in\mathbb{R}$.

-
It is unclear if there is any relationship between $s$, $x$ and $u$. Are $x$ and $u$ functions of $s$? – Siminore Aug 4 '12 at 16:51
@Siminore, well, the $u$ is a dummy variable, so... – J. M. Aug 4 '12 at 16:57
As written, the domain of $f$ seems to be a subset of $\mathbf R^2$, so the expression you've written doesn't make sense (saying that it is continuous in something two-dimensional). Unless you mean that for all $x$, $f(s,x,u)$ is continuous as a function of $s,u$ in the specified range. But in this case the usage of $x$ as a bound of the range is very confusing. – tomasz Aug 4 '12 at 20:13

The problem I was originally having was in thinking that $g(s)$ was a constant coefficient of the definite integral. However, since we wish to differentiate w.r.t. $s$ it seems we can not think of $g$ as a constant, which seems obvious now. Instead, we must treat $g\int$ as a product and apply the product rule of differentiation, e.g.
$$\frac{\partial}{\partial s}g(s)\int_0^\infty f(s,x,u)du = g(s)\frac{\partial}{\partial s}\int_0^\infty f(s,x,u)du + \left(\frac{d}{d s}g(s)\right)\int_0^\infty f(s,x,u)du.$$
We can then take the $\partial/\partial s$ inside the integral as required.