• old wiki How It Works
  • in Pow.expand(), we call Mul(a+b,a+b).expand(), but we don't want that to be evaluated, because it would change to Pow(a+b,2).expand() resulting in infinite recursion.
  • Add.eval() and Mul.eval() after converting itself to canonical form, we have n arguments and we need to construct Add or Mul using these arguments and we set evaluate=False, otherwise we again would get infinite recursion.