Ask Your Question

Revision history [back]

The issue is that gen_laguerre returns a symbolic expression, not a polynomial:

sage: g(4,-10,x)
1/24*x^4 + 11/12*x^3 + 143/16*x^2 + 715/16*x + 12155/128
sage: g(4,-10,x).parent()
Symbolic Ring

You want to deal with polynomials. I presume you are interested in the irreducibility as polynomials defined over the rationals. A simple way to transform the expressions into genuine polynomial is:

sage: g(4,-10,x).polynomial(QQ)
1/24*x^4 + 11/12*x^3 + 143/16*x^2 + 715/16*x + 12155/128
sage:     sage: g(4,-10,x).polynomial(QQ).parent()
Univariate Polynomial Ring in x over Rational Field

As you can see, they are all irreducible over the rationals:

sage: [g(n,-10,x).polynomial(QQ).is_irreducible() for n in range(2,11)]
[True, True, True, True, True, True, True, True, True]
sage: all([g(n,-10,x).polynomial(QQ).is_irreducible() for n in range(2,11)])
True

Note that the base ring is important, for example, they are of course not irreducible anymore on the algebraic numbers:

sage: [g(n,-10,x).polynomial(QQbar).is_irreducible() for n in range(2,11)]
[False, False, False, False, False, False, False, False, False]

The issue is that gen_laguerre returns a symbolic expression, not a polynomial:

sage: g(4,-10,x)
1/24*x^4 + 11/12*x^3 + 143/16*x^2 + 715/16*x + 12155/128
sage: g(4,-10,x).parent()
Symbolic Ring

You want to deal with polynomials. I presume you are interested in the irreducibility as polynomials defined over the rationals. A simple way to transform the expressions into genuine polynomial is:

sage: g(4,-10,x).polynomial(QQ)
1/24*x^4 + 11/12*x^3 + 143/16*x^2 + 715/16*x + 12155/128
sage:     sage: g(4,-10,x).polynomial(QQ).parent()
Univariate Polynomial Ring in x over Rational Field

As you can see, they are all irreducible over the rationals:

sage: [g(n,-10,x).polynomial(QQ).is_irreducible() for n in range(2,11)]
[True, True, True, True, True, True, True, True, True]
sage: all([g(n,-10,x).polynomial(QQ).is_irreducible() for n in range(2,11)])
True

Note that the base ring is important, for example, they are of course not irreducible anymore on the algebraic numbers:

sage: [g(n,-10,x).polynomial(QQbar).is_irreducible() for n in range(2,11)]
[False, False, False, False, False, False, False, False, False]