For polynomials:
-x1 - x2 - 1/(x1 \[Lambda] + x2 \[Mu]) +
2 (x1 \[Lambda] + x2 \[Mu]) + (Log[x1] - Log[x2])/(x1 - x2)
to get the result:
(x1 - x2) (-1 + 2 \[Lambda]) - 1/(x1 \[Lambda] + x2 \[Mu]) + (
Log[x1] - Log[x2])/(x1 - x2)
Why can't we handle it using this method?
-x1 - x2 - 1/(x1 \[Lambda] + x2 \[Mu]) +
2 (x1 \[Lambda] + x2 \[Mu]) + (Log[x1] - Log[x2])/(x1 - x2) //
Collect[#, {x1, x2}] &