Solution (source code)

= Solution

On the first leg $y=0$ and $x$ decreases from one to zero; on the second $x=0$ and $y$ increases from zero to one. Adding their <line integrals> gives
$$
I_2=\alpha\int_1^0x^2\,dx+\beta\int_0^1y^2\,dy
=\boxed{\frac{\beta-\alpha}{3}}.
$$
The negative sign in the first term follows from the direction of traversal.