Python | sympy.as_leading_term() method
Last Updated :
26 Jul, 2019
With the help of sympy.as_leading_term()
method, we can see the leading term in the mathematical expression of the variable passed as parameter in the sympy.as_leading_term()
method.
Syntax : sympy.as_leading_term(variable)
Return : Return a function or expression of a leading term.
Example #1 :
In this example we can see that by using sympy.as_leading_term()
method, we are able to check the leading term of mathematical function for variable which is passed as parameter.
from sympy import *
x, y = symbols( 'x y' )
gfg = (x * * 2 + 2 * x * y + y * * 2 ).as_leading_term(y)
print (gfg)
|
Output :
x**2
Example #2 :
from sympy import *
x, y = symbols( 'x y' )
gfg = (x * sin(x) * cos(y) + log(tan(x))).as_leading_term(y)
print (gfg)
|
Output :
x*sin(x) + log(tan(x))
Like Article
Suggest improvement
Share your thoughts in the comments
Please Login to comment...