Skip to content
Related Articles
Open in App
Not now

Related Articles

Python | sympy.series() method

Improve Article
Save Article
  • Last Updated : 02 Aug, 2019
Improve Article
Save Article

With the help of sympy.series() method, we can find the series of some mathematical functions and trigonometric expressions by using sympy.series() method.

Syntax : sympy.series()

Return : Return a series of functions.

Example #1 :
In this example we can see that by using sympy.series() method, we are able to find the series of some trigonometric functions.




# import sympy
from sympy import * 
  
x, y = symbols('x y')
  
# Use sympy.series() method
gfg = cos(x).series()
    
print(gfg)

Output :

1 – x**2/2 + x**4/24 + O(x**6)

Example #2 :




# import sympy
from sympy import * 
  
x, y = symbols('x y')
  
# Use sympy.series() method
gfg = tan(x).series()
    
print(gfg)

Output :

x + x**3/3 + 2*x**5/15 + O(x**6)

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!