Repository: sympy/sympy

Issue:
powsimp drops factor
```python
>>> a,b=exp(I*pi/3),root(-1,3)
>>> powsimp(a)
exp(I*pi/3)
>>> powsimp(b)
(-1)**(1/3)
>>> a*b
(-1)**(1/3)*exp(I*pi/3)
>>> powsimp(_)
(-1)**(1/3)
>>> _.n(2)
0.5 + 0.87*I
>>> (a*b).n(2)
-0.5 + 0.87*I
```

The problem is with bkey which, for exp(I*pi/3), returns 

```python
>>> bkey(exp(I*pi/3))
((-1, 3), 1)
```

Discussion:

Patch:
diff --git a/sympy/simplify/simplify.py b/sympy/simplify/simplify.py
index d08a81fea1..b6e9604548 100755
--- a/sympy/simplify/simplify.py
+++ b/sympy/simplify/simplify.py
@@ -2703,9 +2703,13 @@ def update(b):
         bases = []
         for b, e in c_powers:
             b, e = bkey(b, e)
-            common_b[b] = e
+            if b in common_b.keys():
+                common_b[b] = common_b[b] + e
+            else:
+                common_b[b] = e
             if b[1] != 1 and b[0].is_Mul:
                 bases.append(b)
+        c_powers = [(b, e) for b, e in common_b.items() if e]
         bases.sort(key=default_sort_key)  # this makes tie-breaking canonical
         bases.sort(key=measure, reverse=True)  # handle longest first
         for base in bases:


Test patch:
diff --git a/sympy/simplify/tests/test_simplify.py b/sympy/simplify/tests/test_simplify.py
index 2b20e608a7..a189d5d29d 100644
--- a/sympy/simplify/tests/test_simplify.py
+++ b/sympy/simplify/tests/test_simplify.py
@@ -682,6 +682,8 @@ def test_powsimp():
 
     assert all(powsimp(e) == e for e in (sqrt(x**a), sqrt(x**2)))
 
+    # issue 8836
+    assert str( powsimp(exp(I*pi/3)*root(-1,3)) ) == '(-1)**(2/3)'
 
 def test_issue_6367():
     z = -5*sqrt(2)/(2*sqrt(2*sqrt(29) + 29)) + sqrt(-sqrt(29)/29 + S(1)/2)