Why is $(1-t)^2 == (t-1)^2$ in SageMath?

90 Views Asked by At

This is really odd, not much to say about it.

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 8.5, Release Date: 2018-12-22                     │
│ Using Python 2.7.15. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘

-t

2

There are 2 best solutions below

3
On BEST ANSWER

This is just basic algebra, namely laws of exponents:

$(t-1)^2 = (-1(1-t))^2= (-1)^2(1-t)^2 = (1-t)^2$

0
On

Forget $1-t$. Instead, think $T$. Is it so surprising/odd that $$(T)^2 = (-T)^2$$ ?

Alternatively we can expand them:

$$(1-t)(1-t)=(1)(1) +(2)(1)(-t)+(-t)(-t)=1-2t+t^2$$

$$(t-1)(t-1)=(t)(t)+2(-1)(t)+(-1)(-1)=t^2-2t+1$$