Problem:
Find the second order expansion about $x = 4$ of the composition $f(g(x))$ for $f(x) = \tan ^{-1}(x)$ and $g(x) = $x^3$
from sympy import *
from sympy.abc import x

f = atan(x)
g = x**3
series = f.subs(x, g).series(x, 4, 2)
print(series)
