Solve the following problem:
For the function f(x1, x2, x3, x4) = x1 + x1x2x3 + x1x2x4x2x3x4 calculate the Boolean difference of the first and the second order with respect to the variables x1, x2, x4 and x1x3 and x2x3.
Make sure you use enough details to support your answer.