LHôpital's rule: fundamental theorem of calculus when the upper limit is a definite integral I am just starting to learn Calculus and we're at limits/derivatives and integrals.
I need to apply L'Hôpital's rule and I am using the fundamental theorem of calculus. 
I need to solve this example:
$$\lim_{x\to 1} \frac{ \int_0^{\int _{1} ^ x  (ue^{-u})du}  \, (t^2e^t ) \, dt}{(x^3-1)}  $$
The main instruction says to solve the limit using L'Hôpital's rule.
But, I don't know exactly how to apply L'Hôpital's rule when the upper limit is a definite integral.
I tried it in this way
$$\lim_{x\to 1}  \frac{ \frac{d}{dx} (\int_0^{\int _{1} ^ x  (ue^{-u})du}  \, (t^2e^t ) \, dt)}{ \frac{d}{dx} (x^3-1)}  $$
So I get
$$\lim_{x\to 1}  \frac{(\int_1^x ue^{-u}du)^2 e^{\int_1^x ue^{-u}du}}{3x^2 } \,  $$
I think that I am wrong in the way of interpreting the fundamental theorem of calculus part 1. What do you think?. Thank you.
 A: You can see that directly evaluating the numerator and denominator at $x=1$ leads to the indeterminate form $0/0$. By L'Hôpital,
$$\begin{split}
L&=\lim_{x\to 1} \frac{\int_{0}^{\int_{1}^{x}\left(u e^{-u}\right) d u}\left(t^{2} e^{t}\right) d t}{\left(x^{3}-1\right)} = \lim_{x \to 1} \frac{\frac{d}{dx} \int_{0}^{\int_{1}^{x}\left(u e^{-u}\right) d u}\left(t^{2} e^{t}\right) d t}{\frac{d}{dx}\left(x^{3}-1\right)} \\
&= \lim_{x\to 1} \frac{\left[\left(\int_{1}^{x}\left(u e^{-u}\right) d u\right)^2 e^{\left(\int_{1}^{x}\left(u e^{-u}\right) d u\right)}  \right] \cdot \frac{d}{dx}\left(\int_{1}^{x}\left(u e^{-u}\right) d u\right)}{3x^2} \\
&=\lim_{x\to 1} \frac{[(0) e^0 ] \cdot (1)e^{-1} }{3(1)^2} = 0,
\end{split}$$
where we have used the chain rule,
$$\frac{d}{dx}\Bigg|_{x=1} \int_0^{g(x)} t^2e^t dt = \left[\frac{d}{dy}\Bigg|_{y=g(1)} \int_0^yt^2e^tdt \right] \cdot \frac{d}{dx}\Bigg|_{x=1} g(x), $$
and the Fundamental Theorem of Calculus,
$$\frac{d}{dx} \int_a^x j(t)dt=j(x). $$
A: Let $$f(x) =\int_{1}^{x}ue^{-u}\,du$$ so that $f(x)\to f(1)=0$ as $x\to 1$ and by Fundamental Theorem of Calculus we have $f'(1)=1e^{-1}=1/e$.
Next note that the denominator of the expression under limit can be factorized as $$(x-1)(x^2+x+1)$$ and hence the desired limit equals $$\frac{1}{3}\lim_{x\to 1}\frac{\int_{0}^{f(x)}t^2e^t\,dt}{x-1}$$ which can be expressed further as $$\frac{1}{3}\lim_{x\to 1}\frac{f(x)-f(1)}{x-1}\cdot \frac{1}{f(x)}\int_{0}^{f(x)}t^2e^{t}\,dt$$ (note that $f(1)=0$).
The first factor under limit tends to $f'(1)=1/e$ via definition of derivative and the second factor tends to $$\lim_{u\to 0}\frac {1}{u}\int_{0}^{u}t^2e^t\,dt$$ via substitution $u=f(x) $. And by Fundamental Theorem of Calculus the above limit equals $0^2e^0=0$. Thus the desired limit is $0$.
There is no need to apply L'Hospital's Rule here and you just need to use Fundamental Theorem of Calculus. 
