# Division by factorized polynomials in Macaulay2

I have this problem dividing by factorized polynomials, for example

(x_1^4-x_2^4)//(factor(x_1^2-x_2^2))

does not work because the numerator is of "class R" (R is the ring kk[x_1..x_n]) and the denominator is of "class Product".

How to convert elements of class Product to class R?

• have you tried to ask this in Macaulay2 Google Discussion Group? The link to it is on Macaulay2 front page. Aug 30, 2014 at 22:23
• Yes Alexander, I posted it there first, have received no answer :) This is a silly question... but anyway the answer was useful, didn't know about the 'value' function. Sep 9, 2014 at 22:23
• Do you know a command eg to get (1,2) out of (x^2+2*y) and ideal(x^2,y) in M2?
– hhh
Feb 20, 2016 at 22:28

You could use value, as follows.

\$ M2
Macaulay2, version 1.6
with packages: ConwayPolynomials, Elimination, IntegralClosure, LLLBases, PrimaryDecomposition, ReesAlgebra, TangentCone

i1 : kk = QQ

o1 = QQ

o1 : Ring

i2 : R = kk[x_1..x_5]

o2 = R

o2 : PolynomialRing

i3 : p = (x_1^4-x_2^4)

4    4
o3 = x  - x
1    2

o3 : R

i4 : q = factor(x_1^2-x_2^2)

o4 = (- x  + x )(x  + x )(-1)
1    2   1    2

o4 : Expression of class Product

i5 : value(q)

2    2
o5 = x  - x
1    2

o5 : R

i6 : p // value(q)

2    2
o6 = x  + x
1    2

o6 : R