How to find the derivative of an integral where both, the limit and the integrand, are functions of x?

I found a good expository paper by Keith Conrad, which explains by examples the technique of derivative under the integral sign. Here's the link:
http://www.math.uconn.edu/~kconrad/blurbs/analysis/diffunderint.pdf
In these examples, the integrand is a function of both $x$ (the variable on which the differentiation is intended) and the parameter $t$. However, in most of the examples given in the paper, the limits of integration are constants.

Then, there're these following links from mathmistakes.info, which have examples where the limit of the integral is a function of $x$ but the integrand itself is independent of $x$ (i.e. the integrand is solely a function of $t$).
http://www.mathmistakes.info/facts/CalculusFacts/learn/doi/doi.html
http://www.mathmistakes.info/facts/CalculusFacts/learn/doi/doif.html

I was looking for techniques for differentiating integrals of the following kind $$\int_0^{g(x)} h(x,t) dt$$ where both the limit and the integrand are functions of $x$. I would prefer to have some examples of course, but any insight is appreciated.


There is a full derivation here of a more general version:

$$ f(x) = \int_{s(x)}^{g(x)} h(x, t) dt $$

$$ \frac{df}{dx} = \int_{s(x)}^{g(x)} \partial_x h(x, t) dt + h(x, g(x)) \frac{dg}{dx} - h(x, s(x)) \frac{ds}{dx} $$


For sure, this is not a complete answer (since I must confess I do not remember how it is established), but, as far as I know, I think that it is$$\frac{d}{dx}\int_0^{g(x)} h(x,t)\, dt= h\big(x,g(x)\big)\,\frac{dg(x)}{dx}+\int_0^{g(x)} \frac{dh(x,t)}{dx}\, dt$$ The first term is just the application of the fundamental theorem of calculus.

It is easy to control that, at least, this holds using $h(x,t)=a(x)+b(t)$, $h(x,t)=a(x)\,b(t)$, $h(x,t)=\frac{a(x)}{b(t)}$ and for almost any composition where we can separate the variables.

I played with some more complex functions in which the variables cannot be separated and it works.

I hope and wish you will receive better answers.