sympy: how to evaluate integral of absolute value
<p>When I try to simplify the following integral in <code>sympy</code>, it will not evaluate, i.e. the output is $\int_{-1}^1 |z| dz$ while the output I expect is 1.</p>

<pre><code>z = symbols('z', real=True)
a = integrate(abs(z), (z, -1, 1))
simplify(a)
</code></pre>

<p>Similar integral without the absolute value on <code>z</code> will evaluate.</p>

<p>How can I get <code>sympy</code> to evaluate this integral?</p>

<p>I believe you should use Sympy's built in <a href="http://docs.sympy.org/0.7.0/modules/functions.html" rel="nofollow">Abs()</a> function.</p>

<p>Enjoy!</p>

python sympy integral absolute-value