sumpy中的身份

问题描述 投票:0回答:1

我希望这个变成这样

我找了很多,但没有找到。只需告诉我该函数的名称即可。够了

1

(5y-3x)**2

至:

25y-30xy+9x*2 怎么办?

请帮助我!

我用factor()进行了测试,但它不起作用!

python math sympy
1个回答
0
投票

expand()

>>> expand((x + 1)**2)
 2
x  + 2⋅x + 1

>>> expand((x + 2)*(x - 3))
 2
x  - x - 6

来自 https://docs.sympy.org/latest/tutorials/intro-tutorial/simplification.html#expand

© www.soinside.com 2019 - 2024. All rights reserved.