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.

 `# import sympy ` `from` `sympy ``import` `*`  ` `  `x, y ``=` `symbols(``'x y'``) ` ` `  `# Use sympy.as_leading_term(variable) method ` `gfg ``=` `(x``*``*``2` `+` `2` `*` `x``*``y ``+` `y``*``*``2``).as_leading_term(y) ` `   `  `print``(gfg) `

Output :

x**2

Example #2 :

 `# import sympy ` `from` `sympy ``import` `*`  ` `  `x, y ``=` `symbols(``'x y'``) ` ` `  `# Use sympy.as_leading_term(variable) method ` `gfg ``=` `(x ``*` `sin(x)``*``cos(y) ``+` `log(tan(x))).as_leading_term(y) ` `   `  `print``(gfg) `

Output :

x*sin(x) + log(tan(x))

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.