title: How to do a symbolic taylor expansion of an unknown function $f(x)$ using sympy
body: <p>In <a href="http://www.sagemath.org/" rel="noreferrer">sage</a> it is fairly easy to do a Taylor expansion of an unknown function <em>f(x)</em>,</p>
  
  <pre><code>x = var('x')
  h = var('h')
  f = function('f',x)
  g1 = taylor(f,x,h,2)
  </code></pre>
  
  <p>How can this be done in sympy?</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>asmeurer points out that this is a feature which will be available soon in sympy from the pull request <a href="http://github.com/sympy/sympy/pull/1888" rel="noreferrer">http://github.com/sympy/sympy/pull/1888</a>. I installed the branch using pip,</p>
  
  <pre><code>pip install -e git+git@github.com:renatocoutinho/sympy.git@897b#egg=sympy --upgrade
  </code></pre>
  
  <p>However, when I try to calculate the series of <em>f(x)</em>,</p>
  
  <pre><code>x, h = symbols("x,h")
  f = Function("f")
  series(f,x,x+h)
  </code></pre>
  
  <p>I get the following error,</p>
  
  <blockquote>
    <p>TypeError: unbound method series() must be called with f instance as
    first argument (got Symbol instance instead)</p>
  </blockquote>