我使用sympy以符号的方式表达矩阵乘法结果的迹。结果如下,是否可以得到产品完全展开的形式?
使用
expand
>>> expr = (x + y)*(x + 1); expr.expand() x**2 + x*y + x + y'