# Python | sympy.limit() method

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

(1) Syntax: limit(expression, variable, value)

Parameters:
expression – The mathematical expression on which limit opeartion 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:

 # 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:

 # 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


My Personal Notes arrow_drop_up Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

Article Tags :

Be the First to upvote.

Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.