I used the following snippet to simplify an equation:
syms P Q R S T U V A B C D E F G X Y
simplify((X - A)^2 + (Y - B)^2 - (X - B)^2 - (Y + A)^2)
Which gives me the result:
2*B*X - 2*A*Y - 2*A*X - 2*B*Y
On the other hand,
simplify((X - A)^2 + (Y - B)^2 - (X - B)^2 - (Y + 2*A)^2)
gives the same result after just re-ordering:
(A - X)^2 - (B - X)^2 - (2*A + Y)^2 + (B - Y)^2
What changed between these two equations? Am I not using the function correctly?
Any help would be appreciated.