consider the following integral with respect to $s$ and $t$
$$ \int^1_0 \int^1_0 g^\prime(s) g^\prime(t)\min(t,s)dsdt.$$ Here $g^\prime(\cdot)$ is the derivative of $g$. Note that $g:[0,1]\to\mathbb{R}$ is continuously differentiable, with $g(0)=0,g(1)=1$. Note carefully: $g$ is an ordinary, deterministic function and not a stochastic process. From here, we get \begin{align} \int^1_0 \int^1_0 g^\prime(s) g^\prime(t)\min(t,s)dsdt &= \int^1_0 g^\prime(t)\left(\int^t_0 sg^\prime(s) ds + \int_t^1 t g^\prime(s)ds\right)dt\\ &=\int_{0}^{1} g^{\prime}(t)\left(\operatorname{tg}(t)-\int_{0}^{t} g d s-t g(t)\right) d t\\ &=\int_{0}^{1} g^{\prime}(t)\left(-\int_{0}^{t} g d s\right) d t=\int_{0}^{1} g^{2} d t. \end{align} My question is, how did we get to the first equality? Thanks!
Y
Using the identity $\min(t, s) = \frac{t+s - |t-s|}{2}$, $$ \begin{align*} \int_0^1 \int_0^{1} g'(s)g'(t) \min(t, s) ds dt &= \int_0^1 \int_0^{1} g'(s)g'(t)\cdot \frac{t+s - |t-s|}{2} dsdt \\ &=\int_0^1 g'(t)\left(\int_0^{t} g'(s)\frac{t+s - (t-s)}{2}ds + \int_t^1 g'(s)\frac{t+s +(t-s)}{2}ds\right)dt \\ &=\int_0^1 g'(t) \left(\int_0^t sg'(s)ds + \int_t^1 tg'(s) ds\right)dt \end{align*} $$
In the second step we have used the fact that in the $t$-$s$ plane, below the line $s=t$, we have $s < t$ (i.e. $0 \le s \le t$) and above the line $s=t$ we have $s > t$ (i.e. $1 \ge s \ge t$).