Remember the Leibniz rule for differentiation under the integral sign: $\frac{d}{dx} \int_{a(x)}^{b(x)} f(t, x) dt = f(b(x), x) b'(x) - f(a(x), x) a'(x) + \int_{a(x)}^{b(x)} \frac{\partial}{\partial x} f(t, x) dt$. In this problem, $f(t, x) = t^2 f(t)$ which is independent of $x$, so the last term is zero.