#範例3-2:多項式的因式分解,因式拆解 from sympy import * x = symbols('x') f1= 'x**2-7*x+10' #f1= expand('x**2-7*x+10') #多項式的:因式分解:factor(f1,x) #factor(expr, x) 函數可以處理因式分解 print('多項式的因式分解=', factor(f1, x)) print('多項式的因式分解=', factor(x**2-7*x+10, x)) #因式拆解 = apart(f) f2 = 1/((1 + x)* (3 + x)) f3 = apart(f2) print('多項式的因式拆解=', apart(f2)) #因式合併 = together(p) print('多項式的因式合併=', together(f3))