Can I use second fundamental theorem to solve this problem? 
I have this task of solving
$$g(x)=\int_0^{x^2} y \tan(\pi y)dy$$
and I need to find a $~g'(2)~$.

I was thinking if I could use the second fundamental theorem of calculus, applying it I got this result:
$$g'(x)= y \tan(\pi y)$$
After this I just plug in $x^2$ and $0$
$$g'(x)=x^2\tan(\pi x^2)$$
and got my answer is: $$g'(2)=4\tan(4\pi)$$
Please suggest if this makes any sense and if it doesn't, how else can I solve it?
 A: Hint:If $g(x)=\int_a^{h(x)}f(t)dt$ then $$g'(x)=f(h(x))\frac{d}{dx}h(x)$$
In your case: $$g(x)=\int_0^{h(x)}y\tan(\pi y)\:dy\qquad\text{where }h(x)=x^2$$ Can you go from here$?$
A: Given that $$g(x)=\int_0^{x^2} y \tan(\pi y)dy$$
Here $$g'(x)=\int_0^{x^2} \dfrac{\partial}{\partial x}\left(y \tan(\pi y)\right)dy+x^2~\tan(
\pi~x^2) \left(\frac{d}{dx}x^2\right)-0 \frac{d0}{dx}$$
$$=2~x^3~\tan(
\pi~x^2)$$

*

*The above expression is nothing but "Leibniz Integral Rule (Differentiation under the integral sign)".


Leibniz Integral Rule (Differentiation under the integral sign):
Let $f(x, t)$ be a function of $x$ and $t$ such that both $f(x, t)$ and its partial derivative $\frac{\partial f}{\partial x}$ are continuous in $t$ and $x$ in some region of the $(x, t)$-plane, including $a(x) ≤ t ≤ b(x)$, and $ x_0 ≤ x ≤ x_1$. Also suppose that the functions $a(x)$ and $b(x)$ are both continuous and both have continuous derivatives for $x_0 ≤ x ≤ x_1$. Then, for $x_0 ≤ x ≤ x_1$,
$$\frac{d}{dx}\left(\int_{a(x)}^{b(x)} f(x,t) dt\right)=\int_{a(x)}^{b(x)} \frac{\partial }{\partial x}f(x,t) dt +f( x, b(x)) \frac{db}{dx}-f( x, a(x)) \frac{da}{dx}$$


*

*The (first) fundamental theorem of calculus is just the particular case of the above formula where $~a(x) = a~$, a constant, $~b(x) = x~$, and $~f(x, t) = f(t)~$.

