Source: /cirosantilli/polynomial-over-a-ring

= Polynomial over a ring
{wiki}

The usual definition of a <polynomial> is over a <field (mathematics)> as shown at <polynomial over a field>.

However, there is nothing in the immediate definition that prevents us from having a <ring (mathematics)> instead, i.e. a <field (mathematics)> but without the <commutative property> and <inverse elements>.

The only thing is that then we would need to differentiate between different orderings of the terms of <multivariate polynomial>, e.g. the following would all be potentially different terms:
$$
2xxy + 2xyx + 2yxx +
x2xy + x2yx + y2xx +
xx2y + xy2x + yx2x +
xxy2 + xyx2 + yxx2
$$
while for a field they would all go into a single term:
$$
12x^2y
$$
so when considering a polynomial over a <ring (mathematics)> we end up with a lot more more possible terms.