title: How to define a mathematical function in SymPy?
body: <p>I've been trying this now for hours. I think I don't understand a basic concept, that's why I couldn't answer this question to myself so far.</p>
  
  <p>What I'm trying is to implement a simple mathematical function, like this:</p>
  
  <pre><code>f(x) = x**2 + 1
  </code></pre>
  
  <p>After that I want to derive that function.</p>
  
  <p>I've defined the symbol and function with:</p>
  
  <pre><code>x = sympy.Symbol('x')
  f = sympy.Function('f')(x)
  </code></pre>
  
  <p>Now I'm struggling with defining the equation to this function <code>f(x)</code>. Something like <code>f.exp("x**2 + 1")</code> is not working.</p>
  
  <p>I also wonder how I could get a print out to the console of this function after it's finally defined. </p>