sympy/sympy — pull request #8461 by ted-dokos (2014-11-17 01:40:25+00:00)
Title: Integral objects now convert Abs instances to Piecewise.

(Forgive the horrid commit history, I massacred the tree topology on my fork and I need to fix it after the meijerint PR is resolved.)

Fixes #8430.
```
>>> integrate(Abs(x),(x,0,1))
1/2
>>> integrate(Abs(x),(x,-1,1))
1
>>> integrate(Abs(Abs(x)),(x,0,1))
1/2
>>> integrate(exp(Abs(x-1.0/2)),(x,0,1))
-0.351278729299872 + 0.606530659712633*E
>>> integrate(Abs(x-1.0/2)+x,(x,0,1))
0.750000000000000
```

The parent class of Integral (AddWithLimits) will now convert
instances of the Abs class to Piecewise objects. To do this I added a
function rewrite_abs to the file containing the Abs class
(complexes.py). Additionally, I made the private function
_eval_rewrite_as_Piecewise assume arguments are real unless they
explicitly say they aren't, which is more lax than the previous
version.