Change the order of integration to solve tricky integrals