BivariatePolynomial - Maple Help

RootFinding

 BivariatePolynomial
 find the solutions of two or more bivariate polynomials

 Calling Sequence BivariatePolynomial(fg, varlist, options)

Parameters

 fg - set or list of two or more polynomials in two variables varlist - list or set of two names; a list defines the order in the solutions pairs returned, a set requests output in the form {x=..,y=..} options - (optional) equations of the form option=value where option is one of exact, verify, or verifyTol.

Description

 • The BivariatePolynomial(fg, varlist, options) command solves the bivariate polynomials fg, in the case when there is only a finite number of solutions.  If there are an infinite number of solutions, this routine may fail.
 • The routine performs a random orthogonal change of coordinates, takes a random linear combination of the two or more input polynomials to produce exactly two polynomials $f\left(x,y\right)$ and $g\left(x,y\right)$.  It then constructs the Bezout matrix $B\left(y\right)$ of $f\left(x,y\right)$ and $g\left(x,y\right)$ with respect to $x$, and then the Companion matrix pencil of the matrix polynomial $B\left(y\right)$.  It then solves the generalized eigenproblem for eigenvalues and eigenvectors of the pencil; the eigenvalues give the values of $y$, and the corresponding values of $x$ are deduced from the eigenvectors.
 If the option verify=true is given (the default), or if there are more than two input polynomials, each putative root is tested on the original polynomials to see if the residual is acceptably small. A residual is judged to be small enough if it is smaller than ilog[10](n+1)*verifyTol times the maxnorm of the polynomial, where n is the number of roots.  By default, verifyTol=Float(1,1-Digits). This default tolerance may be overridden by setting the option verifyTol=... in the call.
 • The routine assumes that $f\left(x,y\right)=g\left(x,y\right)=0$ has only isolated simple roots. Multiple roots are, numerically, perturbed into clusters of simple roots by rounding errors in the process. In practice, if the multiplicity of the root is not too high (say not more than three) then the results may be acceptable. If, however, there are an infinite number of roots (i.e. the dimensionality of the variety is higher than zero), then this routine will fail.  Through rounding errors, a higher-dimensional system MAY be perturbed to a zero-dimensional system, and in this case pseudozeros are calculated and some information may be deduced about the true solutions by repeated solving; the differing random combinations will produce different pseudozeros that can be put together to get a partial picture of the higher- dimensional zero set.
 • Exact solutions are sometimes possible, and may be attempted by specifying the option exact=true. In this case, the random combinations are done over the integers to avoid introducing rounding errors. In the case where the input coefficients are exact and the polynomials are not of too high a degree, this may give exact (though not necessarily useful) answers.
 • Solutions obtained by BivariatePolynomial may be refined by use of fsolve.  See the examples.

Options

 • The options argument can contain the following equation.
 exact = true or false
 If exact=true, the command performs the computation exactly (depending on Eigenvectors succeeding with an exact computation).
 verify = true or false
 If verify=true (the default), the command tests that the values of each input polynomial at each computed root is smaller than 10 ulps, where an ulp is a Unit in the Last Place, measured relative to the user's setting of Digits and a vector norm of the polynomial coefficients. If verify=false, this residual test is not performed and infinite and spurious roots are returned along with any genuine roots.
 verifyTol = positive floating-point number for residual tolerance
 If verifyTol is overridden, the residual test is passed if the residual is less than or equal to ilog[10](n+1)*verifyTol times a vector norm of the polynomial coefficients.
 Note: The resultType = data_type option has been superseded by the exact option.

Examples

 > $\mathrm{with}\left(\mathrm{RootFinding}\right)$
 $\left[{\mathrm{Analytic}}{,}{\mathrm{AnalyticZerosFound}}{,}{\mathrm{BivariatePolynomial}}{,}{\mathrm{EnclosingBox}}{,}{\mathrm{HasRealRoots}}{,}{\mathrm{Homotopy}}{,}{\mathrm{Isolate}}{,}{\mathrm{NextZero}}{,}{\mathrm{Parametric}}{,}{\mathrm{WitnessPoints}}\right]$ (1)

 > $\mathrm{BivariatePolynomial}\left(\left[25uv-12,{u}^{2}+{v}^{2}-1\right],\left[u,v\right],\mathrm{exact}=\mathrm{true}\right)$
 $\left[{-}\frac{{3}}{{5}}{,}{-}\frac{{4}}{{5}}\right]{,}\left[\frac{{3}}{{5}}{,}\frac{{4}}{{5}}\right]{,}\left[\frac{{4}}{{5}}{,}\frac{{3}}{{5}}\right]{,}\left[{-}\frac{{4}}{{5}}{,}{-}\frac{{3}}{{5}}\right]$ (2)
 > $f≔\mathrm{randpoly}\left(\left[x,y\right],\mathrm{degree}=2,\mathrm{dense}\right)$
 ${f}{≔}{-}{7}{}{{x}}^{{2}}{+}{22}{}{x}{}{y}{-}{94}{}{{y}}^{{2}}{-}{55}{}{x}{+}{87}{}{y}{-}{56}$ (3)
 > $g≔\mathrm{randpoly}\left(\left[x,y\right],\mathrm{degree}=2,\mathrm{dense}\right)$
 ${g}{≔}{-}{62}{}{x}{}{y}{-}{73}{}{{y}}^{{2}}{+}{97}{}{x}{-}{4}{}{y}{-}{83}$ (4)

Set output, and a large residual tolerance

 > $\left\{\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.000010\right)\right\}$
 $\left\{\left\{{x}{=}{-3.95035168944360}{-}{5.66623769360476}{}{I}{,}{y}{=}{1.58314710503978}{-}{0.669082838293886}{}{I}\right\}{,}\left\{{x}{=}{-3.95035168944359}{+}{5.66623769360474}{}{I}{,}{y}{=}{1.58314710503978}{+}{0.669082838293885}{}{I}\right\}{,}\left\{{x}{=}{0.217656104641046}{+}{0.580098578671158}{}{I}{,}{y}{=}{0.283760691054644}{+}{0.781752717215509}{}{I}\right\}{,}\left\{{x}{=}{0.217656104641057}{-}{0.580098578671163}{}{I}{,}{y}{=}{0.283760691054644}{-}{0.781752717215509}{}{I}\right\}\right\}$ (5)

A higher-degree example

 > $f≔\mathrm{randpoly}\left(\left[x,y\right],\mathrm{degree}=3,\mathrm{dense}\right)$
 ${f}{≔}{-}{10}{}{{x}}^{{3}}{+}{62}{}{{x}}^{{2}}{}{y}{+}{80}{}{x}{}{{y}}^{{2}}{-}{17}{}{{y}}^{{3}}{-}{82}{}{{x}}^{{2}}{-}{44}{}{x}{}{y}{-}{75}{}{{y}}^{{2}}{+}{71}{}{x}{-}{10}{}{y}{-}{7}$ (6)
 > $g≔\mathrm{randpoly}\left(\left[x,y\right],\mathrm{degree}=3,\mathrm{dense}\right)$
 ${g}{≔}{-}{40}{}{{x}}^{{3}}{+}{42}{}{{x}}^{{2}}{}{y}{+}{23}{}{x}{}{{y}}^{{2}}{+}{6}{}{{y}}^{{3}}{-}{50}{}{{x}}^{{2}}{+}{75}{}{x}{}{y}{+}{74}{}{{y}}^{{2}}{-}{92}{}{x}{+}{72}{}{y}{+}{37}$ (7)
 > $\mathrm{sols}≔\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left[x,y\right],\mathrm{verify}=\mathrm{false}\right):$
 > $\mathrm{finiteSols}≔\mathrm{select}\left(\mathrm{type},\mathrm{map}\left(\mathrm{convert},\left\{\mathrm{sols}\right\},\mathrm{set}\right),\mathrm{set}\left(\mathrm{complex}\left(\mathrm{numeric}\right)\right)\right)$
 ${\mathrm{finiteSols}}{≔}\left\{\left\{{-8.72546491823764}{-}{1.14731372029251}{×}{{10}}^{{-17}}{}{I}{,}{-0.804422190778385}{-}{1.35322193031645}{×}{{10}}^{{-18}}{}{I}\right\}{,}\left\{{-1.61657845360197}{+}{1.76439307007178}{×}{{10}}^{{-13}}{}{I}{,}{0.422070508744697}{+}{1.18977727083522}{×}{{10}}^{{-13}}{}{I}\right\}{,}\left\{{-0.786588411682273}{-}{1.14300482684491}{}{I}{,}{0.604101549296866}{-}{0.622769842152089}{}{I}\right\}{,}\left\{{-0.786588411681985}{+}{1.14300482684388}{}{I}{,}{0.604101549296843}{+}{0.622769842152231}{}{I}\right\}{,}\left\{{-0.453554755499165}{-}{1.18516902864061}{}{I}{,}{-0.278993622119871}{+}{1.39562033543789}{}{I}\right\}{,}\left\{{-0.453554755498936}{+}{1.18516902864133}{}{I}{,}{-0.278993622120490}{-}{1.39562033543821}{}{I}\right\}{,}\left\{{-0.373755472345006}{+}{7.91706632657983}{×}{{10}}^{{-15}}{}{I}{,}{0.156992272818448}{-}{6.71239404081094}{×}{{10}}^{{-14}}{}{I}\right\}{,}\left\{{0.237394982252644}{+}{1.14318994740191}{×}{{10}}^{{-14}}{}{I}{,}{0.546628853006239}{-}{9.69240508279353}{×}{{10}}^{{-14}}{}{I}\right\}{,}\left\{{1.19776154305770}{-}{5.11993463261928}{×}{{10}}^{{-14}}{}{I}{,}{1.96030291260013}{+}{5.08720868229745}{×}{{10}}^{{-13}}{}{I}\right\}\right\}$ (8)

Refining the solutions by passing them as initial approximations to fsolve.

 > $\mathrm{finiteSols}≔\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left[x,y\right]\right)$
 ${\mathrm{finiteSols}}{≔}\left[{-0.804422190776778}{+}{1.46422793109405}{×}{{10}}^{{-13}}{}{I}{,}{-8.72546491824324}{-}{1.63996064112436}{×}{{10}}^{{-12}}{}{I}\right]{,}\left[{-0.453554755502399}{-}{1.18516902863964}{}{I}{,}{-0.278993622115284}{+}{1.39562033544011}{}{I}\right]{,}\left[{-0.453554755497185}{+}{1.18516902864016}{}{I}{,}{-0.278993622120289}{-}{1.39562033543835}{}{I}\right]{,}\left[{0.422070508744009}{+}{8.31416932077283}{×}{{10}}^{{-14}}{}{I}{,}{-1.61657845360167}{+}{1.41552150201712}{×}{{10}}^{{-14}}{}{I}\right]{,}\left[{-0.786588411674596}{+}{1.14300482683916}{}{I}{,}{0.604101549297742}{+}{0.622769842150683}{}{I}\right]{,}\left[{-0.786588411675718}{-}{1.14300482684891}{}{I}{,}{0.604101549297545}{-}{0.622769842152379}{}{I}\right]{,}\left[{1.96030291261377}{+}{1.18648213373029}{×}{{10}}^{{-11}}{}{I}{,}{1.19776154306172}{+}{2.06581830821079}{×}{{10}}^{{-12}}{}{I}\right]{,}\left[{0.546628853006178}{+}{9.53483180607193}{×}{{10}}^{{-13}}{}{I}{,}{0.237394982252100}{+}{1.66013710200305}{×}{{10}}^{{-13}}{}{I}\right]{,}\left[{0.156992272818406}{-}{1.91793241491156}{×}{{10}}^{{-13}}{}{I}{,}{-0.373755472345044}{-}{3.33936751679389}{×}{{10}}^{{-14}}{}{I}\right]$ (9)
 > $\mathrm{Digits}≔30$
 ${\mathrm{Digits}}{≔}{30}$ (10)
 > $\mathrm{better}≔\mathrm{fsolve}\left(\left\{f,g\right\},\left\{x=\mathrm{finiteSols}\left[5\right]\left[1\right],y=\mathrm{finiteSols}\left[5\right]\left[2\right]\right\}\right)$
 ${\mathrm{better}}{≔}\left\{{x}{=}{-0.804422190778384243337546951432}{,}{y}{=}{-8.72546491823766479368773875110}\right\}$ (11)
 > $\mathrm{subs}\left(\mathrm{better},\left\{f,g\right\}\right)$
 $\left\{{0.}{,}{3.}{×}{{10}}^{{-26}}\right\}$ (12)

A one-dimensional variety, which causes BivariatePolynomial to fail: Note that many roots are found of the form x=1, y=anything (but not an infinite number), and the isolated roots are lost.

 > $\mathrm{Digits}≔\mathrm{trunc}\left(\mathrm{evalhf}\left(\mathrm{Digits}\right)\right)$
 ${\mathrm{Digits}}{≔}{15}$ (13)
 > $f≔\left({x}^{2}+{y}^{2}-1\right)\left(x-1\right)$
 ${f}{≔}\left({{x}}^{{2}}{+}{{y}}^{{2}}{-}{1}\right){}\left({x}{-}{1}\right)$ (14)
 > $g≔\left(25xy-12\right)\left(x-1\right)$
 ${g}{≔}\left({25}{}{x}{}{y}{-}{12}\right){}\left({x}{-}{1}\right)$ (15)
 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left[x,y\right],\mathrm{verifyTol}=0.000010\right)$
 $\left[{1.00000000000001}{+}{0.}{}{I}{,}{-48.2854764600946}{-}{0.}{}{I}\right]{,}\left[{1.00000000000000}{+}{0.}{}{I}{,}{8.85774922411230}{-}{0.}{}{I}\right]{,}\left[{0.999999999999999}{+}{1.59594559789866}{×}{{10}}^{{-16}}{}{I}{,}{-0.548256881731679}{+}{1.00539649995294}{}{I}\right]{,}\left[{0.999999999999998}{+}{7.63278329429795}{×}{{10}}^{{-17}}{}{I}{,}{-0.548256881731679}{-}{1.00539649995294}{}{I}\right]{,}\left[{1.00000000000001}{+}{5.79789627171619}{×}{{10}}^{{-17}}{}{I}{,}{0.464774473406577}{+}{3.34432341978255}{×}{{10}}^{{-18}}{}{I}\right]$ (16)

Another example, worse in that the multiplicity is higher.

 > $f≔{\left(x-3\right)}^{2}\left(xy-6\right)$
 ${f}{≔}{\left({x}{-}{3}\right)}^{{2}}{}\left({x}{}{y}{-}{6}\right)$ (17)
 > $g≔{\left(x-3\right)}^{2}\left(y+1\right)$
 ${g}{≔}{\left({x}{-}{3}\right)}^{{2}}{}\left({y}{+}{1}\right)$ (18)
 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.010\right)$
 $\left\{{x}{=}{2.68592470937189}{-}{0.}{}{I}{,}{y}{=}{-1.46317887346061}{+}{0.}{}{I}\right\}{,}\left\{{x}{=}{2.15791534914192}{+}{0.644227916730649}{}{I}{,}{y}{=}{-1.48755443672715}{+}{1.73033825153811}{}{I}\right\}{,}\left\{{x}{=}{2.15792296460717}{-}{0.644250398418862}{}{I}{,}{y}{=}{-1.48756041794678}{-}{1.73032059432214}{}{I}\right\}$ (19)

Correct solutions are not always returned. Doing it again may produce different output (because of the randomness)

 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.010\right)$
 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.010\right)$
 $\left\{{x}{=}{2.14250546275867}{+}{0.898469218387196}{}{I}{,}{y}{=}{-1.58617065883303}{+}{4.48452871192331}{}{I}\right\}{,}\left\{{x}{=}{2.06185827547652}{-}{0.982449876693874}{}{I}{,}{y}{=}{-1.59112202236191}{-}{4.48837346265817}{}{I}\right\}{,}\left\{{x}{=}{1.82895603620728}{+}{0.227712005177187}{}{I}{,}{y}{=}{-0.534139690540961}{+}{0.0135499528556267}{}{I}\right\}$ (20)
 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.010\right)$
 $\left\{{x}{=}{2.83074750322789}{-}{0.}{}{I}{,}{y}{=}{-5.34440764482297}{+}{0.}{}{I}\right\}{,}\left\{{x}{=}{3.32626710673248}{+}{0.802831322816859}{}{I}{,}{y}{=}{-3.71254815103058}{+}{2.66132433814337}{}{I}\right\}{,}\left\{{x}{=}{3.32642870046136}{-}{0.802108971945875}{}{I}{,}{y}{=}{-3.71269602329867}{-}{2.66198535180023}{}{I}\right\}{,}\left\{{x}{=}{4.35055624273547}{+}{0.539333716222057}{}{I}{,}{y}{=}{-0.329297166975816}{+}{1.71643275289593}{}{I}\right\}{,}\left\{{x}{=}{4.35027385225703}{-}{0.539091571699415}{}{I}{,}{y}{=}{-0.329038755211797}{-}{1.71665433612207}{}{I}\right\}$ (21)
 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.010\right)$
 $\left\{{x}{=}{1.18876630685095}{-}{0.420278117396694}{}{I}{,}{y}{=}{-0.904055287630362}{+}{1.60210502409776}{}{I}\right\}{,}\left\{{x}{=}{1.21717545679501}{+}{0.237708856461106}{}{I}{,}{y}{=}{-0.734256413588338}{-}{1.46045828628190}{}{I}\right\}{,}\left\{{x}{=}{1.43705206803551}{-}{0.697985826625660}{}{I}{,}{y}{=}{-1.53979197408654}{+}{0.0506608188018502}{}{I}\right\}$ (22)
 > $\mathrm{Digits}≔30$
 ${\mathrm{Digits}}{≔}{30}$ (23)
 > $\mathrm{BivariatePolynomial}\left(\left\{f,g\right\},\left\{x,y\right\},\mathrm{verifyTol}=0.010\right)$
 $\left\{{x}{=}{1.96539582645819099086140185397}{-}{0.}{}{I}{,}{y}{=}{-1.34173486482746415826261682659}{+}{0.}{}{I}\right\}{,}\left\{{x}{=}{2.20909291710640018583589456389}{+}{0.145549312451602328964743749684}{}{I}{,}{y}{=}{4.04278281884518481743754433133}{-}{2.85972344437370543674374161486}{}{I}\right\}{,}\left\{{x}{=}{2.20895805242586542524613210627}{-}{0.145067015797578085699523849376}{}{I}{,}{y}{=}{4.04278922333647673689316298150}{+}{2.85970054093665600096145064424}{}{I}\right\}{,}\left\{{x}{=}{2.01330519571506531631985861393}{-}{0.0000371927463827307011660112568869}{}{I}{,}{y}{=}{0.121133485823375131383156239594}{+}{1.76621943852358571166213138333}{×}{{10}}^{{-6}}{}{I}\right\}$ (24)

References

 Barnett, Stephen. Polynomials and Linear Control Systems. Deffer, 1983.
 Manocha, Dinesh. "Numerical methods for solving polynomial equations, in Applications of Computational Geometry." AMS proceedings of applied mathematics, Vol. 53. 1998.