double integration of a delta function I have a double integral of a delta function to compute. It seems simple enough, but the result I get differs from that in the paper I'm working through, and both differ from what Mathematica gives me! The integral is
$$
C=\int_{0}^{t} dt_1  \int_{0}^{t1}dt_2\,\delta(t_1-t_2)
$$
from which I get
\begin{align}
C&=\int_{0}^{t} dt_1  \int_{0}^{t1}dt_2\,\delta(t_1-t_2)\\
&= \int_0^{t}dt_1(\theta(t_1-t_1)-\theta(0-t_1))\\
&=\int_0^tdt_1\,(\theta(0)-\theta(-t_1)\\
&= t(\theta(0)-\theta(t))-0(\theta(0)-\theta(0))\\
&=t(\theta(0)-1)
\end{align}
Where $\theta$ is the Heaviside function and I have used the fact that $t>0$. 
However, the paper I'm working from gives the result as 
$$C = t(1-\theta(0))$$
the negative of my result. Mathematica gives me 
$$C = t(2\theta(t)-1)$$
What is the correct solution? 
 A: The reason your result differs from the paper's is that in your first step, since $t_2$ is the integration variable and appears with a minus sign, you should have had
$$
\int_0^t dt_1 (\theta(0-t_1) - \theta(t_1-t_1) )
$$
If this is confusing because of the $t_1$ and the limit being the same, try it with $$
\int_a^b \delta(-x) dx
$$
You should get $\theta(a) - \theta(b)$, not the other way around.
Now move on to 
$$
\int_a^b \delta(c-x) dx = \theta(a-c) - \theta(b-c)
$$
The reason your book result disagrees with Mathematica is that taking integrals of delta functions that end at zero, right in the middle of the delta function, goes where you shouldn't be allowed to go.  What, after all, should $\theta(0)$ be.  Sure you can define it to be $1$, but since it is discontinuous you also could have defined it to be $0$ or $\frac12$ without any disadvantage. 
Look at it this way:  Here are three definitions of delta functions, all of which work in terms of $\int_a^b f(x) \delta(x)$ being right for every open interval:
$$\delta_1(x) = \lim_{s\to 0} R(-s/2,s/2,1/s) \\
\delta_2(x) = \lim_{s\to 0} R(0,s,1/s) \\
\delta_3(x) = \lim_{s\to 0} R(-s,0,1/s) $$
where $R(a,b,h)$ is a rectangle on the X axis as its bottom side, from $a$ to $b$ with height $h$.
These are all good delta functions, but if you integrate to precisely $x=0$ they will give different results.
A: You've dropped a minus sign in doing the first integral. 
$$
\int_{0}^{t_1} \delta(t_1-t_2) \mathrm{d} t_2 = \int_{0}^{t_1} \delta(x)\, \mathrm{d}x = \theta(t_1) - \theta(0)
$$
