Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am sorry. But I wonder whether it is fine to ask this question here.

I need some help to solve some equations in a polynomial ring:

Give the ring $\mathbb{F}_p [x ]/(x^2+x+1)$, where $p$ is a prime (for example $p=5$). I need to solve some equations like:

$(1-x)f_i(x)+x f_j(x)-f_k(x)=0$

I have no idea how to solve this in Mathematica. (Of course, we can solve them via pencil and paper. But it is a headache if it involves 20 or more equations.) Any help is appreciated.

My own approach was to set $f_i(x) = a+b x$ with $a,b \in \mathbb{F}_5$. Then try to solve the (linear) equations $mod\ 5$. But it failed because we may need $x^2+x+1=0$.

share|cite|improve this question
This question might be better suited at Mathematica SE. – mickep Jan 4 at 20:30
up vote 5 down vote accepted

Use of substitutions could help here, x^2->-x-1. For arbitrary polynomial y with integer coefficients:

qFp[y_,p_]:=((y//Expand) //.{x^n_ /;n>1->x^(n-2)(-x-1)//Expand}//Expand) /. a_Integer -> Mod[a, p]

Will be an equal to $q(x)$ polynomial in $\mathbb F_p[x]$ of degree 1. For example,



share|cite|improve this answer
+1 Neat. Clearly I don't know enough about Mathematica. When I was learning it, AlgebraicRules was used in contexts like this, but that was clumsy. I need to try this the next time I need it! – Jyrki Lahtonen Jul 1 '11 at 6:26

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.