What is $\frac{d}{dx}\int_0^{x^2}f(t) \,dt$? What is $\frac{d}{dx}\int_0^{x^2}f(t) dt$
My understanding is that if $F(t)$ is antiderivative of $f(t)$, then it should be $F(x^2)-F(0)$, but it is $f(x^2)(2x)$
The entire problem is as follow:
Find $f(4)$ if $\int_0^{x^2}f(t)\, dt=x\cos (\pi x)$
and the solution is 
$\frac{d}{dx}\int_0^{x^2}f(t) \,dt=\cos \pi x -\pi x \sin \pi x\Rightarrow f(x^2)x=\cos \pi x -\pi x \sin \pi x \Rightarrow f(x^2)=\frac{\cos \pi x -\pi x \sin \pi x}{x}$
Thus $x=2\Rightarrow f(4)=1/4$
 A: Let $u=x^2$ and apply chain rule.
$$\frac{d}{dx}\int_0^{u}f(t) dt = f(u) \frac{du}{dx}=f(x^2)\cdot2x.$$
A: You were correct in assessing the situation in terms of an antiderivative of $f$, but you didn't follow through. If $F$ is an antiderivative of $f$, by the Fundamental Theorem of Calculus,
$$
F(x^2)-F(0) = \int_0^{x^2}f(t)\,dt.
$$
To take the derivative, we apply the chain rule since we have to differentiate the composite $F(x^2)$. Since $F(0)$ is a constant, we have
$$
F'(x^2)(x^2)' = \frac{d}{dx}\int_0^{x^2}f(t)\,dt.
$$
$F$ is an antiderivative of $f$, so $F'(x^2) = f(x^2)$. Putting it all together,
$$
\frac{d}{dx}\int_0^{x^2}f(t)\,dt = 2x\,f(x^2).
$$
A: As you said, if $f$ is continuous, then $\int_0^{x^2}f(t)dt=F(x^2)-F(0)$, so by taking the derivative on both sides using the chain rule one gets:
$$\frac{\partial}{\partial x}\int_0^{x^2}f(t)dt=F'(x^2)\cdot 2x=2xf(x^2)$$
A: You can use this general formula : $$\frac {d}{dx} \int_{u(x)}^{v(x)} f(t) dt = f(v(x))v'(x)-f(u(x))u'(x).$$ 
Note that $u(x)$ and $v(x)$ must be differentiable which is your case.
A: Another (very slightly different) approach.
Start by setting $u=x^2$, and define a function
$$F(u) = \int_0^u f(t)\space dt$$
The second fundamental theorem of calculus tells us that $\frac{dF}{du} =f(u) = f(x^2)$.  But that's not what we need to compute.  We are asked to find $\frac{dF}{dx}$.  (Notice the different variable in the bottom of the derivative.)
Fortunately the chain rule comes to our rescue.  We have
$$\frac{dF}{dx} = \frac{dF}{du} \cdot \frac{du}{dx}$$
The second factor on the right tells you where the unexpected $2x$ in the solution comes from.
