calculating cubic root in python
<p>I'm trying to evaluate the following function in python:</p>

<pre><code>f(x) = (1 + cos(x))^(1/3)


def eval( i ):
   return math.pow( (1 + math.cos( i )), 1/3)
</code></pre>

<p>why is it always returning me <code>1</code>?
I'm trying to calculate the <code>Right</code> and <code>Left</code> approximation of an integral, and latter apply <code>Simpson's Rule</code>, but <code>Python</code> does not seem to like that expression.
Help?
<strong>*Complete Code *</strong></p>

<pre><code>import math

min = 0
max = math.pi / 2
n = 4
delta  = ( min + max ) / n

def eval( i ):
   return math.pow( (1 + math.cos( i )), 1/3)

def right( ):
   R = 0
   for i in range(1, n+1):
        R += eval( i )

   return R

def left():
   L = 0
   for i in range(0, n):
        print eval( i )
        L += eval( i )
</code></pre>
