Let $h$ be the function defined by $h(x)=\int_{0}^{x^2}e^{x+t}dt$ for all real numbers $x$. Then $h'(1)=\dots$ This question appeared in the GRE MATH SUBJECT TEST (GR$0568$) - Question# $24$:

Let $h$ be the function defined by $h(x)=\int_{0}^{x^2}e^{x+t}dt$ for all real numbers $x$. Then $h'(1)=$


(A) $e-1$


(B) $e^2$


(C) $e^2-e$


(D) $2e^2$


(E) $3e^2-e$


Now I have two approaches;

*

*FIRST APPROACH: (TRUE and I understand it very well):

$h(x)=\int_{0}^{x^2}e^{x+t}dt=e^{x+t}|_{t=0}^{t=x^2}=e^{x+x^2}-e^x$
Differentiating, we get $h'(x)=(1+2x)e^{x+x^2}-e^x$
So $h'(1)=(1+2(1))e^{1+1^2}-e^1=3e^2-e$
Hence E is the correct answer.


*

*SECOND APPROACH: (FALSE and I do not know where is the mistake):

Note that
$$A(x)=\int_{B(x)}^{C(x)}a(t)dt \implies A'(x)=a(C(x))C'(x)-a(B(x))B'(x)$$
So, $h'(x)=(e^{x+x^2})(2x)$
Therefore $h'(1)=(e^{1+1^2})(2(1))=2e^2$ (which is the incorrect option D).
Please clarify my mistake in the second approach.
Your help would be appreciated. THANKS.
 A: The falsity lies in the fact that the integrand $e^{x+t}$ also depends on $x$, and therefore we need to take the derivative of this term into account as well.
In particular, if you were to attempt to differentiate $h$ as a function of $x$, you'll have to make sure that you have $h$ as a composition involving functions of $x$, correctly written down, and then apply the chain rule.
Let's see how we can do that.

We first write $e^{x+t} = e^xe^t$. So now we have :
$$
h(x) = e^x\int_0^{x^2} e^tdt
$$
this is because $e^x$ is not changing w.r.t $t$, therefore it can be removed from the integrand.
Now , let $g(x) = \int_0^{x^2} e^tdt$. This is a composition of differentiable functions as follows : define $G(u) = \int_0^u e^tdt$ , then $g(x) = G(x^2)$.
Thus, we have :
$$
h(x) = e^xG(x^2) \implies h'(x) = e^xG(x^2) + e^x G'(x^2) \cdot 2x \\ \implies h'(x) = h(x) + 2xe^x e^{x^2}
$$
where $G'(x^2) = e^{x^2}$ by the fundamental theorem of calculus.
In particular : In YOUR explanation, we'd have no dependence of the integrand on $x$, so it's pretty much like the $e^x$ did not exist. That $e^x$ generates both the terms that your second answer misses i.e. $e^{x+x^2}$ and $-e^x$. That explains what went wrong in your answer.
Of course, now we have $h'(1) = h(1) + 2e^2$, and $h(1) = e\int_0^1 e^tdt = e(e-1) = e^2-e$. Adding these gives the right answer.

From a pedagogical point of view , note that calculating $\int_0^1 e^tdt$, in this situation, uses the fact that the anti-derivative of $e^t$ is $e^t$. However, this very same fact could have been used at the starting of the question as well, so rather than involve ourselves in the integral composition and the chain rule, we could as well have simplified $h(x)$ to be a  less complicated function of $x$.
In particular, in an examination and/or test, I would definitely think that the first approach yields quicker and works more efficiently. The only reason when the second approach would have been required, is if an antiderivative for the integrand was not easy to guess , BUT the integral's value at certain points was known. Sometimes we don't know the antiderivative of a function, but we know it's integral over certain intervals (e.g. $\int_0^\infty \frac{\sin x}{x} = \frac \pi 2$ which the anti-derivative is non-elementary). That's the only situation where I think the second approach could be useful over the first, in the context of this question.
This is the GRE Math we are talking about, however, so I'm not sure the second case appears at all, let alone seldom. It is then a better idea to proceed by looking for the anti-derivative, and therefore I recommend the first approach as a better approach from an exam point of view.
