VOOZH about

URL: https://www.geeksforgeeks.org/python/python-sympy-simplify-method/

⇱ Python | sympy.simplify() method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Python | sympy.simplify() method

Last Updated : 1 May, 2023

With the help of sympy.simplify() method, we can simplify any mathematical expression.

Syntax: simplify(expression) 

Parameters: 
expression - It is the mathematical expression which needs to be simplified. 

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

Example #1: In this example we can see that by using sympy.simplify() method, we can simplify any mathematical expression. 

Output:

Before Simplification : sin(x)**2 + cos(x)**2
After Simplification: 1

Example #2: 

Output:

Before Simplification : (x**3 + x**2 - x - 1)/(x**2 + 2*x + 1)
After Simplification : After Simplification : x - 1
Comment
Article Tags:
Article Tags: