Sub topic 2
Writing a polynomial in standard form
This chapter assumes you can evaluate expressions such as 3x² − 2 for a given x, do integer arithmetic with negative numbers, and read exponents like x³. The chapter defines the terms (coefficient, degree) it uses. Standard form is the format every later operation in this tutorial starts from and finishes in, so it is worth getting precise now.
What standard form means
A polynomial is a sum of terms. Each term is a number (the coefficient) times a variable raised to a whole-number power (the exponent). The polynomial is in standard form when two conditions hold:
- Like terms are combined, so each power of the variable appears at most once.
- The terms are written in descending order of degree, from the highest exponent down to the constant.
Here is an example that is not in standard form:
4x − 7 + 3x² − x³ + 2x
The two x terms (4x and 2x) are not combined, and the exponents jump around: 1, 0, 2, 3, 1. Combining 4x + 2x gives 6x. Sorting the powers from high to low gives:
−x³ + 3x² + 6x − 7
That is the standard form. The two forms describe the same function. For any value of x, both give the same number. Standard form changes only the presentation, which makes it easier to read and compare.
Anatomy of a polynomial in standard form
Once a polynomial is in standard form, you can read its key features directly.
| Feature | Meaning | In −x³ + 3x² + 6x − 7 |
|---|---|---|
| Degree | Highest exponent that has a nonzero coefficient | 3 |
| Leading term | The first term, the one with the highest power | −x³ |
| Leading coefficient | The coefficient of the leading term | −1 |
| Constant term | The term with no variable (exponent 0) | −7 |
The degree is defined by the highest power that survives combining. That is why you should combine like terms before you report a degree. The expression 3x² + 5x − 3x² looks like it has degree 2, but the x² terms cancel, leaving 5x, which has degree 1.
Reading terms correctly
Intermediate learners most often slip on the details of what a term looks like.
- A bare variable has exponent 1. The term x is 1·x¹, so its coefficient is 1. The term −x has coefficient −1.
- A constant has exponent 0. The number 9 is 9·x⁰, and its degree is 0.
- The sign belongs to the term that follows it. In 5 − 3x, the terms are +5 and −3x. When you reorder, the sign travels with its term: 5 − 3x becomes −3x + 5.
- Only whole-number exponents are allowed. A polynomial in x cannot contain 1/x (that is x⁻¹), √x (that is x^(1/2)), or 2ˣ (the variable is in the exponent).
| Expression | Polynomial? | Reason |
|---|---|---|
| 4x³ − x + 8 | Yes | Whole-number exponents 3, 1, 0 |
| 7 | Yes | A constant, degree 0 |
| 3x⁻² + 1 | No | Negative exponent |
| x + √x | No | Fractional exponent |
| 5/x | No | The variable is in the denominator |
A procedure that works every time
The procedure has four steps. Doing them in this order avoids most mistakes.
Here is a worked example with a cancellation. Put this expression in standard form:
9 + x² − 4x³ + 2x − x² + 3
- List the terms with their signs: +9, +x², −4x³, +2x, −x², +3.
- Group by exponent. Exponent 3: −4x³. Exponent 2: +x² and −x². Exponent 1: +2x. Exponent 0: +9 and +3.
- Add coefficients. Exponent 2: 1 + (−1) = 0. Exponent 0: 9 + 3 = 12.
- Drop the x² term, since its coefficient is 0, and sort.
The result is −4x³ + 2x + 12. The degree is 3 and the leading coefficient is −4. The x² term vanished completely, so you do not write 0x².
Missing powers and placeholder zeros
Standard form skips powers whose coefficient is zero. The polynomial x⁴ − 5 is written exactly that way, with no x³, x², or x terms.
Sometimes you need those gaps filled in. Long division of polynomials and coefficient lists in code both need every power present. In that case you write placeholder terms with coefficient 0:
x⁴ − 5 = x⁴ + 0x³ + 0x² + 0x − 5
The placeholders change nothing about the value. They only record that the coefficient of each of those powers is zero.
Doing it in code
The procedure translates directly into a short program. Each term is a pair (coefficient, exponent). The function adds up coefficients that share an exponent, discards zeros, and sorts by exponent from high to low. The helper to_string prints the result with the sign and coefficient conventions described above.
from collections import defaultdict
def standard_form(terms):
# terms is a list of (coefficient, exponent) pairs, in any order.
combined = defaultdict(int)
for coeff, exp in terms:
combined[exp] += coeff
kept = [(c, e) for e, c in combined.items() if c != 0]
return sorted(kept, key=lambda t: -t[1])
def to_string(terms):
if not terms:
return "0"
parts = []
for i, (c, e) in enumerate(terms):
mag = abs(c)
if e == 0:
body = str(mag)
else:
coeff = "" if mag == 1 else str(mag)
var = "x" if e == 1 else f"x^{e}"
body = coeff + var
if i == 0:
parts.append(("-" if c < 0 else "") + body)
else:
parts.append((" - " if c < 0 else " + ") + body)
return "".join(parts)
examples = [
[(5, 0), (-3, 1), (2, 3), (-1, 2), (4, 1)],
[(3, 2), (-3, 2), (7, 0)],
[(1, 3), (-8, 0)],
[(2, 1), (-2, 1)],
]
for terms in examples:
print(to_string(standard_form(terms)))The output is:
2x^3 - x^2 + x + 5
7
x^3 - 8
0The last example shows an edge case. If every term cancels, the result is the zero polynomial, which is written simply as 0. The zero polynomial has no leading term, and its degree is usually left undefined (some texts say −∞).
Polynomials with more than one variable
With more than one variable, "degree" needs a small extension. The degree of a single term is the sum of the exponents of all its variables. For example, 3xy² has degree 1 + 2 = 3. The degree of the polynomial is the largest term degree.
To write such a polynomial in standard form, pick one variable to order by, usually the first alphabetically, and put its exponents in descending order. Terms with the same power of that variable are then ordered by the next variable. For example:
3xy² + x³ − 2y + 4x²y
becomes
x³ + 4x²y + 3xy² − 2y
Here the powers of x run 3, 2, 1, 0. Two terms are like terms only if both the variables and their exponents match, so 4x²y and 3xy² are different terms even though both have degree 3. The rest of this tutorial works with a single variable, but this convention explains why you may see mixed-variable answers written in this order.
Common errors
- Reporting the degree too early. Combine like terms first. In 2x³ + x − 2x³, the degree is 1, not 3.
- Combining unlike terms. 3x² + 2x is not 5x³ or 5x². Only terms with identical variable parts combine, and only the coefficients are added. The exponent does not change.
- Losing an implied coefficient. Collecting x + x gives 2x. Treating the first x as having no coefficient gives the wrong sum. Think of each bare x as 1x.
- Reading the leading coefficient from an unsorted expression. In 7 + 2x − 5x², the leading coefficient is −5, not 7. It belongs to the highest power, wherever that term appears on the page.
- Writing zero-coefficient terms in the final answer. A term like 0x² is a placeholder. In a finished standard-form answer, leave it out.
Why this matters for what follows
Standard form earns its keep in the next chapters. When you add polynomials, writing both in standard form lines up like terms in columns. When you multiply, the answer is not finished until like terms are combined and sorted. When you predict a degree, you read it off the leading term. A habit of finishing every result in standard form makes answers easy to compare with a key and easy to check.
Exercise
Write 6 − x³ + 2x + x³ + 4x² − 5x in standard form. Then give its degree and its leading coefficient.
Show answer
Group by exponent. Exponent 3: −x³ + x³ = 0, so that term drops out. Exponent 2: 4x². Exponent 1: 2x − 5x = −3x. Exponent 0: 6. The standard form is 4x² − 3x + 6. The degree is 2 and the leading coefficient is 4. The original expression looks like degree 3, but the x³ terms cancel.
Exercise
Which of these is not a polynomial in x, and why? (a) 2x⁵ − 1, (b) 4x² + 3/x, (c) 0.5x + 7.
Show answer
(b) is not a polynomial. The term 3/x equals 3x⁻¹, which has a negative exponent. Expressions (a) and (c) have only whole-number exponents. Decimal coefficients such as 0.5 are fine.
Exercise
Write x⁴ − 5x + 2 with a placeholder term for every power from x⁴ down to the constant, then list its coefficients from highest power to lowest.
Show answer
x⁴ + 0x³ + 0x² − 5x + 2. The coefficient list from highest power to lowest is [1, 0, 0, −5, 2]. Written from the constant term upward, as in the code in the last chapter, the same list would be [2, −5, 0, 0, 1].
Exercise
Put 2y² + 3x²y − x³ + 5xy in standard form, ordering by powers of x from highest to lowest. State the degree of each term and of the whole polynomial.
Show answer
Standard form is −x³ + 3x²y + 5xy + 2y². Term degrees: x³ has degree 3, 3x²y has 2 + 1 = 3, 5xy has 1 + 1 = 2, 2y² has degree 2. The polynomial has degree 3, the largest term degree.