Finally, if the factor is known and the form of the complementary factor is known, type it out, as was done in the OP: However, I tend to assume that a question asking for code to achieve a particular output is looking for something more general than typing out a particular, known result. In generalizing, it isn’t clear to me what can be assumed about the input and what is the exact form of the output. For instance, I was looking at the input as a linear polynomial in m with a parameter x. Perhaps that’s not always the case, because it’s a bit annoying (programmatically) that the coefficient of m is to be -1. In any case, if there is a general problem and none of the ad hoc solutions help with it, please add more details.
There is no unified standard for factorization when it comes to this problem and similar ones encountered in practice. We must analyze each case on its own merits. In the problem from the post, we can see that (x - m + 1) is a linear function, so its zero and monotonicity are easy to determine. When we use the Together or Simplify functions to simplify the expression, we get ((1 - m + x) (-1 + E^x + E^x x))/(1 + x), where the monotonicity and zero of this part (-1 + E^x + E^x x))/(1 + x) are difficult to see clearly. Therefore, I want to convert this part (-1 + E^x + E^x x))/(1 + x) into (E^x - 1/(1 + x)), whose monotonicity and zero are easy to determine under the premise that the domain is x > -1. Hence this question arises. Of course, if we unify this situation by separating the linear function form on one side and simplifying the other complex forms separately, that would work too.