Open In App

Python | sympy.series() method

Last Updated : 02 Aug, 2019
Improve
Improve
Like Article
Like
Save
Share
Report

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)


Like Article
Suggest improvement
Share your thoughts in the comments

Similar Reads