intersectcurves - Maple Help

algcurves

 intersectcurves
 intersect two plane algebraic curves

 Calling Sequence intersectcurves(f, g, x, y, options) intersectcurves(f, g, x, y, z, options) intersectcurves(f, g, x, y, z, t, u, options)

Parameters

 f, g - polynomials with rational coefficients describing algebraic curves x, y - variable names z - optional variable name for the homogeneous case t, u - optional variable names to be used in the result options - optional equation of the form 'sort'='multiplicity'

Returns

list of pairs of the form $\left[m,\left[a,b,c\right]\right]$, where $\left[a,b,c\right]$ describe a set $C$ of intersection points in homogeneous coordinates and $m$ is a positive integer representing the intersection multiplicity of each of the points in $C$. Three cases may occur:

 • $c=1$. In this case all points in $C$ are affine, $b$ is an irreducible univariate polynomial, and $a$ is an irreducible bivariate polynomial, with the property that the $y$-coordinates of all points $P\in C$ are precisely the roots $\mathrm{\beta }$ of $b\left(y\right)=0$ and the $x$-coordinates are precisely the roots $\mathrm{\alpha }$ of $a\left(x,\mathrm{\beta }\right)=0$ for some such $\mathrm{\beta }$. The cycle description of $C$ is

$\sum _{b\left(\mathrm{\beta }\right)=0}\sum _{a\left(\mathrm{\alpha },\mathrm{\beta }\right)=0}\left[\mathrm{\alpha },\mathrm{\beta },1\right].$

 • $b=1$ and $c=0$. In this case all points in $C$ are at infinity and $a$ is an irreducible univariate polynomial with the property that the $x$-coordinates of all points $P\in C$ are precisely the roots $\mathrm{\alpha }$ of $a\left(x\right)=0$. The cycle description of $C$ is $\mathrm{sum}\left(\left[\mathrm{\alpha },1,0\right],a\left(\mathrm{\alpha }\right)=0\right)$.
 • $\left[a,b,c\right]=\left[1,0,0\right]$, a special point at infinity.

Options

 • 'sort'='multiplicity': If this optional argument is specified, the output will be sorted by increasing multiplicity.
 Otherwise, by default, affine points precede points at infinity in the output order, and further to this the output is sorted by increasing degree of $b$ and then by increasing degree of $a$.

Description

 • The intersectcurves command computes the intersection cycle, i.e., the formal sum of the intersection points in the projective plane, with multiplicities, of the two plane algebraic curves given by $f=0$ and $g=0$, respectively.
 • If f and g are  polynomials in x and y, and either z=1 or z is omitted, then the intersection cycle of their homogenized versions ${z}^{\mathrm{deg}\left(f\right)}f\left(\frac{x}{z},\frac{y}{z}\right)$ and ${z}^{\mathrm{deg}\left(g\right)}g\left(\frac{x}{z},\frac{y}{z}\right)$ is computed.
 • If z is specified and f and g are polynomials in x, y, and z, both polynomials are required to be homogeneous.
 • The polynomials f and g are assumed to have no nonconstant common factor. This can be checked using gcd. Otherwise an error message will be generated.

Examples

 > $\mathrm{with}\left(\mathrm{algcurves}\right):$
 > $\mathrm{intersectcurves}\left({x}^{2}+{y}^{2}-1,{x}^{2}+{y}^{2}-4,x,y\right)$
 $\left[\left[{2}{,}\left[{{x}}^{{2}}{+}{1}{,}{1}{,}{0}\right]\right]\right]$ (1)

The output represents the two points $\left[I,1,0\right]$ and $\left[-I,1,0\right]$ in the projective plane ${ℙ}^{2}\left(ℂ\right)$, each taken with multiplicity 2.

 > $f≔{y}^{2}{z}^{3}-{x}^{3}{z}^{2}-{x}^{5}$
 ${f}{≔}{-}{{x}}^{{5}}{-}{{x}}^{{3}}{}{{z}}^{{2}}{+}{{y}}^{{2}}{}{{z}}^{{3}}$ (2)
 > $g≔{y}^{2}{z}^{3}-{x}^{3}{z}^{2}-{x}^{4}z$
 ${g}{≔}{-}{{x}}^{{4}}{}{z}{-}{{x}}^{{3}}{}{{z}}^{{2}}{+}{{y}}^{{2}}{}{{z}}^{{3}}$ (3)
 > $L≔\mathrm{intersectcurves}\left(f,g,x,y,z,t,u\right)$
 ${L}{≔}\left[\left[{8}{,}\left[{t}{,}{u}{,}{1}\right]\right]{,}\left[{1}{,}\left[{t}{-}{1}{,}{{u}}^{{2}}{-}{2}{,}{1}\right]\right]{,}\left[{15}{,}\left[{t}{,}{1}{,}{0}\right]\right]\right]$ (4)

This represents the affine points $\left[0,0,1\right]$ of multiplicity $8$, each of $\left[1,\sqrt{2},1\right]$ and $\left[1,-\sqrt{2},1\right]$ with multiplicity $1$, and the infinite point $\left[0,1,0\right]$ with multiplicity $15$.

Note that $t,u$ were used instead of $x,y$ as variables in the output polynomials.

Let us verify that each of these points actually lies on both curves.

 > $\mathrm{eval}\left(\left[f,g\right],\left[x=0,y=0,z=1\right]\right)$
 $\left[{0}{,}{0}\right]$ (5)
 > $\mathrm{eval}\left(\left[f,g\right],\left[x=1,y=\mathrm{sqrt}\left(2\right),z=1\right]\right)$
 $\left[{0}{,}{0}\right]$ (6)
 > $\mathrm{eval}\left(\left[f,g\right],\left[x=1,y=-\mathrm{sqrt}\left(2\right),z=1\right]\right)$
 $\left[{0}{,}{0}\right]$ (7)
 > $\mathrm{eval}\left(\left[f,g\right],\left[x=0,y=1,z=0\right]\right)$
 $\left[{0}{,}{0}\right]$ (8)

By Bezout's theorem, the total number of intersection points, counted with multiplicities, equals the product of the degrees of the input polynomials (note that $\left[1,\left[t-1,{u}^{2}-2,1\right]\right]$ actually represents two points):

 > $\mathrm{degree}\left(f\right)\mathrm{degree}\left(g\right)$
 ${25}$ (9)

We can also request the output to be sorted by multiplicity:

 > $L≔\mathrm{intersectcurves}\left(f,g,x,y,z,t,u,'\mathrm{sort}'='\mathrm{multiplicity}'\right)$
 ${L}{≔}\left[\left[{1}{,}\left[{t}{-}{1}{,}{{u}}^{{2}}{-}{2}{,}{1}\right]\right]{,}\left[{8}{,}\left[{t}{,}{u}{,}{1}\right]\right]{,}\left[{15}{,}\left[{t}{,}{1}{,}{0}\right]\right]\right]$ (10)
 > $A≔\left(y-z\right){x}^{5}+\left({y}^{2}-yz\right){x}^{4}+\left({y}^{3}-{y}^{2}z\right){x}^{3}+\left(-{y}^{2}{z}^{2}+y{z}^{3}\right){x}^{2}+\left(-{y}^{3}{z}^{2}+{y}^{2}{z}^{3}\right)x-{y}^{4}{z}^{2}+{y}^{3}{z}^{3}$
 ${A}{≔}\left({y}{-}{z}\right){}{{x}}^{{5}}{+}\left({{y}}^{{2}}{-}{y}{}{z}\right){}{{x}}^{{4}}{+}\left({{y}}^{{3}}{-}{{y}}^{{2}}{}{z}\right){}{{x}}^{{3}}{+}\left({-}{{y}}^{{2}}{}{{z}}^{{2}}{+}{y}{}{{z}}^{{3}}\right){}{{x}}^{{2}}{+}\left({-}{{y}}^{{3}}{}{{z}}^{{2}}{+}{{y}}^{{2}}{}{{z}}^{{3}}\right){}{x}{-}{{y}}^{{4}}{}{{z}}^{{2}}{+}{{y}}^{{3}}{}{{z}}^{{3}}$ (11)
 > $B≔\left({y}^{2}-2{z}^{2}\right){x}^{2}+\left({y}^{3}-2y{z}^{2}\right)x+{y}^{4}-{y}^{2}{z}^{2}-2{z}^{4}$
 ${B}{≔}\left({{y}}^{{2}}{-}{2}{}{{z}}^{{2}}\right){}{{x}}^{{2}}{+}\left({{y}}^{{3}}{-}{2}{}{y}{}{{z}}^{{2}}\right){}{x}{+}{{y}}^{{4}}{-}{{y}}^{{2}}{}{{z}}^{{2}}{-}{2}{}{{z}}^{{4}}$ (12)
 > $\mathrm{intersectcurves}\left(A,B,x,y,z\right)$
 $\left[\left[{1}{,}\left[{{x}}^{{2}}{+}{x}{+}{2}{,}{y}{-}{1}{,}{1}\right]\right]{,}\left[{1}{,}\left[{x}{+}{y}{,}{{y}}^{{2}}{+}{1}{,}{1}\right]\right]{,}\left[{1}{,}\left[{{x}}^{{2}}{+}{x}{}{y}{+}{2}{,}{{y}}^{{2}}{-}{2}{,}{1}\right]\right]{,}\left[{1}{,}\left[{{x}}^{{3}}{-}{y}{,}{{y}}^{{2}}{-}{2}{,}{1}\right]\right]{,}\left[{1}{,}\left[{-}{{y}}^{{3}}{+}{x}{,}{{y}}^{{4}}{+}{1}{,}{1}\right]\right]{,}\left[{2}{,}\left[{{x}}^{{2}}{+}{x}{+}{1}{,}{1}{,}{0}\right]\right]{,}\left[{2}{,}\left[{1}{,}{0}{,}{0}\right]\right]\right]$ (13)

In this example,

 – $\left[{x}^{2}+x+2,y-1,1\right]$ is the formal sum of the two points $\left[\mathrm{\alpha },1,1\right]$, where $\mathrm{\alpha }$ runs over the two roots of ${x}^{2}+x+2$;
 – $\left[x+y,{y}^{2}+1,1\right]$ is the formal sum of the two points $\left[-I,I,1\right]+\left[I,-I,1\right]$;
 – $\left[{x}^{2}+xy+2,{y}^{2}-2,1\right]$ is the formal sum of the two points $\left[{\mathrm{\alpha }}_{1},\sqrt{2},1\right]$, where ${\mathrm{\alpha }}_{1}$ runs over the two roots of ${x}^{2}+\sqrt{2}x+2$, plus the formal sum of the two points $\left[{\mathrm{\alpha }}_{2},-\sqrt{2},1\right]$, where ${\mathrm{\alpha }}_{2}$ runs over the two roots of ${x}^{2}-\sqrt{2}x+2$.
 – $\left[{x}^{3}-y,{y}^{2}-2,1\right]$ is the formal sum of the six points $\left[\mathrm{\alpha },{\mathrm{\alpha }}^{3},1\right]$, where $\mathrm{\alpha }$ runs over the roots of ${x}^{6}-2$, i.e., the $6$th roots of $2$;
 – $\left[-{y}^{3}+x,{y}^{4}+1,1\right]$ is the formal sum of the four points $\left[{\mathrm{\beta }}^{3},\mathrm{\beta },1\right]$, where $\mathrm{\beta }$ runs over the four roots ${ⅇ}^{\frac{I}{4}\mathrm{\pi }},{ⅇ}^{\frac{3I}{4}\mathrm{\pi }},{ⅇ}^{\frac{5I}{4}\mathrm{\pi }},{ⅇ}^{\frac{7I}{4}\mathrm{\pi }}$ of ${y}^{4}+1$, i.e., the primitive $8$th roots of unity;
 – $\left[{x}^{2}+x+1,1,0\right]$ is the formal sum of the two points $\left[{ⅇ}^{\frac{2I}{3}\mathrm{\pi }},1,0\right]+\left[{ⅇ}^{\frac{4I}{3}\mathrm{\pi }},1,0\right]$, where ${ⅇ}^{\frac{2I}{3}\mathrm{\pi }},{ⅇ}^{\frac{4I}{3}\mathrm{\pi }}$ are the two roots of ${x}^{2}+x+1$, i.e., the primitive cube roots of unity.

References

 J. Hilmar and C. Smyth, Euclid meets Bezout: intersecting algebraic plane curves with the Euclidean algorithm, American Mathematical Monthly 117 (2010), 250-260.

Compatibility

 • The algcurves[intersectcurves] command was introduced in Maple 17.
 • For more information on Maple 17 changes, see Updates in Maple 17.