Table of Contents

Factor


Description

Examples


Factor a multivariate polynomial:

def t = '2*x**3*y - 2*a**2*x*y - 3*a**2*x**2 + 3*a**4'.t
println Factor >> t
   > (x+a)*(x-a)*(-3*a**2+2*y*x)


Factor scalar parts in tensorial expression:

def t = '(a+b)**4*F_mn + (x**6-y**6)*R_mn'.t
println Factor >> t
   > (a+b)**4*F_mn+(x+y)*(x-y)*(x*y+x**2+y**2)*(-x*y+x**2+y**2)*R_mn


Factor expression that contains scalar combinations:

def t = '(a+b)**2*f_m*f^m + (a**2 - b**2)*f_a*f^a*f_b*f^b'.t
println Factor >> t
   > (a+b+(a-b)*f_{m}*f^{m})*(a+b)*f_{a}*f^{a}
Do not factor “tensorial” scalars:
println Factor[[FactorScalras:false]] >> t
   > (a+b)**2*f_{m}*f^{m}-(b+a)*(b-a)*f_{a}*f^{a}*f_{b}*f^{b}


See also