diff --git a/diofant/polys/rootisolation.py b/diofant/polys/rootisolation.py
index d6d30b2aa..a617a12a7 100644
--- a/diofant/polys/rootisolation.py
+++ b/diofant/polys/rootisolation.py
@@ -418,9 +418,12 @@ def dup_isolate_real_roots_sqf(f, K, eps=None, inf=None, sup=None, fast=False, b
         R, K = K, K.field
         f = dmp_convert(f, 0, R, K)
 
+    if not (K.is_ComplexAlgebraicField or K.is_RationalField):
+        raise DomainError("Can't isolate real roots in domain %s" % K)
+
     f = dmp_clear_denoms(f, 0, K)[1]
 
-    if K.is_AlgebraicField and not K.is_RealAlgebraicField:
+    if K.is_ComplexAlgebraicField and not K.is_RealAlgebraicField:
         A, K = K, K.domain
         polys = [dmp_eval_in(_, K.zero, 1, 1, K) for _ in dup_real_imag(f, A)]
         if not polys[1]:
@@ -430,9 +433,6 @@ def dup_isolate_real_roots_sqf(f, K, eps=None, inf=None, sup=None, fast=False, b
             roots = [_[0] for _ in roots if _[1].keys() == {0, 1}]
             return [RealInterval((a, b), f, K) for (a, b) in roots] if blackbox else roots
 
-    if not (K.is_RationalField or K.is_RealAlgebraicField):
-        raise DomainError("isolation of real roots not supported over %s" % K)
-
     if dmp_degree_in(f, 0, 0) <= 0:
         return []
 
@@ -614,6 +614,9 @@ def dup_count_real_roots(f, K, inf=None, sup=None):
         R, K = K, K.field
         f = dmp_convert(f, 0, R, K)
 
+    if not (K.is_ComplexAlgebraicField or K.is_RationalField):
+        raise DomainError("Can't count real roots in domain %s" % K)
+
     if K.is_AlgebraicField:
         return sum(k for *_, k in dup_isolate_real_roots(f, K, inf, sup))
 
@@ -1158,6 +1161,9 @@ def dup_count_complex_roots(f, K, inf=None, sup=None, exclude=None):
         R, K = K, K.field
         f = dmp_convert(f, 0, R, K)
 
+    if not (K.is_ComplexAlgebraicField or K.is_RationalField):
+        raise DomainError("Can't count complex roots in domain %s" % K)
+
     if not all(isinstance(_, tuple) for _ in (inf, sup)):
         B = _roots_bound(f, K)
 
@@ -1177,7 +1183,7 @@ def dup_count_complex_roots(f, K, inf=None, sup=None, exclude=None):
 
     f1, f2 = dup_real_imag(f, K)
 
-    if K.is_ComplexAlgebraicField and not K.is_RealAlgebraicField:
+    if not (K.is_RationalField or K.is_RealAlgebraicField):
         K = K.domain
 
     return _count_roots(f1, f2, K, (u, v), (s, t), exclude)
@@ -1429,6 +1435,9 @@ def dup_isolate_complex_roots_sqf(f, K, eps=None, inf=None, sup=None, blackbox=F
         R, K = K, K.field
         f = dmp_convert(f, 0, R, K)
 
+    if not (K.is_ComplexAlgebraicField or K.is_RationalField):
+        raise DomainError("Can't isolate complex roots in domain %s" % K)
+
     if not all(isinstance(_, tuple) for _ in (inf, sup)):
         B = _roots_bound(f, K)
 
@@ -1460,7 +1469,7 @@ def dup_isolate_complex_roots_sqf(f, K, eps=None, inf=None, sup=None, blackbox=F
                     _roots.append(croot)
                 _roots.append(root)
             roots = _roots
-        elif K.is_ComplexAlgebraicField:
+        else:
             # Take conjugated polynomial to get solutions in the
             # bottom half-plane.
             f = [_.conjugate() for _ in f]
@@ -1469,14 +1478,12 @@ def dup_isolate_complex_roots_sqf(f, K, eps=None, inf=None, sup=None, blackbox=F
                                                              inf=(u, 0), sup=(s, -v),
                                                              blackbox=True)]
             roots = sorted(roots, key=lambda r: (r.ax, r.ay))
-        else:
-            raise NotImplementedError
 
         return roots if blackbox else [r.as_tuple() for r in roots]
 
     f1, f2 = dup_real_imag(f, K)
 
-    if K.is_ComplexAlgebraicField and not K.is_RealAlgebraicField:
+    if not (K.is_RationalField or K.is_RealAlgebraicField):
         K = K.domain
 
     f1L1 = dmp_eval_in(f1, v, 1, 1, K)

dup_count_real_roots() is broken for composite domains
This is wrong:
```
In [16]: R1 = ZZ.poly_ring(y).poly_ring(x)

In [17]: R1.dup_count_real_roots(R1.from_expr(x**7 + y*x + 1))
Out[17]: 1
```
That's easy to demonstrate even for real `y`:
```
In [18]: R2 = ZZ.poly_ring(x)

In [19]: R2.dup_count_real_roots(R2.from_expr(x**7 + 2*x + 1))
Out[19]: 1

In [20]: R2.dup_count_real_roots(R2.from_expr(x**7 - 2*x + 1))
Out[20]: 3
```

Same issue is valid for SymPy:
```
In [1]: Poly(x**7 + x*y + 1, x)
Out[1]: Poly(x**7 + y*x + 1, x, domain='ZZ[y]')

In [2]: _.count_roots()
Out[2]: 1

In [3]: Poly(x**7 + x*2 + 1, x).count_roots()
Out[3]: 1

In [4]: Poly(x**7 - x*2 + 1, x).count_roots()
Out[4]: 3
```

Simple solution: add a quick exit for Composite domains.  Probably, raising `DomainError` would be fine.
diff --git a/diofant/polys/tests/test_rootisolation.py b/diofant/polys/tests/test_rootisolation.py
index 1ddbb518c..787c0e24c 100644
--- a/diofant/polys/tests/test_rootisolation.py
+++ b/diofant/polys/tests/test_rootisolation.py
@@ -929,6 +929,9 @@ def test_dup_isolate_complex_roots_sqf():
                                                   ((0, QQ(-283, 100)), (QQ(283, 100), 0)),
                                                   ((0, 0), (QQ(283, 100), QQ(283, 100)))]
 
+    R, x = ring("x", EX)
+    pytest.raises(DomainError, lambda: R.dup_isolate_complex_roots_sqf(x))
+
 
 def test_dup_isolate_all_roots_sqf():
     R, x = ring("x", ZZ)
@@ -991,3 +994,9 @@ def test_ComplexInterval():
         r1, r2 = r1.refine(), r2.refine()
 
     assert r1.is_disjoint(r2, check_re_refinement=True) is True
+
+
+def test_diofantissue_745():
+    D, y = ring('y', ZZ)
+    R, x = ring('x', D)
+    pytest.raises(DomainError, lambda: R.dup_count_real_roots(x**7 + y*x + 1))

pip install -e .[develop,docs]
parse_log_pytest
pytest
pytest gmpy2
apt-get update apt-get install -y gcc libmpc-dev libmpfr-dev libgmp-dev
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
astroid==2.0.4
attrs @ file:///croot/attrs_1668696182826/work
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
charset-normalizer==3.4.1
codecov==2.1.13
coverage==7.2.7
-e git+https://github.com/diofant/diofant.git@e97a25885b2c791233523425bc90780dfef76f3f#egg=Diofant
docutils==0.17.1
exceptiongroup==1.2.2
execnet==2.0.2
flake8==5.0.4
flake8-comprehensions==3.13.0
flake8-docstrings==1.7.0
flake8-isort==6.0.0
flit_core @ file:///opt/conda/conda-bld/flit-core_1644941570762/work/source/flit_core
gmpy2==2.2.1
hypothesis==6.79.4
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig @ file:///home/linux1/recipes/ci/iniconfig_1610983019677/work
isort==5.11.5
Jinja2==3.1.6
lazy-object-proxy==1.9.0
MarkupSafe==2.1.5
mccabe==0.7.0
mpmath==1.3.0
multipledispatch==1.0.0
packaging @ file:///croot/packaging_1671697413597/work
pep8-naming==0.14.0
pluggy @ file:///tmp/build/80754af9/pluggy_1648042572264/work
py @ file:///opt/conda/conda-bld/py_1644396412707/work
pycodestyle==2.9.1
pydocstyle==6.3.0
pyflakes==2.5.0
Pygments==2.17.2
pylint==2.1.1
pytest==7.1.2
pytest-cov==4.1.0
pytest-runner==6.0.1
pytest-timeout==2.3.1
pytest-xdist==3.5.0
pytz==2025.2
requests==2.31.0
six==1.17.0
snowballstemmer==2.2.0
sortedcontainers==2.4.0
Sphinx==4.3.2
sphinx-rtd-theme==1.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
strategies==0.2.3
tomli @ file:///opt/conda/conda-bld/tomli_1657175507142/work
toolz==0.12.1
typing_extensions @ file:///croot/typing_extensions_1669924550328/work
urllib3==2.0.7
wrapt==1.16.0
zipp @ file:///croot/zipp_1672387121353/work

name: diofant
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - attrs=22.1.0=py37h06a4308_0
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - flit-core=3.6.0=pyhd3eb1b0_0
  - importlib_metadata=4.11.3=hd3eb1b0_0
  - iniconfig=1.1.1=pyhd3eb1b0_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - packaging=22.0=py37h06a4308_0
  - pip=22.3.1=py37h06a4308_0
  - pluggy=1.0.0=py37h06a4308_1
  - py=1.11.0=pyhd3eb1b0_0
  - pytest=7.1.2=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - tomli=2.0.1=py37h06a4308_0
  - typing_extensions=4.4.0=py37h06a4308_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zipp=3.11.0=py37h06a4308_0
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - astroid==2.0.4
      - babel==2.14.0
      - charset-normalizer==3.4.1
      - codecov==2.1.13
      - coverage==7.2.7
      - docutils==0.17.1
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - flake8==5.0.4
      - flake8-comprehensions==3.13.0
      - flake8-docstrings==1.7.0
      - flake8-isort==6.0.0
      - gmpy2==2.2.1
      - hypothesis==6.79.4
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - isort==5.11.5
      - jinja2==3.1.6
      - lazy-object-proxy==1.9.0
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - mpmath==1.3.0
      - multipledispatch==1.0.0
      - pep8-naming==0.14.0
      - pycodestyle==2.9.1
      - pydocstyle==6.3.0
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pylint==2.1.1
      - pytest-cov==4.1.0
      - pytest-runner==6.0.1
      - pytest-timeout==2.3.1
      - pytest-xdist==3.5.0
      - pytz==2025.2
      - requests==2.31.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sortedcontainers==2.4.0
      - sphinx==4.3.2
      - sphinx-rtd-theme==1.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - strategies==0.2.3
      - toolz==0.12.1
      - urllib3==2.0.7
      - wrapt==1.16.0
prefix: /opt/conda/envs/diofant

diofant/polys/tests/test_rootisolation.py::test_dup_isolate_complex_roots_sqf diofant/polys/tests/test_rootisolation.py::test_diofantissue_745
diofant/polys/tests/test_rootisolation.py::test_dup_sturm diofant/polys/tests/test_rootisolation.py::test_dup_root_upper_bound diofant/polys/tests/test_rootisolation.py::test_dup_step_refine_real_root diofant/polys/tests/test_rootisolation.py::test_dup_inner_refine_real_root diofant/polys/tests/test_rootisolation.py::test_dup_refine_real_root diofant/polys/tests/test_rootisolation.py::test_dup_isolate_real_roots_sqf diofant/polys/tests/test_rootisolation.py::test_dup_isolate_real_roots diofant/polys/tests/test_rootisolation.py::test_dup_isolate_imaginary_roots diofant/polys/tests/test_rootisolation.py::test_dup_isolate_real_roots_list diofant/polys/tests/test_rootisolation.py::test_dup_isolate_real_roots_list_QQ diofant/polys/tests/test_rootisolation.py::test_dup_count_real_roots diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_1 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_2 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_3 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_4 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_5 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_6 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_7 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_8 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_9 diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_implicit diofant/polys/tests/test_rootisolation.py::test_dup_count_complex_roots_exclude diofant/polys/tests/test_rootisolation.py::test_dup_isolate_all_roots_sqf diofant/polys/tests/test_rootisolation.py::test_dup_isolate_all_roots diofant/polys/tests/test_rootisolation.py::test_RealInterval diofant/polys/tests/test_rootisolation.py::test_ComplexInterval
diofant/polys/rootisolation.py
diofant/polys/rootisolation.py