Differentiation for a function in the integral form. I want to know generally how we differentiate a function $F(x)$ in the following form,
$$F(x)=\int_a^x f(x,t)dt$$
For example, if we can work out the explicit form of $F(x)$ as the example below $$F(x)=\int_0^x e^{xt}dt=\frac{e^{x^2}-1}{x}$$ 
if we differentiate $F(x)$, we get
$$\frac {dF(x)}{dx}=\frac{2x^2e^{x^2}-e^{x^2}+1}{x^2}$$
This simple example shows a very different approach from the case when we different $F(x)=\int_a^xf(t)dt$, which simply gives us $f(x)$.
Now suppose I have the formula for calculating the money I get after $T$ years, $P(T)$ with continuous depositing, of which the rate is given by $S(t)$, and continuous compounding, of which the annual rate is given by $r$. The formula is $$P(T)=\int_0^TS(t)e^{r(T-t)}dt$$
Since the $S(t)$ is not given explicitly, then how do I get an expression for $\frac{dP(T)}{dT}$? 
I have tried using the first principle by
$$\frac{dP(T)}{dT}=\lim_{\Delta T\to0} \frac{P(T+\Delta T)-P(T)}{\Delta T}$$ and I could not figure it out. Is there a way to find an expression for the derivative $\frac{dP(T)}{dT}$?
 A: We have that
$$
\eqalign{
  & F(x + dx) - F(x) = \int_{t = a}^{x + dx} {f(x + dx,t)dt}  - \int_{t = a}^x {f(x,t)dt}  =   \cr 
  &  = \int_{t = a}^x {\left( {f(x + dx,t) - f(x,t)} \right)dt}  + \int_{t = x}^{x + dx} {f(x + dx,t)dt}  =   \cr 
  &  = \left( {\int_{t = a}^x {f_x (x,t)dt} } \right)dx + f(x + dx,x)dx =   \cr 
  &  = \left( {\int_{t = a}^x {f_x (x,t)dt} } \right)dx + f(x,x)dx + f_x (x,x)\left( {dx} \right)^2 \quad  \Rightarrow   \cr }$$

$$  \Rightarrow \quad {d \over {dx}}F(x) = \int_{t = a}^x {{\partial  \over {\partial x}}f(x,t)dt}  + f(x,x)  
$$

So in your example
$$
\eqalign{
  & {d \over {dx}}F(x) = \int_{t = 0}^x {{\partial  \over {\partial x}}e^{\,x\,t} dt}  + e^{\,x^{\,2} }  =   \cr 
  &  = \int_{t = 0}^x {te^{\,x\,t} dt}  + e^{\,x^{\,2} }  = \left. {{{e^{\,x\,t} \left( {tx - 1} \right)} \over {x^2 }}\,} \right|_{t = 0}^x  + e^{\,x^{\,2} }  =   \cr 
  &  = {{e^{\,x^{\,2} } \left( {\,x^{\,2}  - 1} \right)} \over {x^2 }} + {1 \over {x^2 }} + e^{\,x^{\,2} }
  = {{\,2e^{\,x^{\,2} } x^{\,2}  - e^{\,x^{\,2} }  + 1} \over {x^2 }} \cr} 
$$
A: You can impose $a=Tt$ so you have that the integral is 
$P(T)=\frac{1}{T}\int_0^1 S(\frac{a}{T})e^{r\frac{(T^2-a)}{T}}da$
So
$\frac{d}{dT}P(T)=\frac{1}{T}\int_0^1[-\frac{a}{T^2}S’(\frac{a}{T})e^{r\frac{(T^2-a)}{T}}+$
$+r(1+\frac{a}{T^2}) e^{r\frac{(T^2-a)}{T}} S(\frac{a}{T})]da$
A: You want to use Leibniz integral rule. If $f(x,t)$ is regular enough the following formula holds
$$\frac{d}{dx} \int_{a(x)}^{b(x)} f(x,t)\, dt  = f\big(x,b(x)\big) b'(x) - f\big(x,a(x)\big)a'(x) + \int_{a(x)}^{b(x)}\frac{\partial}{\partial x}f(x,t)\, dt\,.$$
