Friday, September 5, 2025
HomeLanguagesPython | sympy.gammasimp() method

Python | sympy.gammasimp() method

With the help of sympy.gammasimp() method, we can simplify expressions with gamma functions or combinatorial functions with non-integer argument

Syntax: gammasimp(expression)

Parameter:
expression – It is the mathematical expression which needs to be simplified.

Returns: Returns a simplified mathematical expression corresponding to the input.

Example #1:




# import sympy 
from sympy import * x = symbols('x')
expr = gamma(x)*gamma(1 - x)
print("Expression = {}".format(expr))
   
# Use sympy.gammasimp() method 
simple_expr = gammasimp(expr)  
      
print("Simplified Expression : {}".format(simple_expr))  


Output:

Expression = gamma(x)*gamma(1 - x)
Simplified Expression : pi/sin(pi*x)

Example #2:




# import sympy 
from sympy import * x = symbols('x')
expr = gamma(x + 1)/gamma(x - 1)
print("Expression = {}".format(expr))
   
# Use sympy.gammasimp() method 
simple_expr = gammasimp(expr)  
      
print("Simplified Expression : {}".format(simple_expr))  


Output:

Expression = gamma(x + 1)/gamma(x - 1)
Simplified Expression : x*(x - 1)
Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32264 POSTS0 COMMENTS
Milvus
81 POSTS0 COMMENTS
Nango Kala
6634 POSTS0 COMMENTS
Nicole Veronica
11801 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11863 POSTS0 COMMENTS
Shaida Kate Naidoo
6750 POSTS0 COMMENTS
Ted Musemwa
7025 POSTS0 COMMENTS
Thapelo Manthata
6701 POSTS0 COMMENTS
Umr Jansen
6718 POSTS0 COMMENTS