Motion blur integral I was going through a biophysics paper and derived the main pieces of interest but ran into this integral:$$R=\frac{1}{\Delta t}\int \limits _0^{\Delta t}dt \int \limits _0^{\Delta t}dt's(t)s(t')\min (t,t')-\int \limits _0^{\Delta t}ts(t)\,dt,$$where $\Delta t$ is positive and $s(t)$ is a non-negative function that integrates to one over $[0,\Delta t]$ (i.e. $\displaystyle \int \limits _0^{\Delta t}s(t)\,dt=1$).
The question is, this is supposed to be equal to$$R=\frac{1}{\Delta t}\int \limits _0^{\Delta t}S(t)[1-S(t)]\,dt,$$where $\displaystyle S(t)=\int \limits _0^ts(t')\,dt'$.
Why is this? Why is
$$ \frac{1}{\Delta t} \left[ \int \limits _0^{\Delta t}dt\int \limits _0^{\Delta t}dt's(t)s(t')\min (t,t')-\int \limits _0^{\Delta t}ts(t)\,dt \right]=\frac{1}{\Delta t}   \int \limits _0^{\Delta t}S(t)[1-S(t)]\,dt$$?
Any hints appreciated. Even though I studied math in college I don't do integrals very often anymore so any leads are helpful.
 A: We will use the indicator function notation
$$ \mathbf{1}_{\{\ldots\}} = \begin{cases}
1, & \text{if $\ldots$ is true,} \\
0, & \text{if $\ldots$ is false.}
\end{cases} $$
Note that this allows us to write, for $t_1, t_2 \in [0, \Delta t]$,
$$ \min\{t_1, t_2\}
= \int_{0}^{\Delta t} \mathbf{1}_{\{u \leq t_1, u \leq t_2\}} \, \mathrm{d}u
= \int_{0}^{\Delta t} \mathbf{1}_{\{u \leq t_1\}}\mathbf{1}_{\{u \leq t_2\}} \, \mathrm{d}u. $$
Using this, we find that
\begin{align*}
&\int_{0}^{\Delta t} \int_{0}^{\Delta t} s(t_1)s(t_2) \min\{t_1, t_2\} \, \mathrm{d}t_1 \mathrm{d}t_2 \\
&= \int_{0}^{\Delta t} \int_{0}^{\Delta t} \biggl( \int_{0}^{\Delta t} s(t_1)s(t_2) \mathbf{1}_{\{u \leq t_1\}}\mathbf{1}_{\{u \leq t_2\}} \, \mathrm{d}u \biggr) \, \mathrm{d}t_1 \mathrm{d}t_2 \\
&= \int_{0}^{\Delta t} \biggl( \int_{0}^{\Delta t} \int_{0}^{\Delta t} s(t_1)s(t_2) \mathbf{1}_{\{u \leq t_1\}}\mathbf{1}_{\{u \leq t_2\}} \, \mathrm{d}t_1 \mathrm{d}t_2 \biggr) \, \mathrm{d}u \\
&= \int_{0}^{\Delta t} \biggl( \int_{u}^{\Delta t} s(t_1) \, \mathrm{d}t_1 \biggr) \biggl( \int_{u}^{\Delta t} s(t_2) \, \mathrm{d}t_2 \biggr) \, \mathrm{d}u \\
&= \int_{0}^{\Delta t} ( 1 - S(u) )^2 \, \mathrm{d}u. \tag{1}
\end{align*}
On the other hand, by integration by parts,
\begin{align*}
\int_{0}^{\Delta t} t s(t) \, \mathrm{d}t
&= \bigl[ t (S(t) - 1) \bigr]_{0}^{\Delta t} - \int_{0}^{\Delta t} (S(t) - 1) \, \mathrm{d}t \\
&= \int_{0}^{\Delta t} (1 - S(t)) \, \mathrm{d}t. \tag{2}
\end{align*}
Combining $\text{(1)–(2)}$, it follows that
\begin{align*}
R
&= \frac{1}{\Delta t} \int_{0}^{\Delta t} \bigl[ (1 - S(t))^2 - (1 - S(t)) \bigr] \, \mathrm{d}t \\
&= \bbox[color:red;padding:3px;border:1px dotted red;]{-} \frac{1}{\Delta t} \int_{0}^{\Delta t} S(t)[1 - S(t)] \, \mathrm{d}t.
\end{align*}

Example. If $\Delta t = 1$ and $s(t) = 2t$ (so that $\int_{0}^{1} s(t) \, \mathrm{d}t = 1$), then
$$ \int_{0}^{\Delta t} \int_{0}^{\Delta t} s(t_1)s(t_2) \min\{t_1, t_2\} \, \mathrm{d}t_1 \mathrm{d}t_2 = \frac{8}{15} $$
and
$$ \int_{0}^{\Delta t} t s(t) \, \mathrm{d}t = \frac{2}{3}, $$
and so, $R = -\frac{2}{15}$. By noting that $S(t) = t^2$, we get the same answer from
$$ -\frac{1}{\Delta t} \int_{0}^{\Delta t} S(t)(1 - S(t)) \, \mathrm{d}t = -\frac{2}{15}. $$

