 NumberOfSolutions - Maple Help

RootFinding[Parametric]

 NumberOfSolutions
 compute the number of real solutions for each open cell Calling Sequence NumberOfSolutions(m, l) Parameters

 m - solution record, as returned by CellDecomposition l - (optional) list of ranges for the parameters, of the form parameter=u..v, where u is a rational number or $-\mathrm{\infty }$ and v is a rational number or $\mathrm{\infty }$ Description

 • The $\mathrm{NumberOfSolutions}\left(m\right)$ calling sequence computes the number of real solutions of the system

${\left[f=0,g>0\right]}_{f\in m:-\mathrm{Equations},g\in m:-\mathrm{Inequalities}}$

 and returns it as a list of lists of the form $\left[i,{n}_{i}\right]$, where $i$ is the index of the open cell and ${n}_{i}$ is the number of real solutions of the non-parametric system resulting from substituting parameter values from this cell.
 • If l is given, only those open cells whose sample points lie inside the box specified by l are considered.
 • This command is part of the RootFinding[Parametric] package, so it can be used in the form NumberOfSolutions(..) only after executing the command with(RootFinding[Parametric]). However, it can always be accessed through the long form of the command by using RootFinding[Parametric][NumberOfSolutions](..). Examples

 > $\mathrm{with}\left({\mathrm{RootFinding}}_{\mathrm{Parametric}}\right):$
 > $\mathrm{sys}≔\left[{x}^{2}+{y}^{2}=a,x-y=b,0
 ${\mathrm{sys}}{≔}\left[{{x}}^{{2}}{+}{{y}}^{{2}}{=}{a}{,}{x}{-}{y}{=}{b}{,}{0}{<}{a}\right]$ (1)
 > $m≔\mathrm{CellDecomposition}\left(\mathrm{sys},\left[x,y\right]\right)$
 ${m}{≔}\left[\begin{array}{lll}{\mathrm{Equations}}& {=}& {}\left[{{x}}^{{2}}{+}{{y}}^{{2}}{-}{a}{,}{x}{-}{y}{-}{b}\right]\\ {\mathrm{Inequalities}}& {=}& {}\left[{a}\right]\\ {\mathrm{Filter}}& {=}& {}{0}{\ne }{1}\\ {\mathrm{Variables}}& {=}& {}\left[{x}{,}{y}\right]\\ {\mathrm{Parameters}}& {=}& {}\left[{a}{,}{b}\right]\\ {\mathrm{DiscriminantVariety}}& {=}& {}\left[\left[{a}\right]{,}\left[{-}{{b}}^{{2}}{+}{2}{}{a}\right]\right]\\ {\mathrm{ProjectionPolynomials}}& {=}& {}\left[\left[{b}\right]{,}\left[{a}{,}{-}{{b}}^{{2}}{+}{2}{}{a}\right]\right]\\ {\mathrm{SamplePoints}}& {=}& {}\left[\left[{a}{=}\frac{{73786976294838206307}}{{295147905179352825856}}{,}{b}{=}{-1}\right]{,}\left[{a}{=}{1}{,}{b}{=}{-1}\right]{,}\left[{a}{=}\frac{{73786976294838206307}}{{295147905179352825856}}{,}{b}{=}{1}\right]{,}\left[{a}{=}{1}{,}{b}{=}{1}\right]\right]\end{array}\right$ (2)
 > $\mathrm{CellPlot}\left(m,'\mathrm{samplepoints}'\right)$ > $\mathrm{NumberOfSolutions}\left(m\right)$
 $\left[\left[{1}{,}{0}\right]{,}\left[{2}{,}{2}\right]{,}\left[{3}{,}{0}\right]{,}\left[{4}{,}{2}\right]\right]$ (3)

Thus, the number of solution pairs $\left[x,y\right]$ of the system $\mathrm{sys}$ is $2$ if the parameters $a$ and $b$ are chosen from the blue or green cells, to the right of the parabola, and $0$ otherwise.

You can restrict the cells for which you want the number of solutions.

 > $\mathrm{NumberOfSolutions}\left(m,\left[b=0..1\right]\right)$
 $\left[\left[{3}{,}{0}\right]{,}\left[{4}{,}{2}\right]\right]$ (4)
 > $\mathrm{NumberOfSolutions}\left(m,\left[a=0..\frac{1}{2},b=0..1\right]\right)$
 $\left[\left[{3}{,}{0}\right]\right]$ (5)
 > $\mathrm{NumberOfSolutions}\left(m,\left[a=0..\frac{1}{2},b=2..3\right]\right)$
 $\left[\right]$ (6)

In fact, the system $\mathrm{sys}$ has exactly one solution, of multiplicity $2$, on the parabola itself. This cannot be inferred from the previous data. However, you can add the equation for the discriminant variety to the system and make $b$ an indeterminate as well.

 > $m:-\mathrm{DiscriminantVariety}$
 $\left[\left[{a}\right]{,}\left[{-}{{b}}^{{2}}{+}{2}{}{a}\right]\right]$ (7)
 > $\mathrm{eqs}≔\left[\mathrm{op}\left(m:-\mathrm{Equations}\right),\mathrm{op}\left(\left[2,1\right],\right)\right]$
 ${\mathrm{eqs}}{≔}\left[{{x}}^{{2}}{+}{{y}}^{{2}}{-}{a}{,}{x}{-}{y}{-}{b}{,}{-}{{b}}^{{2}}{+}{2}{}{a}\right]$ (8)
 > $\mathrm{CellDecomposition}\left(\mathrm{eqs},m:-\mathrm{Inequalities},\left[x,y,b\right]\right)$

In order to proceed, you must remove multiplicities by computing the radical.

 > $\mathrm{with}\left(\mathrm{PolynomialIdeals},\mathrm{PolynomialIdeal},\mathrm{Generators},\mathrm{Simplify},\mathrm{Radical}\right):$
 > $J≔\mathrm{PolynomialIdeal}\left(\mathrm{eqs},\mathrm{variables}=\left[x,y,b\right]\right):$
 > $R≔\mathrm{Generators}\left(\mathrm{Simplify}\left(\mathrm{Radical}\left(J\right)\right)\right)$
 ${R}{≔}\left\{{2}{}{x}{-}{b}{,}{2}{}{y}{+}{b}{,}{{b}}^{{2}}{-}{2}{}{a}\right\}$ (9)
 > $\mathrm{m2}≔\mathrm{CellDecomposition}\left(\left[\mathrm{op}\left(R\right)\right],m:-\mathrm{Inequalities},\left[x,y,b\right]\right)$
 ${\mathrm{m2}}{≔}\left[\begin{array}{lll}{\mathrm{Equations}}& {=}& {}\left[{2}{}{x}{-}{b}{,}{2}{}{y}{+}{b}{,}{{b}}^{{2}}{-}{2}{}{a}\right]\\ {\mathrm{Inequalities}}& {=}& {}\left[{a}\right]\\ {\mathrm{Filter}}& {=}& {}{0}{\ne }{1}\\ {\mathrm{Variables}}& {=}& {}\left[{x}{,}{y}{,}{b}\right]\\ {\mathrm{Parameters}}& {=}& {}\left[{a}\right]\\ {\mathrm{DiscriminantVariety}}& {=}& {}\left[\left[{a}\right]\right]\\ {\mathrm{ProjectionPolynomials}}& {=}& {}\left[\left[{a}\right]\right]\\ {\mathrm{SamplePoints}}& {=}& {}\left[\left[{a}{=}{1}\right]\right]\end{array}\right$ (10)
 > $\mathrm{NumberOfSolutions}\left(\mathrm{m2}\right)$
 $\left[\left[{1}{,}{2}\right]\right]$ (11)

Notice that there is only one cell, and that the equations $\mathrm{eqs}$ have two solutions, independent of the value of the parameter $a$. The following command computes these solutions for $a=1$:

 > $\mathrm{SampleSolutions}\left(\mathrm{m2},\left[a=1\right]\right)$
 $\left[\left[{x}{=}{-0.7071067812}{,}{y}{=}{0.7071067812}{,}{b}{=}{-1.414213562}\right]{,}\left[{x}{=}{0.7071067812}{,}{y}{=}{-0.7071067812}{,}{b}{=}{1.414213562}\right]\right]$ (12)

Since the values of $b$ are different for each of those two solutions, you can conclude that the original system $\mathrm{sys}$ has exactly one solution $\left[x,y\right]$ for parameter values $a$ and $b$ on the parabola specified by the equation for the discriminant variety.