Monday, October 27, 2025
HomeLanguagesPython | sympy.limit() method

Python | sympy.limit() method

With the help of sympy.limit() method, we can find the limit of any mathematical expression, 
e.g., 

(1)   \begin{equation*} \lim_{x\to a} f(x) \end{equation*}

 

Syntax: limit(expression, variable, value)
Parameters: 
expression – The mathematical expression on which limit operation is to be performed, i. e., f(x). 
variable – It is the variable in the mathematical expression, i. e., x 
value – It is the value to which the limit tends to, i. e., a.
Returns: Returns the limit of the mathematical expression under given conditions. 
 

Example #1:

Python3




# import sympy
from sympy import *
 
x = symbols('x')
expr = sin(x)/x;
   
print("Expression : {}".format(expr))
     
# Use sympy.limit() method
limit_expr = limit(expr, x, 0
     
print("Limit of the expression tends to 0 : {}".format(limit_expr)) 


Output:  

Expression : sin(x)/x
Limit of the expression tends to 0 : 1

Example #2:

Python3




# import sympy
from sympy import *
 
x = symbols('x')
expr = sin(3 * x)/x;
   
print("Expression : {}".format(expr))
     
# Use sympy.limit() method
limit_expr = limit(expr, x, 0
     
print("Limit of the expression tends to 0 : {}".format(limit_expr)) 


Output: 

Expression : sin(3*x)/x
Limit of the expression tends to 0 : 3
RELATED ARTICLES

Most Popular

Dominic
32361 POSTS0 COMMENTS
Milvus
88 POSTS0 COMMENTS
Nango Kala
6728 POSTS0 COMMENTS
Nicole Veronica
11892 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11954 POSTS0 COMMENTS
Shaida Kate Naidoo
6852 POSTS0 COMMENTS
Ted Musemwa
7113 POSTS0 COMMENTS
Thapelo Manthata
6805 POSTS0 COMMENTS
Umr Jansen
6801 POSTS0 COMMENTS