Week 7 · Intermediate Algebra

7. Polynomial Operations

120 min

Before you start

  • Apply distribution with negative coefficients without sign errors
  • Combine like terms across an expression of up to eight terms
  • Recognize and use exponent notation for second and third powers
  • Track signs through subtraction of grouped expressions

By the end you'll be able to

  • Add, subtract, and multiply polynomials of degree up to four by hand
  • Apply FOIL fluently to any product of two binomials in under thirty seconds
  • Memorize and apply the perfect-square and difference-of-squares special products
  • Identify a polynomial's degree, leading coefficient, and standard form
  • Recognize sum-of-cubes and difference-of-cubes patterns

Polynomial Operations

A polynomial is a sum of terms of the form a⋅xna \cdot x^n where nn is a non-negative integer. The degree is the highest power; the leading coefficient is the coefficient of that term.

Adding and subtracting

Combine like terms: terms with the same variable raised to the same power.

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

When subtracting, distribute the negative to every term in the second polynomial:

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

The −- flips signs on x2x^2, −x-x, and 55.

Multiplying

Use the distributive property. For two binomials, FOIL is a useful mnemonic:

  • First: First terms of each binomial
  • Outer: Outer pair
  • Inner: Inner pair
  • Last: Last terms of each binomial

(x+3)(x+5)=x2+5x+3x+15=x2+8x+15(x + 3)(x + 5) = x^2 + 5x + 3x + 15 = x^2 + 8x + 15

For larger polynomials, use distribution systematically: every term in the first polynomial multiplied against every term in the second.

Special products (memorize these)

Pattern Expansion
(a+b)2(a + b)^2 a2+2ab+b2a^2 + 2ab + b^2
(a−b)2(a - b)^2 a2−2ab+b2a^2 - 2ab + b^2
(a+b)(a−b)(a + b)(a - b) a2−b2a^2 - b^2 (difference of squares)
(a+b)(a2−ab+b2)(a + b)(a^2 - ab + b^2) a3+b3a^3 + b^3 (sum of cubes)
(a−b)(a2+ab+b2)(a - b)(a^2 + ab + b^2) a3−b3a^3 - b^3 (difference of cubes)

The middle term in (a±b)2(a \pm b)^2 is the most common point of error: students forget the 2ab2ab and write a2+b2a^2 + b^2 instead.

Connection to ML

ML loss functions are polynomials in the parameters. Mean Squared Error is a degree-2 polynomial in each θj\theta_j. Polynomial regression uses degree-dd features (xx, x2x^2, xyxy, y2y^2, …). The characteristic polynomial of an n×nn \times n matrix is degree nn, and its roots are the matrix's eigenvalues. Polynomial fluency is the algebra layer beneath nearly every ML linear-algebra computation you'll do.

Common mistakes

These are the traps learners hit most often on this topic. Knowing them in advance is half the fix.

  • Forgetting the middle term of $(a + b)^2$

    (a+b)2=a2+2ab+b2(a + b)^2 = a^2 + 2ab + b^2, NOT a2+b2a^2 + b^2. The middle term comes from FOIL's outer + inner products. Same trap on (a−b)2(a - b)^2.

  • Combining unlike terms

    3x2+4x3x^2 + 4x can't be combined further: different powers. Only same-power terms merge.

  • Sign error in subtraction

    (4x2+3x)−(x2−5x)(4x^2 + 3x) - (x^2 - 5x) → distribute the negative: 4x2+3x−x2+5x4x^2 + 3x - x^2 + 5x =3x2+8x= 3x^2 + 8x. Forgetting to flip the sign on −5x-5x gives −2x-2x, wrong by 10x10x.

Practice problems

Try each on paper first. Click Show solution only after you've made a real attempt.

  1. Problem 1
    Expand: (x+4)(x−3)(x + 4)(x - 3).
    Show solution

    FOIL gives x2−3x+4x−12=x2+x−12x^2 - 3x + 4x - 12 = x^2 + x - 12.

  2. Problem 2
    Expand: (2x−5)2(2x - 5)^2.
    Show solution

    (2x)2−2(2x)(5)+52=4x2−20x+25(2x)^2 - 2(2x)(5) + 5^2 = 4x^2 - 20x + 25.

  3. Problem 3
    Expand: (3x+2)(3x−2)(3x + 2)(3x - 2).
    Show solution

    (3x)2−22=9x2−4(3x)^2 - 2^2 = 9x^2 - 4.

  4. Problem 4
    Subtract: (5x2+3x−7)−(2x2−4x+1)(5x^2 + 3x - 7) - (2x^2 - 4x + 1).
    Show solution

    5x2+3x−7−2x2+4x−1=3x2+7x−85x^2 + 3x - 7 - 2x^2 + 4x - 1 = 3x^2 + 7x - 8.

  5. Problem 5
    What is the degree of 7x4−2x7+3x27x^4 - 2x^7 + 3x^2?
    Show solution

    Highest power: 7. Degree 7, leading coefficient -2.

  6. Problem 6
    Multiply: (x+2)(x2−x+3)(x + 2)(x^2 - x + 3).
    Show solution

    x3−x2+3x+2x2−2x+6=x3+x2+x+6x^3 - x^2 + 3x + 2x^2 - 2x + 6 = x^3 + x^2 + x + 6.

  7. Problem 7
    Add: (3x3−x+5)+(x3+4x2−2x−1)(3x^3 - x + 5) + (x^3 + 4x^2 - 2x - 1).
    Show solution

    Combine like terms: 4x3+4x2−3x+44x^3 + 4x^2 - 3x + 4.

Practice quiz

  1. Question 1
    (x + 3)(x + 5) = ?
  2. Question 2
    (x - 4)² = ?
  3. Question 3
    (x + 2)(x - 2) = ?
  4. Question 4
    Degree of 3x⁴ - 2x² + 7?
  5. Question 5
    Expand: (2x - 3)(x + 4)
  6. Question 6
    Expand: (x + 1)(x² - x + 1)
  7. Question 7
    Subtract: (4x² + 3x - 2) - (x² - x + 5)
  8. Question 8
    What's the leading coefficient of 5 - 3x + 7x³ - x²?
  9. Question 9
    Adding polynomials: (3x² + 2x) + (x² - 5x) = ?
  10. Reflection 10
    Why are polynomial operations foundational for machine learning?

Week 7 recap

You added, subtracted, and multiplied polynomials by distribution and FOIL, drilled the special-product patterns (perfect squares, difference of squares, sum and difference of cubes), and identified degree and leading coefficients from arbitrary polynomial forms. Three trap families fell: the missing-middle-term trap (writing (a+b)^2 as a^2 + b^2), the unlike-terms trap (merging x^2 with x), and the forgot-to-flip trap (failing to distribute a minus across an entire polynomial). Each outcome supports next week's factoring work, where every pattern you expanded gets reversed: difference of squares becomes a factoring target, perfect-square trinomials get recognized backward, and standard-form ordering lets you spot the leading term that anchors any factoring strategy.

Coming next: Week 8, Factoring Strategies (GCF & Grouping)

Next week reverses direction: instead of expanding polynomials, you will factor them. You will pull out greatest common factors, recognize and factor difference of squares and perfect-square trinomials, and use grouping on four-term polynomials. Lesson 8 also includes a cumulative review covering weeks 5-7 (systems, matrices, and polynomial expansion).

Saved in your browser only: no account, no server.