SemialgebraicComponentInstances[ineqs,{x1,x2,…}]
gives at least one sample point in each connected component of the semialgebraic set defined by the inequalities ineqs in the variables x1, x2, ….
SemialgebraicComponentInstances
SemialgebraicComponentInstances[ineqs,{x1,x2,…}]
gives at least one sample point in each connected component of the semialgebraic set defined by the inequalities ineqs in the variables x1, x2, ….
Details
- SemialgebraicComponentInstances assumes that all variables are real.
- Lists or logical combinations of inequalities can be given.
- Any solution to the set of inequalities can be connected by a continuous path to one of the points returned by SemialgebraicComponentInstances.
- SemialgebraicComponentInstances produces a list of rules for variables, of the same type as Solve.
Examples
open all close allBasic Examples (1)
Scope (3)
A univariate polynomial inequality:
SemialgebraicComponentInstances[x ^ 5 - 3x ^ 4 + 5x ^ 3 - 7x ^ 2 + 3x + 1 ≥ 0, x]Multivariate polynomial equations and inequalities:
SemialgebraicComponentInstances[x ^ 2 + y ^ 2 + z ^ 2 == 1 && x ^ 2 + y ^ 2 < z ^ 3, {x, y, z}]Boolean combinations of equations and inequalities:
SemialgebraicComponentInstances[Xor[x ^ 2 + y ^ 3 == 2, x ^ 2 + y ^ 2 < 3], {x, y}]Applications (4)
Find at least one point in each interval defined by a univariate polynomial inequality:
f = (x + 1)(x ^ 2 - 4)(x ^ 3 - 2x + 1);pts = SemialgebraicComponentInstances[f < 0, x]Show[Plot[f, {x, -2.1, 2.05}, Epilog -> {Red, PointSize[Medium], Point[{x, f} /. pts]}]]With a weak inequality you also get the roots:
pts = SemialgebraicComponentInstances[f ≤ 0, x]Show[Plot[f, {x, -2.1, 2.05}, Epilog -> {Red, PointSize[Medium], Point[{x, f} /. pts]}]]Find at least one point in each connected component of a two-dimensional planar set:
ineqs = x ^ 2 + y ^ 3 < 1 && 1 < x ^ 2 + y ^ 2 <= 3;SemialgebraicComponentInstances[ineqs, {x, y}]RegionPlot[ineqs, {x, -2, 2}, {y, -2, 2}, Epilog -> Point[{x, y} /. %]]Find at least one point in each connected component of a surface:
eqn = x ^ 3 + (2y z) ^ 2 - x == 1 / 4;pts = SemialgebraicComponentInstances[eqn && -2 < x < 2 && -2 < y < 2 && -2 < z < 2, {x, y, z}];Show[{ContourPlot3D[Evaluate[eqn], {x, -2, 2}, {y, -2, 2}, {z, -2, 2}], Graphics3D[{Red, PointSize[Large], Point[{x, y, z} /. N[pts]]}]}]Find at least one point in each connected component of a solid:
ineqs = x ^ 2 + y ^ 2 + z ^ 2 - 7x y z < 1 && x ^ 2 + y ^ 2 > 2z ^ 3 + 5 / 4 && x ^ 2 + y ^ 2 + z ^ 2 < 3;pts = SemialgebraicComponentInstances[ineqs, {x, y, z}];The points satisfy the inequalities:
And@@(ineqs /. pts)Use the points to check whether a numerically obtained graphic is missing parts of the set:
Show[{RegionPlot3D[ineqs, {x, -2, 2}, {y, -2, 2}, {z, -2, 2}], Graphics3D[{Red, PointSize[0.015], Point[{x, y, z} /. pts]}]}]Properties & Relations (2)
The returned instances satisfy the input inequalities:
ineqs = x ^ 2 + y ^ 2 + z ^ 2 ≤ 3 && x ^ 2 - y ^ 3 ≤ 17;pts = SemialgebraicComponentInstances[ineqs, {x, y, z}]ineqs /. ptsUse FindInstance to find a single instance satisfying the inequalities:
FindInstance[ineqs, {x, y, z}]ineqs /. %Use CylindricalDecomposition or Reduce to get a full description of the solution set:
CylindricalDecomposition[ineqs, {x, y, z}]Reduce[ineqs, {x, y, z}]An empty list is returned if the inequalities have no solutions:
ineqs = x ^ 2 + y ^ 2 / 4 + z ^ 2 / 9 > 1 && x ^ 2 + (y - 1) ^ 2 + (z - 2) ^ 2 < 1 / 9;SemialgebraicComponentInstances[ineqs, {x, y, z}]An equivalent result can be obtained using Resolve:
Resolve[Exists[{x, y, z}, ineqs], Reals]Tech Notes
Related Guides
History
Text
Wolfram Research (2007), SemialgebraicComponentInstances, Wolfram Language function, https://reference.wolfram.com/language/ref/SemialgebraicComponentInstances.html.
CMS
Wolfram Language. 2007. "SemialgebraicComponentInstances." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SemialgebraicComponentInstances.html.
APA
Wolfram Language. (2007). SemialgebraicComponentInstances. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SemialgebraicComponentInstances.html
BibTeX
@misc{reference.wolfram_2026_semialgebraiccomponentinstances, author="Wolfram Research", title="{SemialgebraicComponentInstances}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/SemialgebraicComponentInstances.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_semialgebraiccomponentinstances, organization={Wolfram Research}, title={SemialgebraicComponentInstances}, year={2007}, url={https://reference.wolfram.com/language/ref/SemialgebraicComponentInstances.html}, note=[Accessed: 13-June-2026]}