Switch order of function difference to be like integrals