Repository: sympy/sympy

Issue:
solveset(2*x + 1/(x - 10)**2, x, S.Reals) raises RuntimeError
```
>>> from sympy.solvers.solveset import solveset
>>> x = Symbol('x')
>>> 2*x + 1/(x - 10)**2
>>> solveset(_, x, S.Reals)         # some part of Traceback

---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call last)
<ipython-input-6-3aabfc8b6183> in <module>()
----> 1 solveset(expr, x, S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset(f, symbol, domain)
    937     if isinstance(f, (Expr, Number)):
    938         if domain is S.Reals:
--> 939             return solveset_real(f, symbol)
    940         elif domain is S.Complexes:
    941             return solveset_complex(f, symbol)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    499                         result += _solve_as_rational(equation, symbol,
    500                                                      solveset_solver=solveset_real,
--> 501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
    503                     result += solveset_real(equation, symbol)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in _solve_as_rational(f, symbol, solveset_solver, as_poly_solver)
    521         return as_poly_solver(g, symbol)
    522     else:
--> 523         valid_solns = solveset_solver(g, symbol)
    524         invalid_solns = solveset_solver(h, symbol)
    525         return valid_solns - invalid_solns

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in <listcomp>(.0)
    471         # wrong solutions we are using this technique only if both f and g are
    472         # finite for a finite input.
--> 473         result = Union(*[solveset_real(m, symbol) for m in f.args])
    474     elif _is_function_class_equation(TrigonometricFunction, f, symbol) or \
    475             _is_function_class_equation(HyperbolicFunction, f, symbol):

/home/gxyd/Public/sympy/sympy/solvers/solveset.py in solveset_real(f, symbol)
    501                                                      as_poly_solver=_solve_as_poly_real)
    502                 else:
--> 503                     result += solveset_real(equation, symbol)
    504         else:
    505             result = ConditionSet(symbol, Eq(f, 0), S.Reals)

```

[Edit]
Problem seems to be with
```
>>> solveset_real(2*x*(x - 10)**2 + 1, x)

# Raises RunTimeError
```

Discussion:
gxyd: @aktech @jksuom Please let me know what you think?
gxyd: ping @aktech @leosartaj 
leosartaj: You have merge conflicts. You should fix theses.
gxyd: ping @smichr @leosartaj 
leosartaj: +1
ping @aktech @hargup 
aktech: +1 except for a minor [nitpick](https://github.com/sympy/sympy/pull/9930#discussion_r41956443).

Patch:
diff --git a/AUTHORS b/AUTHORS
index 762ab4cd26..d7057ad342 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -419,4 +419,3 @@ Dustin Gadal <Dustin.Gadal@gmail.com>
 Yu Kobayashi <yukoba@accelart.jp>
 Shashank Kumar <shashank.kumar.apc13@iitbhu.ac.in>
 Devyani Kota <devyanikota@gmail.com>
-Keval Shah <kevalshah_96@yahoo.co.in>
diff --git a/doc/src/aboutus.rst b/doc/src/aboutus.rst
index ee954a9c14..8a3a87f2b3 100644
--- a/doc/src/aboutus.rst
+++ b/doc/src/aboutus.rst
@@ -423,7 +423,6 @@ want to be mentioned here, so see our repository history for a full list).
 #. Yu Kobayashi: Tuple constructor should not take the argument `**assumptions`
 #. Shashank Kumar: Fixed indenation error in summations.py and added test for issue #9908
 #. Devyani Kota: Fixed issue 9953: linsolve([ ], ...) now returns S.EmptySet
-#. Keval Shah: Union with subset of S.Complexes now evaluated
 
 Up-to-date list in the order of the first contribution is given in the `AUTHORS
 <https://github.com/sympy/sympy/blob/master/AUTHORS>`_ file.
diff --git a/sympy/matrices/matrices.py b/sympy/matrices/matrices.py
index 80a6a9c1a5..06c7b173fe 100644
--- a/sympy/matrices/matrices.py
+++ b/sympy/matrices/matrices.py
@@ -519,8 +519,7 @@ def __rmul__(self, a):
         return self._new(self.rows, self.cols, [a*i for i in self._mat])
 
     def __pow__(self, num):
-        from sympy.matrices import eye, diag, MutableMatrix
-        from sympy import binomial
+        from sympy.matrices import eye
 
         if not self.is_square:
             raise NonSquareMatrixError()
@@ -539,27 +538,18 @@ def __pow__(self, num):
                 s *= s
                 n //= 2
             return self._new(a)
-        elif isinstance(num, (Expr, float)):
-
-            def jordan_cell_power(jc, n):
-                N = jc.shape[0]
-                l = jc[0, 0]
-                for i in range(N):
-                        for j in range(N-i):
-                                bn = binomial(n, i)
-                                if isinstance(bn, binomial):
-                                        bn = bn._eval_expand_func()
-                                jc[j, i+j] = l**(n-i)*bn
-
-            P, jordan_cells = self.jordan_cells()
-            # Make sure jordan_cells matrices are mutable:
-            jordan_cells = [MutableMatrix(j) for j in jordan_cells]
-            for j in jordan_cells:
-                jordan_cell_power(j, num)
-            return self._new(P*diag(*jordan_cells)*P.inv())
+        elif isinstance(num, Rational):
+            try:
+                P, D = self.diagonalize()
+            except MatrixError:
+                raise NotImplementedError(
+                    "Implemented only for diagonalizable matrices")
+            for i in range(D.rows):
+                D[i, i] = D[i, i]**num
+            return self._new(P*D*P.inv())
         else:
-            raise TypeError(
-                "Only SymPy expressions or int objects are supported as exponent for matrices")
+            raise NotImplementedError(
+                "Only integer and rational values are supported")
 
     def __add__(self, other):
         """Return self + other, raising ShapeError if shapes don't match."""
diff --git a/sympy/physics/units.py b/sympy/physics/units.py
index c294f8663c..937aed6136 100644
--- a/sympy/physics/units.py
+++ b/sympy/physics/units.py
@@ -226,7 +226,6 @@ def free_symbols(self):
 tropical_year = tropical_years = Rational('365.24219')*day
 common_year = common_years = Rational('365')*day
 julian_year = julian_years = Rational('365.25')*day
-draconic_year = draconic_years = Rational('346.62')*day
 
 year = years = tropical_year
 
diff --git a/sympy/sets/fancysets.py b/sympy/sets/fancysets.py
index dc8b409185..64c45366a7 100644
--- a/sympy/sets/fancysets.py
+++ b/sympy/sets/fancysets.py
@@ -903,7 +903,7 @@ def _union(self, other):
             elif self.polar and other.polar:
                 return ComplexRegion(Union(self.sets, other.sets), polar=True)
 
-        if other.is_subset(S.Reals):
+        if other is S.Reals:
             return self
 
         return None
diff --git a/sympy/solvers/solveset.py b/sympy/solvers/solveset.py
index 216e58364f..ddc8a54b6b 100644
--- a/sympy/solvers/solveset.py
+++ b/sympy/solvers/solveset.py
@@ -455,6 +455,12 @@ def solveset_real(f, symbol):
     original_eq = f
     f = together(f)
 
+    # In this, unlike in solveset_complex, expression should only
+    # be expanded when fraction(f)[1] does not contain the symbol
+    # for which we are solving
+    if not symbol in fraction(f)[1].free_symbols and f.is_rational_function():
+        f = expand(f)
+
     if f.has(Piecewise):
         f = piecewise_fold(f)
     result = EmptySet()


Test patch:
diff --git a/sympy/matrices/tests/test_matrices.py b/sympy/matrices/tests/test_matrices.py
index e84dafec6f..9abd1303af 100644
--- a/sympy/matrices/tests/test_matrices.py
+++ b/sympy/matrices/tests/test_matrices.py
@@ -175,20 +175,6 @@ def test_power():
     A = Matrix([[0, 4], [-1, 5]])
     assert (A**(S(1)/2))**2 == A
 
-    assert Matrix([[1, 0], [1, 1]])**(S(1)/2) == Matrix([[1, 0], [S.Half, 1]])
-    assert Matrix([[1, 0], [1, 1]])**0.5 == Matrix([[1.0, 0], [0.5, 1.0]])
-    from sympy.abc import a, b, n
-    assert Matrix([[1, a], [0, 1]])**n == Matrix([[1, a*n], [0, 1]])
-    assert Matrix([[b, a], [0, b]])**n == Matrix([[b**n, a*b**(n-1)*n], [0, b**n]])
-    assert Matrix([[a, 1, 0], [0, a, 1], [0, 0, a]])**n == Matrix([
-        [a**n, a**(n-1)*n, a**(n-2)*(n-1)*n/2],
-        [0, a**n, a**(n-1)*n],
-        [0, 0, a**n]])
-    assert Matrix([[a, 1, 0], [0, a, 0], [0, 0, b]])**n == Matrix([
-        [a**n, a**(n-1)*n, 0],
-        [0, a**n, 0],
-        [0, 0, b**n]])
-
 
 def test_creation():
     raises(ValueError, lambda: Matrix(5, 5, range(20)))
@@ -1710,6 +1696,9 @@ def test_errors():
     raises(ValueError,
         lambda: Matrix([[5, 10, 7], [0, -1, 2], [8, 3, 4]]
         ).LUdecomposition_Simple(iszerofunc=lambda x: abs(x) <= 4))
+    raises(NotImplementedError, lambda: Matrix([[1, 0], [1, 1]])**(S(1)/2))
+    raises(NotImplementedError,
+        lambda: Matrix([[1, 2, 3], [4, 5, 6], [7, 8, 9]])**(0.5))
     raises(IndexError, lambda: eye(3)[5, 2])
     raises(IndexError, lambda: eye(3)[2, 5])
     M = Matrix(((1, 2, 3, 4), (5, 6, 7, 8), (9, 10, 11, 12), (13, 14, 15, 16)))
diff --git a/sympy/sets/tests/test_fancysets.py b/sympy/sets/tests/test_fancysets.py
index a8eab7fe7e..a15a09e22b 100644
--- a/sympy/sets/tests/test_fancysets.py
+++ b/sympy/sets/tests/test_fancysets.py
@@ -424,8 +424,3 @@ def test_ComplexRegion_FiniteSet():
         FiniteSet(a + I*x, a + I*y, a + I*z, b + I*x, b + I*y,
                   b + I*z, c + I*x, c + I*y, c + I*z)
     assert ComplexRegion(FiniteSet(2)*FiniteSet(3)) == FiniteSet(2 + 3*I)
-
-
-def test_union_RealSubSet():
-    assert (S.Complexes).union(Interval(1, 2)) == S.Complexes
-    assert (S.Complexes).union(S.Integers) == S.Complexes
diff --git a/sympy/solvers/tests/test_solveset.py b/sympy/solvers/tests/test_solveset.py
index fdfb75e5a3..2ccd876be9 100644
--- a/sympy/solvers/tests/test_solveset.py
+++ b/sympy/solvers/tests/test_solveset.py
@@ -1017,3 +1017,9 @@ def test_issue_9849():
 
 def test_issue_9953():
     assert linsolve([ ], x) == S.EmptySet
+
+
+def test_issue_9913():
+    assert solveset(2*x + 1/(x - 10)**2, x, S.Reals) == \
+        FiniteSet(-(3*sqrt(24081)/4 + S(4027)/4)**(S(1)/3)/3 - 100/
+                (3*(3*sqrt(24081)/4 + S(4027)/4)**(S(1)/3)) + S(20)/3)