Skip to content

Chapter 1 — Fundamental Concepts

1.3 — Algebraic Expressions

Factoring does not alter an expression; it changes our point of view so that what was hidden becomes visible.


In §1.1 we established the real numbers, and in §1.2 their powers and roots. Now we take the step into the symbolic language of algebra: combining numbers and letters by means of the operations we already know. Everything that follows comes down to two opposite moves. To expand an expression is to turn a product into a sum, applying distributivity from left to right, from a(b+c)a(b+c) to ab+acab+ac. To factor is the inverse move: turning a sum into a product, reading distributivity from right to left. The first is mechanical; the second requires recognizing a structure that is not in plain sight. That second move is the central aim of this section, and it is the tool with which we will simplify fractional expressions in §1.4 and solve equations in §1.5.

An algebraic expression is any combination of numbers and letters joined by the operations defined on R\mathbb{R}: addition, subtraction, multiplication, division and taking roots. The letters are called variables and stand for arbitrary real numbers. Within this broad family we are interested in one particular case, the most regular of all: the polynomial.

A polynomial of degree nn in the variable xx is an expression of the form

P(x)=anxn+an−1xn−1+⋯+a1x+a0P(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0

where n∈N0n \in \mathbb{N}_0 (recall from §1.1 that N0=N∪{0}\mathbb{N}_0 = \mathbb{N} \cup \{0\}), the coefficients a0,a1,…,ana_0, a_1, \dots, a_n are real numbers, and an≠0a_n \neq 0. Let us read the formula carefully. The subscript of each coefficient matches the exponent of the power of xx it accompanies, so that aka_k is the coefficient of xkx^k; the ellipsis indicates that all the intermediate powers appear, in decreasing order. The summand a0a_0 carries no visible xx because x0=1x^0 = 1. The notation P(x)P(x) gives the expression a name and keeps its variable in view. If we put a number in place of xx, say 22, we write P(2)P(2) for the resulting real number; evaluating a polynomial is exactly that. Thus, if P(x)=x2−3x+1P(x) = x^2 - 3x + 1, then P(2)=4−6+1=−1P(2) = 4 - 6 + 1 = -1.

The condition an≠0a_n \neq 0 is what fixes the degree. If the coefficient of the highest power were zero, that summand would not be present and the degree would be lower. We call ana_n the leading coefficient and a0a_0 the constant term. The degree of PP is denoted deg⁡(P)\deg(P) and is the highest power of xx that appears with a nonzero coefficient. When the leading coefficient is 11, the polynomial is called monic. The polynomials of degree 00 are the nonzero constants. The constant 00 is also regarded as a polynomial, the zero polynomial, but it has no nonzero coefficient, and so we assign it no degree. Each summand akxka_k x^k is a term, and according to the number of terms with nonzero coefficient the polynomial is called a monomial (one), a binomial (two) or a trinomial (three). These names are a convenience of language, not a structural distinction. The same definition extends to several variables: 3x2y−xy+53x^2y - xy + 5 is a polynomial in xx and yy.

Why do we require the exponents to be nonnegative integers? Because a polynomial is what we obtain from numbers and the variable using only addition, subtraction and multiplication. A power xnx^n with nn natural is a repeated product, as we saw in §1.2. By contrast, x−1=1/xx^{-1} = 1/x introduces a division by the variable and x1/2=xx^{1/2} = \sqrt{x} introduces a root of the variable, and neither of those operations enters the construction. That is why x−1x^{-1} and x\sqrt{x} are not terms of a polynomial. The restriction falls on the variable, not on the coefficients: 12x2+3\frac{1}{2}x^2 + \sqrt{3} is a polynomial, because 12\frac{1}{2} and 3\sqrt{3} are simply real numbers.


Two terms are like terms when they have the same literal part, that is, the same variables with the same exponents. By distributivity, like terms are combined by adding their coefficients: 5x3−2x3=(5−2)x3=3x35x^3 - 2x^3 = (5-2)x^3 = 3x^3. To add or subtract polynomials, it is enough to combine like terms. For example,

(2x3−x2+4)−(x3+3x2−x)=x3−4x2+x+4(2x^3 - x^2 + 4) - (x^3 + 3x^2 - x) = x^3 - 4x^2 + x + 4

To multiply, we apply distributivity: each term of the first factor multiplies each term of the second, and then we combine like terms. The product of two terms is computed with the law xixj=xi+jx^i x^j = x^{i+j} from §1.2, so that (aixi)(bjxj)=aibjxi+j(a_i x^i)(b_j x^j) = a_i b_j x^{i+j}. For example,

(x+2)(x2−x+3)=x3−x2+3x+2x2−2x+6=x3+x2+x+6(x+2)(x^2 - x + 3) = x^3 - x^2 + 3x + 2x^2 - 2x + 6 = x^3 + x^2 + x + 6

In this example the degrees of the factors are 11 and 22, and the degree of the product is 33. This is no coincidence. To prove that it always happens we need a fact about R\mathbb{R} that we will use several times in this section.

Lemma. If u,v∈Ru, v \in \mathbb{R} and uv=0uv = 0, then u=0u = 0 or v=0v = 0.

Proof. Suppose u≠0u \neq 0. Then uu has a multiplicative inverse u−1u^{-1} (§1.1), and v=(u−1u)v=u−1(uv)=u−1⋅0=0v = (u^{-1}u)v = u^{-1}(uv) = u^{-1} \cdot 0 = 0. ■\blacksquare

In other words, a product of nonzero reals is never zero.

Proposition. Let PP and QQ be nonzero polynomials in xx. Then deg⁡(PQ)=deg⁡(P)+deg⁡(Q)\deg(PQ) = \deg(P) + \deg(Q), and the leading coefficient of PQPQ is the product of the leading coefficients of PP and QQ.

Proof. Let n=deg⁡(P)n = \deg(P) and m=deg⁡(Q)m = \deg(Q), with leading coefficients ana_n and bmb_m. On distributing, each term aixia_i x^i of PP multiplies each term bjxjb_j x^j of QQ and yields aibjxi+ja_i b_j x^{i+j}. Since i≤ni \le n and j≤mj \le m, every exponent satisfies i+j≤n+mi + j \le n + m, and equality i+j=n+mi + j = n + m occurs only when i=ni = n and j=mj = m. Therefore no power higher than xn+mx^{n+m} appears in the product, and the coefficient of xn+mx^{n+m} is exactly anbma_n b_m, with no other like term to combine with. By the lemma, anbm≠0a_n b_m \neq 0. ■\blacksquare

For the sum there is no rule as precise: the degree of P+QP + Q does not exceed the larger of the two degrees, but it may be smaller, because the leading terms may cancel. For example, (x2+x)+(−x2+1)=x+1(x^2 + x) + (-x^2 + 1) = x + 1.


Certain products of binomials appear so often that it pays to know their result by heart, so as not to distribute term by term every time. For all a,b∈Ra, b \in \mathbb{R}:

NameIdentity
Square of a binomial(a±b)2=a2±2ab+b2(a \pm b)^2 = a^2 \pm 2ab + b^2
Difference of squares(a+b)(a−b)=a2−b2(a+b)(a-b) = a^2 - b^2
Cube of a binomial(a±b)3=a3±3a2b+3ab2±b3(a \pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3
Sum of cubes(a+b)(a2−ab+b2)=a3+b3(a+b)(a^2-ab+b^2) = a^3+b^3
Difference of cubes(a−b)(a2+ab+b2)=a3−b3(a-b)(a^2+ab+b^2) = a^3-b^3

The symbol ±\pm packs two identities into a single line: we read all the upper signs at once, or all the lower signs at once. Thus the first row says (a+b)2=a2+2ab+b2(a+b)^2 = a^2 + 2ab + b^2 and also (a−b)2=a2−2ab+b2(a-b)^2 = a^2 - 2ab + b^2.

None of these identities is an isolated fact. All of them follow from the distributivity and commutativity of §1.1, and it is worth seeing how.

Proposition. For all a,b∈Ra, b \in \mathbb{R}, the five identities in the table hold.

Proof. For the square, by the definition of power and by distributivity,

(a+b)2=(a+b)(a+b)=a(a+b)+b(a+b)=a2+ab+ba+b2(a+b)^2 = (a+b)(a+b) = a(a+b) + b(a+b) = a^2 + ab + ba + b^2

Since ab=baab = ba, the two middle terms combine into 2ab2ab, leaving (a+b)2=a2+2ab+b2(a+b)^2 = a^2 + 2ab + b^2. For the cube we multiply this result by a+ba+b:

(a+b)3=(a2+2ab+b2)(a+b)=a3+a2b+2a2b+2ab2+ab2+b3=a3+3a2b+3ab2+b3(a+b)^3 = (a^2 + 2ab + b^2)(a+b) = a^3 + a^2b + 2a^2b + 2ab^2 + ab^2 + b^3 = a^3 + 3a^2b + 3ab^2 + b^3

The versions with a minus sign need no new computation. The identities just proved hold for every pair of reals; in particular, they hold if we put −b-b in place of bb. Since (−b)2=b2(-b)^2 = b^2 and (−b)3=−b3(-b)^3 = -b^3 by the rule of signs, we obtain (a−b)2=a2−2ab+b2(a-b)^2 = a^2 - 2ab + b^2 and (a−b)3=a3−3a2b+3ab2−b3(a-b)^3 = a^3 - 3a^2b + 3ab^2 - b^3.

For the difference of squares we distribute directly:

(a+b)(a−b)=a2−ab+ba−b2=a2−b2(a+b)(a-b) = a^2 - ab + ba - b^2 = a^2 - b^2

because −ab+ba=0-ab + ba = 0. For the sum of cubes,

(a+b)(a2−ab+b2)=a3−a2b+ab2+a2b−ab2+b3=a3+b3(a+b)(a^2 - ab + b^2) = a^3 - a^2b + ab^2 + a^2b - ab^2 + b^3 = a^3 + b^3

since the terms a2ba^2b and ab2ab^2 each appear once with each sign. Finally, putting −b-b in place of bb in this last identity yields (a−b)(a2+ab+b2)=a3−b3(a-b)(a^2 + ab + b^2) = a^3 - b^3. ■\blacksquare

The proof brings out a difference between the rows of the table. In the square and the cube of a binomial, the cross terms combine and the result has three or four terms. In the difference of squares and in the sum and difference of cubes, on the other hand, the cross terms cancel exactly and only two survive. That cancellation is what makes these three identities so useful for factoring: read from right to left, they turn a binomial into a product.


To factor a polynomial is to write it as a product of polynomials of lower degree. When do we stop? We say that a polynomial of degree greater than or equal to 11 is irreducible over R\mathbb{R} if it cannot be written as a product of two polynomials with real coefficients, both of degree greater than or equal to 11. To factor completely is to reach a product of irreducible factors. The answer depends on which coefficients we allow. If we require integer coefficients, we speak of factoring over Z\mathbb{Z}. The polynomial x2−2x^2 - 2 does not factor over Z\mathbb{Z}: a factorization with integer coefficients would produce, by the same argument we will shortly use for the sum of squares, a rational number whose square is 22, and in §1.1 we proved that none exists. Over R\mathbb{R}, on the other hand, x2−2=(x−2)(x+2)x^2 - 2 = (x - \sqrt{2})(x + \sqrt{2}).

There is no single procedure that settles every case. There is, instead, a reasonable order of attempts, worth going through before giving up.

Common factor. This is the first attempt and the most elementary. From each term we extract the highest power of each variable that all of them share and the greatest common divisor of the coefficients, applying distributivity in reverse: ax+ay=a(x+y)ax + ay = a(x+y). For example, 6x3y2−9x2y3=3x2y2(2x−3y)6x^3y^2 - 9x^2y^3 = 3x^2y^2(2x - 3y), because 3x2y23x^2y^2 is the largest thing both terms share.

Grouping terms. Sometimes no factor is common to all the terms, but one is common to some of them. We form blocks of terms that share a factor and extract that factor from each block. If the result exposes a factor common to the blocks, we extract it in turn:

ax+ay+bx+by=a(x+y)+b(x+y)=(a+b)(x+y)ax + ay + bx + by = a(x+y) + b(x+y) = (a+b)(x+y)

Difference of squares, sum and difference of cubes. These are the identities of §3 read backwards:

a2−b2=(a−b)(a+b)a3+b3=(a+b)(a2−ab+b2)a3−b3=(a−b)(a2+ab+b2)a^2 - b^2 = (a-b)(a+b) \qquad a^3 + b^3 = (a+b)(a^2 - ab + b^2) \qquad a^3 - b^3 = (a-b)(a^2 + ab + b^2)

For example, 4x2−9=(2x)2−32=(2x−3)(2x+3)4x^2 - 9 = (2x)^2 - 3^2 = (2x - 3)(2x + 3) and x3+8=x3+23=(x+2)(x2−2x+4)x^3 + 8 = x^3 + 2^3 = (x+2)(x^2 - 2x + 4).

This list lacks a formula for the sum of squares. It is not an oversight. In the simplest case the factorization is impossible, and the reason is that in R\mathbb{R} no square is negative. Indeed, it follows from the order axioms of §1.1 that t2≥0t^2 \ge 0 for every real tt: if t>0t > 0, then t2=t⋅t>0t^2 = t \cdot t > 0; if t<0t < 0, then −t>0-t > 0 and t2=(−t)2>0t^2 = (-t)^2 > 0; and 02=00^2 = 0.

Proposition. If c∈Rc \in \mathbb{R} and c≠0c \neq 0, the polynomial x2+c2x^2 + c^2 is irreducible over R\mathbb{R}.

Proof. Suppose x2+c2x^2 + c^2 is a product of two polynomials of degree greater than or equal to 11. Since degrees add (§2), both have degree 11, and we can write x2+c2=(px+q)(rx+s)x^2 + c^2 = (px + q)(rx + s) with p,q,r,sp, q, r, s real and p≠0p \neq 0, r≠0r \neq 0. Let us evaluate both sides at t=−q/pt = -q/p. On the right, the first factor equals p(−q/p)+q=0p(-q/p) + q = 0, and the product is 00. On the left, t2+c2≥c2>0t^2 + c^2 \ge c^2 > 0, because t2≥0t^2 \ge 0 and c2>0c^2 > 0. One and the same number cannot be both 00 and positive. ■\blacksquare

Irreducible over R\mathbb{R} does not mean irreducible always: when we enlarge the number system with the complex numbers, in §3.3, x2+c2x^2 + c^2 will factor. Nor does it mean that every sum of squares is irreducible. By adding and subtracting the same term, x4+4x^4 + 4 becomes a difference of squares:

x4+4=(x2+2)2−(2x)2=(x2−2x+2)(x2+2x+2)x^4 + 4 = (x^2 + 2)^2 - (2x)^2 = (x^2 - 2x + 2)(x^2 + 2x + 2)

This device of completing a square is the same one that will give us, in the next subsection, the factorization of every quadratic trinomial.


The most frequent case, and the one that demands the most care, is the trinomial ax2+bx+cax^2 + bx + c with a≠0a \neq 0. Here aa, bb and cc are the coefficients and xx is the variable.

Let us begin with the monic case, x2+bx+cx^2 + bx + c. Expanding a product of the form (x+r)(x+s)(x+r)(x+s) gives

(x+r)(x+s)=x2+(r+s)x+rs(x+r)(x+s) = x^2 + (r+s)x + rs

Therefore, if we find two reals rr and ss whose sum is bb and whose product is cc, we have the factorization x2+bx+c=(x+r)(x+s)x^2 + bx + c = (x+r)(x+s). For example, for x2+x−6x^2 + x - 6 we look for two numbers with product −6-6 and sum 11; they are 33 and −2-2, and so x2+x−6=(x+3)(x−2)x^2 + x - 6 = (x+3)(x-2). When the coefficients are integers, it is convenient to look for rr and ss among the divisors of cc. But the search does not always succeed, and when it fails it tells us nothing: does the trinomial not factor, or did we simply fail to find the numbers? To answer, we need a method that always works.

That method is completing the square. We call the discriminant of the trinomial the number

Δ=b2−4ac\Delta = b^2 - 4ac

The Greek letter Δ\Delta (capital delta) is just a name for this combination of coefficients. We will see that its sign discriminates, that is, distinguishes, the trinomials that factor from those that do not.

Proposition. Let a,b,c∈Ra, b, c \in \mathbb{R} with a≠0a \neq 0, and let Δ=b2−4ac\Delta = b^2 - 4ac.

(i) If Δ≥0\Delta \ge 0, then ax2+bx+c=a(x−x1)(x−x2)ax^2 + bx + c = a(x - x_1)(x - x_2), where

x1=−b+Δ2ax2=−b−Δ2ax_1 = \frac{-b + \sqrt{\Delta}}{2a} \qquad\qquad x_2 = \frac{-b - \sqrt{\Delta}}{2a}

(ii) If Δ<0\Delta < 0, the trinomial ax2+bx+cax^2 + bx + c is irreducible over R\mathbb{R}.

Proof. First we extract the factor aa and complete the square. Since (x+b2a)2=x2+bax+b24a2\left(x + \frac{b}{2a}\right)^2 = x^2 + \frac{b}{a}x + \frac{b^2}{4a^2} by §3, we get

ax2+bx+c=a(x2+bax+ca)=a[(x+b2a)2−b24a2+ca]=a[(x+b2a)2−Δ4a2]ax^2 + bx + c = a\left(x^2 + \frac{b}{a}x + \frac{c}{a}\right) = a\left[\left(x + \frac{b}{2a}\right)^2 - \frac{b^2}{4a^2} + \frac{c}{a}\right] = a\left[\left(x + \frac{b}{2a}\right)^2 - \frac{\Delta}{4a^2}\right]

where in the last step we wrote −b24a2+ca=−b2−4ac4a2-\frac{b^2}{4a^2} + \frac{c}{a} = -\frac{b^2 - 4ac}{4a^2}. This identity holds regardless of the sign of Δ\Delta.

(i) If Δ≥0\Delta \ge 0, then Δ\sqrt{\Delta} exists (§1.2), and (Δ2a)2=Δ4a2\left(\frac{\sqrt{\Delta}}{2a}\right)^2 = \frac{\Delta}{4a^2}. The bracket is then a difference of squares, with u=x+b2au = x + \frac{b}{2a} and v=Δ2av = \frac{\sqrt{\Delta}}{2a}, and by §3 it factors as (u−v)(u+v)(u - v)(u + v). But

u−v=x−−b+Δ2a=x−x1u+v=x−−b−Δ2a=x−x2u - v = x - \frac{-b + \sqrt{\Delta}}{2a} = x - x_1 \qquad\qquad u + v = x - \frac{-b - \sqrt{\Delta}}{2a} = x - x_2

so that ax2+bx+c=a(x−x1)(x−x2)ax^2 + bx + c = a(x - x_1)(x - x_2).

(ii) If Δ<0\Delta < 0, then for every real tt the bracket evaluated at tt is positive, because (t+b2a)2≥0\left(t + \frac{b}{2a}\right)^2 \ge 0 and −Δ4a2>0-\frac{\Delta}{4a^2} > 0. Since a≠0a \neq 0, the lemma of §2 gives at2+bt+c≠0at^2 + bt + c \neq 0 for every real tt. If the trinomial factored, then, as in the proposition of §4, both factors would have degree 11, and we could write ax2+bx+c=(px+q)(rx+s)ax^2 + bx + c = (px + q)(rx + s) with p≠0p \neq 0. Evaluating at t=−q/pt = -q/p, the right-hand side would be 00, contradicting what we just showed. ■\blacksquare

Let us look at one example of each case. For 2x2−x−32x^2 - x - 3 we have Δ=(−1)2−4⋅2⋅(−3)=25\Delta = (-1)^2 - 4 \cdot 2 \cdot (-3) = 25, so that x1=1+54=32x_1 = \frac{1 + 5}{4} = \frac{3}{2} and x2=1−54=−1x_2 = \frac{1 - 5}{4} = -1. Then 2x2−x−3=2(x−32)(x+1)=(2x−3)(x+1)2x^2 - x - 3 = 2\left(x - \frac{3}{2}\right)(x + 1) = (2x - 3)(x + 1), where in the last step we absorbed the 22 into the first factor. On the other hand, for x2+x+1x^2 + x + 1 the discriminant is 1−4=−3<01 - 4 = -3 < 0, and the trinomial is irreducible. The sum of squares x2+c2x^2 + c^2 from §4 is the case a=1a = 1, b=0b = 0, with Δ=−4c2<0\Delta = -4c^2 < 0. Both irreducibilities thus have the same cause: in R\mathbb{R} no square is negative.

When Δ=0\Delta = 0, the two numbers coincide, x1=x2=−b2ax_1 = x_2 = -\frac{b}{2a}, and the trinomial is a(x−x1)2a(x - x_1)^2, a perfect square multiplied by aa. Note also that x1x_1 and x2x_2 make the trinomial vanish, because each makes one of the factors vanish. In §1.5 we will read this same computation as the solution of the equation ax2+bx+c=0ax^2 + bx + c = 0.


With polynomials, their operations, the special products and the factoring techniques now available, we are in a position to study quotients of polynomials: fractional expressions, the subject of the next section.