Skip to content
AI360Xpert
Beta

Polynomials and Factorization

A polynomial is a sum of powers, and factorization rewrites it as multiplied brackets, exposing every root at a glance. Taylor series, kernels and error surfaces are all polynomials in disguise.

A rectangle with sides x plus 2 and x plus 3 splits into areas x squared, 3x, 2x and 6, showing the factored and expanded forms are one shape
A rectangle with sides x plus 2 and x plus 3 splits into areas x squared, 3x, 2x and 6, showing the factored and expanded forms are one shape

Why Does This Exist?

Polynomials are the sums of powers that approximate everything smooth. Taylor series replace stranger functions with polynomials. Kernel features smuggle polynomial interactions into linear models. Splines stitch polynomial pieces into curves through data. And every one of these is easier to read in factored form, where the roots show instead of hide.

Factorization is the rewrite from added terms to multiplied brackets: x2+5x+6=(x+2)(x+3)x^2 + 5x + 6 = (x + 2)(x + 3). The left side hides its zeros; the right side announces them, x=−2x = -2 and x=−3x = -3. This page covers degrees, evaluation and the three factoring patterns that handle nearly everything. Approximation by polynomials graduates to Taylor series and approximation; fitting them through points is interpolation methods.

The one idea you need first. A product is zero exactly when some factor is zero. So a factored polynomial hands you its roots for free, one per bracket. Expanding multiplies the brackets back out; factoring runs the film backwards.

Think of It Like This

Breaking a number into prime boxes

6060 is opaque until written 2×2×3×52 \times 2 \times 3 \times 5: suddenly its divisors, its multiples and its structure are all visible. Nothing about the value changed, only the representation, and the factored form is the useful one.

Factoring a polynomial does the same to an expression. x2+5x+6x^2 + 5x + 6 is a pile of terms; (x+2)(x+3)(x + 2)(x + 3) is its prime boxes, each bracket a root waiting to be read. Multiplying back checks the work, just as 2×2×3×5=602 \times 2 \times 3 \times 5 = 60 checks the primes.

Where it stops: integers always factor into primes, while most polynomials do not factor over the rationals at all. The analogy shows the value of the form; the patterns below show when the form exists.

How It Actually Works

A polynomial adds terms akxka_k x^k. The degree is the highest power: 2x3−x+42x^3 - x + 4 has degree 3. The leading coefficient is its multiplier, 22. Evaluate by substitution, innermost powers first, or with nested Horner form for stability on high degrees.

Three patterns factor most of what appears. Greatest common factor first: 3x2+6x=3x(x+2)3x^2 + 6x = 3x(x + 2). Difference of squares: x2−9=(x−3)(x+3)x^2 - 9 = (x - 3)(x + 3). Trinomials x2+bx+cx^2 + bx + c: two numbers with sum bb and product cc, as in quadratic equations.

Worked example: factor, root, and verify at 10

Factor x2+5x+6x^2 + 5x + 6. Need sum 55, product 66: the numbers 22 and 33. So x2+5x+6=(x+2)(x+3)x^2 + 5x + 6 = (x + 2)(x + 3). Roots: x=−2x = -2 and x=−3x = -3.

Verify at x=10x = 10 both ways. Expanded: 100+50+6=156100 + 50 + 6 = 156. Factored: (12)(13)=156(12)(13) = 156. Both give 156156, and 12×13=15612 \times 13 = 156 is ordinary arithmetic confirming the algebra. The diagram above shows the same identity as one rectangle's area, computed two ways.

Code

import numpy as np
coeffs: list[float] = [1.0, 5.0, 6.0]  # x^2 + 5x + 6, highest power firstroots: np.ndarray = np.roots(coeffs)print(roots)  # -> [-3. -2.]print(10**2 + 5 * 10 + 6)  # -> 156print((10 + 2) * (10 + 3))  # -> 156

np.roots takes highest-power-first coefficients and returns the factored form's zeros directly. The last two prints are the two verifications agreeing at 156, the check that makes factoring trustworthy.

Watch Out For

Dropping the cross terms when expanding

(x+2)(x+3)(x + 2)(x + 3) is not x2+6x^2 + 6. Each term of the left bracket multiplies each term of the right: x2+3x+2x+6x^2 + 3x + 2x + 6, and the middle pair merges to 5x5x. The dropped 5x5x is the most common algebra slip in feature-cross derivations, and it changes every root.

Multiply term by term on small cases until it is automatic. Then verify by evaluating at one number, like the 156 above, which catches the slip instantly.

Assuming every polynomial factors nicely

x2+x+1x^2 + x + 1 has no real roots and no real factorization; over the integers most polynomials are prime-like. Code that pattern-matches brackets onto unfactorable expressions produces confident nonsense, and students burn hours hunting factors that provably do not exist.

Check the discriminant first for quadratics. For higher degrees, reach for numerical roots instead of exact brackets.

The Quick Version

  • Degree is the highest power; leading coefficient multiplies it; evaluate by substitution.
  • Factor out the greatest common factor first, then try squares-difference and sum-product patterns.
  • x2+5x+6=(x+2)(x+3)x^2 + 5x + 6 = (x + 2)(x + 3) with roots −2-2 and −3-3; both forms give 156 at x=10x = 10.
  • Expanding multiplies every term by every term; the cross terms merge, never vanish.
  • No real roots means no real factorization: check before hunting brackets.