Session Python
>>> from sympy import Symbol, cos
>>> x = Symbol('x')
>>> e = 1/cos(x)
>>> print e.series(x, 0, 10)
1 + (1/2)*x**2 + (5/24)*x**4 + (61/720)*x**6 + (277/8064)*x**8 + O(x**10)
Session ISymPy
In [1]: (1/cos(x)).series(x, 0, 10)
Out[1]:
2 4 6 8
x 5*x 61*x 277*x
1 + ── + ──── + ───── + ────── + O(x**10)
2 24 720 8064
SymPy