ASKSAGE: Sage Q&A Forum - Individual question feedhttp://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 20 Oct 2016 16:21:28 -0500irreducibility of a polynomialhttp://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/If f $f(x)$ is a polynomial, i know that the command $f.factor()$ gives the factorization of f. But I am interested in knowing whether the polynomial is irreducible or not, not its factors. Is there any command for that ? Tue, 26 Jul 2016 15:54:08 -0500http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/Comment by nebuckandazzer for <p>If f $f(x)$ is a polynomial, i know that the command $f.factor()$ gives the factorization of f. But I am interested in knowing whether the polynomial is irreducible or not, not its factors. Is there any command for that ? </p>
http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/?comment=35206#post-id-35206thanks @slelievreThu, 20 Oct 2016 16:21:28 -0500http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/?comment=35206#post-id-35206Comment by slelievre for <p>If f $f(x)$ is a polynomial, i know that the command $f.factor()$ gives the factorization of f. But I am interested in knowing whether the polynomial is irreducible or not, not its factors. Is there any command for that ? </p>
http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/?comment=35177#post-id-35177To display inline code, surround it within backticks `...`. This way you could get `f.factor()` instead of $f.factor()$.Tue, 18 Oct 2016 06:22:51 -0500http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/?comment=35177#post-id-35177Answer by vdelecroix for <p>If f $f(x)$ is a polynomial, i know that the command $f.factor()$ gives the factorization of f. But I am interested in knowing whether the polynomial is irreducible or not, not its factors. Is there any command for that ? </p>
http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/?answer=34246#post-id-34246There is
sage: R = ZZ['x']
sage: x = R.gen()
sage: (x^2 + 2*x + 1).is_irreducible()
False
sage: (x^2 - x + 1).is_irreducible()
True
Note that the irreducibility depends on the base ring (the integers in the example above).
sage: xZZ = polygen(ZZ)
sage: xQQ = polygen(QQ)
sage: (2*xZZ).is_irreducible()
False
sage: (2*xQQ).is_irreducible()
TrueTue, 26 Jul 2016 16:51:48 -0500http://ask.sagemath.org/question/34244/irreducibility-of-a-polynomial/?answer=34246#post-id-34246