Application of fundamental theorem of calculus I have this problem:
$$ \frac{d}{dx} \left( \int_{\sqrt{x}}^{x^2-3x} \tan(t) dt \right) $$
I know how found the derivative of the integral from constant $a$ to variable $x$ so:
$$ \frac{d}{dx} \left( \int_a^x f(t) dt  \right) $$
but I don't know how make it between two variables, in this case from $\sqrt{x}$ to $x^2-3x$
Thanks so much.
 A: First we work formally: you can write your integral, say $F(x)=\int_a^{g(x)}f(t)\,dt-\int_a^{h(x)}f(t)\,dt$, where $f,g$ and $h$ are the functions appearing in your problem, and $a\in\mathbb R$ is constant. Next, you can apply chain rule together with fundamental theorem of calculus in order to derivate the difference above.
What is left? the existence of such $a$: Recall that by definition the upper and lower Riemann integrals are defined for bounded functions, so it is required that your integrand $\tan$ is bounded on one of the possible two integration intervals $I=[f(x),g(x)]$ or $J=[g(x),f(x)]$. This occurs only when
$$\sqrt x,\,x^2-3x\in\Bigl(-\frac{\pi}2+k\pi,\frac{\pi}2+k\pi\Bigr),\ \style{font-family:inherit;}{\text{for some integer}}\ k\,.\tag{$\mathbf{I}$}$$
Since both $\sqrt{x}$ and $x^2-3x$ are continuous functions, the set of the values $x$ satisfying the previous inclusion is non-empty (easy exercise left to you) and open in $\mathbb R$, so it is a countable union of open intervals. When you try to calculate the derivative, you are working locally, that is, in some of these intervals, so you simply choose a fixed element $a$ in such interval, and proceed as stated at the beginning.
If you are not familiar with the notion of "open set", then simply solve explicitly the equation $(\mathbf{I})$ and see what happens.
A: Hint: Let $F(t)$ be an antiderivative of $\tan t$. We can find an explicit formula for $F(t)$, but it is better not to.
Then our integral is $F(x^2-3x)-F(\sqrt{x})$. Differentiate, using the Chain Rule, and remembering that $F'(u)=\tan u$. 
A: In general, by chain rule, we have$$\dfrac{d}{dx} \left(\int_{f(x)}^{g(x)} h(t) dt\right) = \dfrac{d g(x)}{dx} \dfrac{d }{d g(x)} \left(\int_{f(x)}^{g(x)} h(t) dt\right) + \dfrac{d f(x)}{dx} \dfrac{d }{d f(x)} \left(\int_{f(x)}^{g(x)} h(t) dt\right)$$
Now make use the fundamental theorem of calculus to conclude that
$$\dfrac{d }{d g(x)} \left(\int_{f(x)}^{g(x)} h(t) dt\right) = h(g(x))$$
$$\dfrac{d }{d f(x)} \left(\int_{f(x)}^{g(x)} h(t) dt\right) = -h(f(x))$$
Hence,
$$\dfrac{d}{dx} \left(\int_{f(x)}^{g(x)} h(t) dt\right) = \dfrac{d g(x)}{dx} h(g(x)) - \dfrac{d f(x)}{dx} h(f(x))$$
A slightly more generalized version is the Leibniz integral rule.
