Finding the difference or sum of functions