Python | sympy.primitive() method Last Updated : 06 Nov, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report With the help of sympy.primitive() method, we can find the common part of a mathematical expression by using sympy.primitive() method. Syntax : sympy.primitive() Return : Return a tuple having common part separated from mathematical expression. Example #1 : In this example we can see that by using sympy.primitive() method, we are able to find the common part from the mathematical expression. Python3 1=1 # import sympy from sympy import * x, y = symbols('x y') # Using sympy.primitive() method gfg = (3 * x + 9 * y).primitive() print(gfg) Output : (3, x + 3*y) Example #2 : Python3 1=1 # import sympy from sympy import * x, y = symbols('x y') # Using sympy.primitive() method gfg = (2 * x / 7 + 4 * y / 14).primitive() print(gfg) Output : (2/7, x + y) Comment More infoAdvertise with us Next Article Python | sympy.prod() method J jitender_1998 Follow Improve Article Tags : Python SymPy Practice Tags : python Similar Reads Python | sympy.prod() method With the help of sympy.prod() method, we can find the product of two integers or we can multiply the list with integers and it will return the sum of products in a list by using sympy.prod() method. Syntax : sympy.prod(val1, val2) Return : Return the product of numbers. Example #1 : In this example 1 min read Python | sympy.Pow() method With the help of sympy.Pow() method, we can find a raised to the power of b where a and b are parameters to the method. Syntax: Pow(a, b) Parameter: a - It denotes an integer. b - It denotes an integer. Returns: Returns an integer which is equal to a raised to the power of b, i. e., a^b. Example #1: 1 min read Python | sympy.Mod() method With the help of sympy.Mod() method, we can find the modulus and can give the parameters separately by using sympy.Mod() method. Syntax : sympy.Mod(var1, var2) Return : Return a value of modulo. Example #1 : In this example we can see that by using sympy.Mod() method, we are able to find the modulus 1 min read Python | sympy.Mul() method With the help of sympy.Mul() method, we can multiply two variables and can form a mathematical expression. Syntax : sympy.Mul() Return : Return the product of two variables. Example #1 : In this example we can see that by using sympy.Mul() method, we are able two multiply the two variables and we ca 1 min read Python | sympy.S() method With the help of sympy.S() method, we can make a single instance of an object by using sympy.S() method, where S denotes to singleton class. Syntax : sympy.S() Return : Return the single instance of an object. Example #1 : In this example we can see that by using sympy.S() method, we are able to cre 1 min read Python | sympy.Add() method With the help of sympy.Add() method, we can add two variables and can form a mathematical expression by using sympy.Add() method. Syntax : sympy.Add() Return : Return the addition of two variables. Example #1 : In this example we can see that by using sympy.Add() method, we are able to add the two v 1 min read Like