# Python | sympy.Function() method

With the help of `sympy.Function()` method, we can find the various functions in the whole mathematical expression like f(x), sin(x), log(x), etc by using `sympy.Function()` method.

Syntax : `sympy.Function()`
Return : Return the list of functions in mathematical operation.

Example #1 :
In this example we can see that by using `sympy.Function()` method, we are able to find the function in the mathematical operation.

 `# import sympy ` `from` `sympy ``import` `*`  ` `  `x, y ``=` `symbols(``'x y'``) ` `f ``=` `Function(``'f'``) ` ` `  `# Use sympy.Function() method ` `gfg ``=` `(f(x) ``+` `2` `*` `tan(y ``+` `I ``*` `pi) ``+` `log(``2` `*` `x)).atoms(Function) ` `   `  `print``(gfg) `

Output :

{f(x), tan(y + I*pi), log(2*x)}

Example #2 :

 `# import sympy ` `from` `sympy ``import` `*`  ` `  `x, y ``=` `symbols(``'x y'``) ` `f ``=` `Function(``'f'``) ` ` `  `# Use sympy.Function() method ` `gfg ``=` `(``2` `+` `3` `*` `cos(y) ``+` `5` `*` `log(``2` `*` `x)).atoms(Function) ` `   `  `print``(gfg) `

Output :

{cos(y), log(2*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.