# how to solve double integral of a min function

I came across this integral in a book. I don't understand how the author writes the following expression for it.

$$\int_0^T \int_0^T \min(t,s)\, dt\, ds = \int_0^T \left(\int_0^s t\, dt + \int_s^T s \,dt\right) ds$$

-
you don't understand how the two integrals are equal? –  Alex Becker May 18 '12 at 8:42
yes that is correct –  user957 May 18 '12 at 8:44

Consider $\min(s,t)$ as a function of $t$: its value is $t$ when $t\le s$, and $s$ when $t\ge s$. Thus, it can be described as $$\min(s,t)=\begin{cases}t,&0\le t\le s\\ s,&s\le t\le T\;. \end{cases}$$

Integrating this with respect to $t$ over the interval $[0,T]$ gives you

$$\int_0^s t\, dt + \int_s^T s \,dt\;,$$

which is therefore the same as $$\int_0^T \min(t,s)\, dt\;.$$

-
I was about to write the Iverson solution, but yours is essentially what I was going to write anyway... –  Ｊ. Ｍ. May 18 '12 at 8:51
cool thank you. –  user957 May 18 '12 at 8:58

By breaking up the range of integration we get $$\int_0^T \min(t,s)\, dt\ = \int_0^s \min(t,s)\, dt + \int_s^T \min(t,s) \,dt$$ and noting that when $0\leq t\leq s$ we have $\min(t,s)=t$ and when $s\leq t\leq T$ we have $\min(t,s)=s$ we get that $$\int_0^s \min(t,s)\, dt + \int_s^T \min(t,s) \,dt=\int_0^s t\, dt + \int_s^T s \,dt$$ thus integrating from $0$ to $T$ with respect to $s$ gives $$\int_0^T \int_0^T \min(t,s)\, dt\, ds = \int_0^T \left(\int_0^s t\, dt + \int_s^T s \,dt\right) ds .$$

-