1 - x + 6x3
-7
x
are all examples of polynomials. Here's a precise definition.

A polynomial in an indeterminate (or variable x) with coefficients in a ring R is a formal expression

f=a0 + a1x + a2x2 + ... + anxn
where n is a nonegative integer, and each ai is in R. The constant term of f is a0 and ai is called the coefficient of xi in f. The coefficients of xN in f, for N>n are defined to be zero. Given a second formal expression
g=b0 + b1x + b2x2 + ... + bmxn
Then we say that f=g if and only if for each i the coefficents of xi in f and g are equal. (This is what we mean when we speak of equating coefficients in a polynomial equation.)

The polynomial f is called zero if all its coefficients are zero. A nonzero polynomial has a degree which is defined to be the largest nonnegative integer t such that the coefficient of xt in f is nonzero. By convention the zero polynomial has degree -infinity. For short we write deg f for the degree of f.

We define rules to add and multiply the polynomials f,g as follows

f + g = (a0+b0) + (a1+b1)x + ... + (an+bn)xn + ... +bmxm
if m>=n and
f . g = c0 + c1x + c2x2 + ... + cn+mxn+m
where
ck=a0bk + a1bk-1 +...+ arbk-r +...+ a0bk

These rules makes the collection of all such polynomials into a ring. This ring is denoted by R[x] and is called the polynomial ring in x with coefficients in R. Note that the collection of constant terms is a subring of R[x] which is isomorphic to R. We always identify R with this subring and think of R as sitting inside R[x].

Note that deg(f+g) <= max{ deg f, deg g }. If R is an integral domain then deg(fg) = deg f + deg g.

Polynomials in several variables

Starting with R[x] we could form the polynomial ring R[x][y] in a new indeterminate, y, say. The elements of this ring have a unique expression as a sums of terms

ai,jxiyj
with (i,j) ranging over finitely many pairs of nonnegative inetgers and ai,j nonzero in R.

Clearly, if we had started with R[y] and then formed R[y][x] we would have obtained the same ring. This ring is denoted by R[x,y]

More generally, we can inductively define

R[x1,...,xn]=R[x1,...,xn-1][xn]
the polynomial ring in several indeterminates. A typical element of this ring can be written uniquely as a sum of monomials
ai1,i2,...,inx1i1...xnin
where (i1,...,in) range over finitely many tuples of integers and ai1,i2,...,in is nonzero in R.

The total degree of such a monomial is defined to be i1+...+in and the total degree of a nonzero polynomial is the largest total degree of a monomial.