Finding the derivative of a definite integral $$
G(x)=\int_1^{x^2}(x-t)\sin^2(t)dt 
$$ 
Find $
G'(x)
$ given $G(x)$.
Normally I can solve these types of problems, but I'm thrown off by the two variables present, both $x$ and $t$ under the integral. 
 A: The general form of the fundamental theorem is
$$
\frac{d}{dx} \int _{L(x)}^{U(x)} h(x,t) dt = h(x,x) \,\left[
\frac{dU(x)}{dx}-\frac{dL(x)}{dx}
\right]
+\int _{L(x)}^{U(x)} \frac{\partial h(x,t)}{\partial x} dt
$$
In your case you have
$$
(x-x) \sin^2(x) ~(2x) + \int_1^{x^2} \sin^2(t) dt = \int_1^{x^2} \sin^2{t} dt=
-{{\sin \left(2\,x^2\right)-2\,x^2-\sin 2+2}\over{4}}$$
A: Note that 
$$
G(x)
=
x\int_1^{x^2}\sin^2 t\,dt-\int_1^{x^2}t\sin^2t\,dt
$$
so to differentiate we use the product rule on the first term and the fundamental theorem of calculus
\begin{align*}
G^\prime(x)
&=
x\cdot\sin^2(x^2)\cdot2x+\int_1^{x^2}\sin^2t\,dt-x^2\sin^2(x^2)\cdot2x \\
&=
2x^2\cdot\sin^2(x^2)+\frac{1}{2}\int_1^{x^2}(1-\cos(2\cdot t))\,dt-2x^3\cdot\sin^2(x^2) \\
&= 2x^2\sin^2(x^2)(1-x)+\frac{1}{2}\int_1^{x^2}(1-\cos(2\cdot t))\,dt
\end{align*}
Now, to finish, you need only evaluate the last integral.
A: Interesting problem, indeed. I worked it in the most simplistic manner and obtained for the integral  $$G(x)=\frac{1}{8} \left(2 x (x-1) \sin \left(2 x^2\right)+\cos \left(2 x^2\right)-2 (x+1)
   (x-1)^3+2 (x-1) \sin (2)-\cos (2)\right)$$ So the derivative with respect to $x$ came as $$G'(x)=\frac{1}{4} \left(-4 x^3+6 x^2-\sin \left(2 x^2\right)+4 (x-1) x^2 \cos \left(2
   x^2\right)-2+\sin (2)\right)$$ 
