I am writing a code and at some point I have an exact division of a polynomial with a monomial; however, simplification does not seem to work
Ex:
((x1 + y2 – x1*y2)*(- x2^2*y1 + x2^2 + x2*y1^2 – y1^2)*(2*x1 + x2 + y1 – x1*x2 – x1*y1 – 1))/(x2 – y1) does not simplify.
However, notice that the middle factor in numerator (- x2^2*y1 + x2^2 + x2*y1^2 – y1^2) is divisible by (x2-y1) and MATLAB; indeed, simplifies (- x2^2*y1 + x2^2 + x2*y1^2 – y1^2)/(x2 -y1) and gives x2 + y1 – x2*y1.
How could I get around this issue?
Best Answer