title: What causes this error (AttributeError: 'Mul' object has no attribute 'cos') in Python?
body: <p>I am getting the following error code when trying to evaluate a definite integral in Python.</p>
  
  <pre><code>AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-7-2be8718c68ec&gt; in &lt;module&gt;()
        7 x, n = symbols('x n')
        8 
  ----&gt; 9 f = (cos(n*x))*(x**2-pi**2)^2
       10 integrate(f,(x,-n*pi,n*pi))
       11 
  
  AttributeError: 'Mul' object has no attribute 'cos' 
  </code></pre>
  
  <p>I have copied my input code below. Thanks for any help.</p>
  
  <pre><code>from pylab import *
  from sympy import *
  from numpy import *
  
  init_printing(use_unicode=False, wrap_line=False, no_global=True)
  
  x, n = symbols('x n')
  
  f = (cos(n*x))*(x**2-pi**2)^2
  integrate(f,(x,-n*pi,n*pi))
  </code></pre>