CountRoots
is an appropriate function. It may work also with more general functions than polynomials. Two or more-variable polynomials may have infinitely many roots in a compact region, e.g. this one: $\;p(x,y,z)=x^2+y^2+z^2-1 \quad$ has infinitely many roots (continuum) on the unit sphere. In such cases CountRoots
cannot give an adequate answer since it may count only a finite number of roots (of univariate polynomials, but we can always restrict many-variable functions to one variable) in an adequate domain (it may be a rectangle in the complex plane).
For the problem at hand let's define:
cr[mu2_, mu4_] := CountRoots[-3 + 3 mu2 - 6 q mu2 - 8 q^3 mu4 + 4 q^4 mu4 +
q^2 (3 mu2 + 4 mu4), q]
To get an idea where you should look for interesting regions Manipulate
can serve reasonably :
Manipulate[ cr[mu2, mu4], {mu2, -100, 100}, {mu4, -100, 100}]
To visualize spatial dependence of the cr
function we can make use of ListPlot3D
having an array of its values :
ar = Array[{#1, #2, cr[#1, #2]} &, {200, 200}, {{-30, 30}, {-30, 30}}];
ListPlot3D[ Flatten[ar, 1], Mesh -> None,
ColorFunction -> Function[{x, y, z}, Darker @ Hue[1/4 z]]]

Where we can see the jumps on the plot we might expect 1
and 3
roots of the polynomial.
For more complete discussion of the issue this question needs better examples and more precise formulation. One can proceed further with Reduce
and Solve
etc. Solving equation with Solve
it might be more handy when there are finite number of solutions (because of the output in terms of replacement rules). On the other hand there might be many subtleties and one can proceed on the case by case basis (see e.g. How do I work with Root objects? where one can simply count roots e.g. with Length
). For a bit more interesting example of a polynomial equation see this question : 3D Plot: Number of Roots in x of a polynomial in x, a, b and c.
CountRoots[]
? $\endgroup$cr[mu2_, mu4_] := CountRoots[-3 + 3 mu2 - 6 q mu2 - 8 q^3 mu4 + 4 q^4 mu4 + q^2 (3 mu2 + 4 mu4), {q, 0, 1}]
, i.e. it counts the number of roots forq
in the range[0, 1]
. $\endgroup$