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)\) to \(ab+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.


§1. Polynomials and their elements

An algebraic expression is any combination of numbers and letters joined by the operations defined on \(\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 \(n\) in the variable \(x\) is an expression of the form

\[P(x) = a_n x^n + a_{n-1} x^{n-1} + \dots + a_1 x + a_0\]

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

The condition \(a_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 \(a_n\) the leading coefficient and \(a_0\) the constant term. The degree of \(P\) is denoted \(\deg(P)\) and is the highest power of \(x\) that appears with a nonzero coefficient. When the leading coefficient is \(1\), the polynomial is called monic. The polynomials of degree \(0\) are the nonzero constants. The constant \(0\) is also regarded as a polynomial, the zero polynomial, but it has no nonzero coefficient, and so we assign it no degree. Each summand \(a_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: \(3x^2y - xy + 5\) is a polynomial in \(x\) and \(y\).

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 \(x^n\) with \(n\) natural is a repeated product, as we saw in §1.2. By contrast, \(x^{-1} = 1/x\) introduces a division by the variable and \(x^{1/2} = \sqrt{x}\) introduces a root of the variable, and neither of those operations enters the construction. That is why \(x^{-1}\) and \(\sqrt{x}\) are not terms of a polynomial. The restriction falls on the variable, not on the coefficients: \(\frac{1}{2}x^2 + \sqrt{3}\) is a polynomial, because \(\frac{1}{2}\) and \(\sqrt{3}\) are simply real numbers.

Reminder. In a polynomial, the variable appears only with nonnegative integer exponents; the coefficients may be any real numbers. The zero polynomial has no degree.



§2. Operations with polynomials

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: \(5x^3 - 2x^3 = (5-2)x^3 = 3x^3\). To add or subtract polynomials, it is enough to combine like terms. For example,

\[(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 \(x^i x^j = x^{i+j}\) from §1.2, so that \((a_i x^i)(b_j x^j) = a_i b_j x^{i+j}\). For example,

\[(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 \(1\) and \(2\), and the degree of the product is \(3\). This is no coincidence. To prove that it always happens we need a fact about \(\mathbb{R}\) that we will use several times in this section.

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

Proof. Suppose \(u \neq 0\). Then \(u\) has a multiplicative inverse \(u^{-1}\) (§1.1), and \(v = (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 \(P\) and \(Q\) be nonzero polynomials in \(x\). Then \(\deg(PQ) = \deg(P) + \deg(Q)\), and the leading coefficient of \(PQ\) is the product of the leading coefficients of \(P\) and \(Q\).

Proof. Let \(n = \deg(P)\) and \(m = \deg(Q)\), with leading coefficients \(a_n\) and \(b_m\). On distributing, each term \(a_i x^i\) of \(P\) multiplies each term \(b_j x^j\) of \(Q\) and yields \(a_i b_j x^{i+j}\). Since \(i \le n\) and \(j \le m\), every exponent satisfies \(i + j \le n + m\), and equality \(i + j = n + m\) occurs only when \(i = n\) and \(j = m\). Therefore no power higher than \(x^{n+m}\) appears in the product, and the coefficient of \(x^{n+m}\) is exactly \(a_n b_m\), with no other like term to combine with. By the lemma, \(a_n b_m \neq 0\). \(\blacksquare\)

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

Reminder. When nonzero polynomials are multiplied, the degrees add. When they are added, the degree may drop.



§3. Special products

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 \in \mathbb{R}\):

Name Identity
Square of a binomial \((a \pm b)^2 = a^2 \pm 2ab + b^2\)
Difference of squares \((a+b)(a-b) = a^2 - b^2\)
Cube of a binomial \((a \pm b)^3 = a^3 \pm 3a^2b + 3ab^2 \pm b^3\)
Sum of cubes \((a+b)(a^2-ab+b^2) = a^3+b^3\)
Difference of cubes \((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 = a^2 + 2ab + b^2\) and also \((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 \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) = a^2 + ab + ba + b^2\]

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

\[(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\) in place of \(b\). Since \((-b)^2 = b^2\) and \((-b)^3 = -b^3\) by the rule of signs, we obtain \((a-b)^2 = a^2 - 2ab + b^2\) and \((a-b)^3 = a^3 - 3a^2b + 3ab^2 - b^3\).

For the difference of squares we distribute directly:

\[(a+b)(a-b) = a^2 - ab + ba - b^2 = a^2 - b^2\]

because \(-ab + ba = 0\). For the sum of cubes,

\[(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 \(a^2b\) and \(ab^2\) each appear once with each sign. Finally, putting \(-b\) in place of \(b\) in this last identity yields \((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.

Reminder. The square of a binomial always includes the double product: \((a+b)^2\) and \(a^2+b^2\) coincide only when \(ab = 0\). In the difference of squares and in the sum and difference of cubes, the cross terms cancel.



§4. Factoring techniques

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 \(1\) is irreducible over \(\mathbb{R}\) if it cannot be written as a product of two polynomials with real coefficients, both of degree greater than or equal to \(1\). 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 \(\mathbb{Z}\). The polynomial \(x^2 - 2\) does not factor over \(\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 \(2\), and in §1.1 we proved that none exists. Over \(\mathbb{R}\), on the other hand, \(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)\). For example, \(6x^3y^2 - 9x^2y^3 = 3x^2y^2(2x - 3y)\), because \(3x^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)\]

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

\[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, \(4x^2 - 9 = (2x)^2 - 3^2 = (2x - 3)(2x + 3)\) and \(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 \(\mathbb{R}\) no square is negative. Indeed, it follows from the order axioms of §1.1 that \(t^2 \ge 0\) for every real \(t\): if \(t > 0\), then \(t^2 = t \cdot t > 0\); if \(t < 0\), then \(-t > 0\) and \(t^2 = (-t)^2 > 0\); and \(0^2 = 0\).

Proposition. If \(c \in \mathbb{R}\) and \(c \neq 0\), the polynomial \(x^2 + c^2\) is irreducible over \(\mathbb{R}\).

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

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

\[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.

Reminder. Before applying any other technique, we look for a common factor. The sum of squares \(x^2 + c^2\), with \(c \neq 0\), does not factor over \(\mathbb{R}\), because no real square is negative.



§5. The quadratic trinomial

The most frequent case, and the one that demands the most care, is the trinomial \(ax^2 + bx + c\) with \(a \neq 0\). Here \(a\), \(b\) and \(c\) are the coefficients and \(x\) is the variable.

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

\[(x+r)(x+s) = x^2 + (r+s)x + rs\]

Therefore, if we find two reals \(r\) and \(s\) whose sum is \(b\) and whose product is \(c\), we have the factorization \(x^2 + bx + c = (x+r)(x+s)\). For example, for \(x^2 + x - 6\) we look for two numbers with product \(-6\) and sum \(1\); they are \(3\) and \(-2\), and so \(x^2 + x - 6 = (x+3)(x-2)\). When the coefficients are integers, it is convenient to look for \(r\) and \(s\) among the divisors of \(c\). 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

\[\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 \in \mathbb{R}\) with \(a \neq 0\), and let \(\Delta = b^2 - 4ac\).

(i) If \(\Delta \ge 0\), then \(ax^2 + bx + c = a(x - x_1)(x - x_2)\), where

\[x_1 = \frac{-b + \sqrt{\Delta}}{2a} \qquad\qquad x_2 = \frac{-b - \sqrt{\Delta}}{2a}\]

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

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

\[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 \(-\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 \(\Delta \ge 0\), then \(\sqrt{\Delta}\) exists (§1.2), and \(\left(\frac{\sqrt{\Delta}}{2a}\right)^2 = \frac{\Delta}{4a^2}\). The bracket is then a difference of squares, with \(u = x + \frac{b}{2a}\) and \(v = \frac{\sqrt{\Delta}}{2a}\), and by §3 it factors as \((u - v)(u + v)\). But

\[u - 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 \(ax^2 + bx + c = a(x - x_1)(x - x_2)\).

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

Let us look at one example of each case. For \(2x^2 - x - 3\) we have \(\Delta = (-1)^2 - 4 \cdot 2 \cdot (-3) = 25\), so that \(x_1 = \frac{1 + 5}{4} = \frac{3}{2}\) and \(x_2 = \frac{1 - 5}{4} = -1\). Then \(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 \(2\) into the first factor. On the other hand, for \(x^2 + x + 1\) the discriminant is \(1 - 4 = -3 < 0\), and the trinomial is irreducible. The sum of squares \(x^2 + c^2\) from §4 is the case \(a = 1\), \(b = 0\), with \(\Delta = -4c^2 < 0\). Both irreducibilities thus have the same cause: in \(\mathbb{R}\) no square is negative.

When \(\Delta = 0\), the two numbers coincide, \(x_1 = x_2 = -\frac{b}{2a}\), and the trinomial is \(a(x - x_1)^2\), a perfect square multiplied by \(a\). Note also that \(x_1\) and \(x_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 \(ax^2 + bx + c = 0\).

Reminder. When factoring \(ax^2 + bx + c\), do not forget the leading coefficient: the result is \(a(x - x_1)(x - x_2)\), not \((x - x_1)(x - x_2)\). The sign of \(\Delta\) decides whether the trinomial factors over \(\mathbb{R}\).



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.