# is_irreducible function

Test whether a polynomial cannot be factored, over the rationals or modulo a prime.

## How to write it

### is_irreducible(p, x)

**p**

The polynomial. Takes an expression.

**x**

Its variable. Takes a variable.

## Examples

- $\displaystyle \operatorname{is\_irreducible}(x^{2}+1, x) = \operatorname{true}$

  `is_irreducible(x^2 + 1, x)`

  In the solver, `is_irreducible(x^2 + 1, x)` gives `true`.

  [Open in the solver](https://hilberon.com/?q=is_irreducible%28x%5E2%20%2B%201%2C%20x%29)
- $\displaystyle \operatorname{is\_irreducible}(x^{4}+x+1, x, \operatorname{modulus} = 2) = \operatorname{true}$

  `is_irreducible(x^4 + x + 1, x, modulus = 2)`

  In the solver, `is_irreducible(x^4 + x + 1, x, modulus = 2)` gives `true`.

  [Open in the solver](https://hilberon.com/?q=is_irreducible%28x%5E4%20%2B%20x%20%2B%201%2C%20x%2C%20modulus%20%3D%202%29)

## Related functions

- [permutation_inverse](https://hilberon.com/library/permutation_inverse)

  The inverse of a permutation.
- [group_order](https://hilberon.com/library/group_order)

  How many elements a group has.
- [permutation_order](https://hilberon.com/library/permutation_order)

  The order of a permutation: the least power that is the identity.
- [group_elements](https://hilberon.com/library/group_elements)

  The elements of a group, as permutations in cycle notation.
- [permutation_power](https://hilberon.com/library/permutation_power)

  A permutation to a whole power.
- [field_inverse](https://hilberon.com/library/field_inverse)

  The inverse of an element of a finite field.

---
Source: https://hilberon.com/library/is_irreducible
