I was trying to solve the following integral: $$ \begin{equation} \int _0^{\alpha }\int _0^{\beta }\min (x,y)dydx \tag{1} \label{eq:1} \end{equation} $$ with $\alpha,\beta > 0$, (generally, $\alpha \ne \beta$).
I've found a question from MSE (how to solve double integral of a min function) where an user suggested the following equivalence: $$ \begin{equation} \int_0^{\beta } \min (x,y) \, dy =\int_0^x \min (x,y) \, dy+\int_x^{\beta } \min(x,y) \, dy \\ =\int_0^x y \, dy+\int_x^{\beta } x \, dy \tag{2} \label{eq:2} \end{equation} $$ The explanation is in link above and I also found it by myself. The issue is that the $(1)$ and the $(2)$ inserted in $(1)$: $$ \int _0^{\alpha }\int _0^{\beta }\min (x,y)dydx \tag{1} $$ $$ \int _0^{\alpha } \bigg( \int_0^x y \, dy+\int_x^{\beta } x \, dy \bigg) dx \tag{3} $$ are giving me different results. In fact, generally, through different cases of $\alpha$ and $\beta$ I set, it seems that, if $\beta \ge \alpha$, the $(1)$ and $(3)$ are equivalent, else they aren't. What am I missing? Have I to suppose some conditions for the $(2)$ is effective? Is there a problem of integral interchange?
