Question: equality of polynomials

The command "if x+x=2*x then print(1) else print(0) fi" gives the output 1. Similarly for

x*x=x^2. But "if (x+1)^2=x^2+2*x+1 then print(1) else print(0) fi" gives 0. I suppose that this isn't considered a bug, but could someone explain the rationale behind it? How does one get this type of command to behave in what I would consider the intuitive way?

Please Wait...