Double integral of $\exp(-t^2)$ on a triangular domain My calculus teacher gave us this interesting problem: Calculate
$$ \int_{0}^{1}F(x)\,dx,\ $$ where $$F(x) = \int_{1}^{x}e^{-t^2}\,dt $$
The only thing I can think of is using the Taylor series for $e^{-t^2}$ and go from there, but since we've never talked about uniform convergence and term by term integration, I suppose that there is an easier way to do this.
 A: Hint: First (1) flip the limits on the inner integral (assuming those limits are correctly stated), then (2) switch the order of integration:
$$
\int_{x=0}^1\int_{t=1}^x e^{-t^2}dt\,dx
\stackrel{(1)}=-\int_{x=0}^1\int_{t=x}^1 e^{-t^2}dt\,dx
\stackrel{(2)}=-\int_{t=0}^1\int_{x=0}^t e^{-t^2}dx\,dt
=-\int_{t=0}^1t e^{-t^2}dt
$$
A: No fancy stuff is needed. I think you could just integrate by parts.
$$\int_0^1 F(x)\,dx=[xF(x)]_0^1-\int_0^1 xF'(x)\,dx$$
The outintegrated part cancel, and using the fundamental theorem of calculus, $F'(x)=e^{-x^2}$. Thus
$$\int_0^1 F(x)\,dx=-\int_0^1 xe^{-x^2}\,dx
$$
from where I think you can finish.
A: To rigorously justify the use of Tonelli's theorem, let $g:\mathbb R^2\to\mathbb R$ be defined by $g(x,t) = e^{-t^2}\mathsf 1_E$, where  $$E = \{(x,t)\in\mathbb R^2 : 0 < x < t < 1\}. $$
Since $g(x,t)\geqslant 0$ for all $x,t$ and $g$ is measurable as the product of measurable functions, it follows that $$\int_{\mathbb R^2} g(x,t)\,\mathsf d(x\times t) = \int_{\mathbb R}\int_{\mathbb R} g(x,t)\,\mathsf dt\mathsf dx = \int_{\mathbb R}\int_{\mathbb R} g(x,t)\,\mathsf dx\mathsf dt. $$
We can also use Fubini's theorem. Since $0\leqslant g(x,t)\leqslant 1$ for all $x,t$ and $m(E)<1$, we have $$\int_{\mathbb R^2} |g(x,t)|\,\mathsf d(x\times t) <1<\infty,$$ so that $g\in L^1(\mathbb R^2)$ and again we conclude that the integral of $g$ is finite and equal to both of the iterated integrals.
A: You could do it directly. Since $$\int e^{-t^2}\,dt=\frac{\sqrt{\pi }}{2}  \text{erf}(t)$$ $$F(x) = \int_{1}^{x}e^{-t^2}\,dt=\frac{\sqrt{\pi }}{2}  (\text{erf}(x)-\text{erf}(1))$$ Now, integrating by parts $$\int \text{erf}(x)\,dx=x \,\text{erf}(x)+\frac{e^{-x^2}}{\sqrt{\pi }}$$ 
I am sure that you can take it from here.
