title: sympy - can't make nsolve method work
body: <p>I did this code:</p>
  
  <pre><code>from scitools.std import *
  from sympy import *
  
  x=Symbol('x')
  #Integral function
  #def f(x):             --&gt; I also tried this
   #   return exp(-x**2)
  
  f=exp(-x**2)
  
  intac=integrate(f,(x,0,1))
  print(nsolve(f,x,1))
  </code></pre>
  
  <p>The interpreter gives me: "local variable x referenced before assignment"</p>
  
  <p>If I try <code>nsolve(f,x,(0,1))</code> it gives me: "could not find root within given tolerance..."</p>
  
  <p>(Also, I tried <code>findroot(f,(0,1))</code> without any success (I imported <code>from mpmath import *</code> and then <code>mp.dps = 30; mp.pretty = True</code>).</p>