Learning Objectives
By the end of this section you will be able to:
- Recognise a polynomial the moment you see one — and explain why only non-negative integer exponents are allowed.
- Predict the end behaviour of a polynomial in two seconds, using only the degree and the leading sign .
- Count the maximum possible real roots () and turning points () from the degree alone.
- Read a polynomial in factored form and tell whether each root makes the curve cross, kiss, or flex through the x-axis.
- Evaluate a polynomial in two ways in Python and PyTorch, and explain why Horner's method is what every numerical library actually uses.
The Problem Polynomials Solve
You already know two extreme kinds of functions. Constant functions are rigid — they refuse to change. Linear functions change at a fixed rate. Real systems do neither: a thrown ball speeds up as it falls, a population grows in spurts, the area of a square scales faster than its side length. We need a family of functions that
- is rich enough to bend — multiple times, in either direction,
- but is still built entirely from the four arithmetic operations you can do by hand: addition, subtraction, multiplication by a constant, and raising to a positive integer power,
- so that every machine, every spreadsheet, every CPU can evaluate it exactly without ever needing to call
exporsin.
That family is the polynomials. They are the workhorse of applied mathematics: linear regression's big brother, the carrier of Taylor approximation (Chapter 13), the bones of every spline used in graphics and CAD, the "safe" non-linearity in classical control theory. If a function can be drawn with a single unbroken pen-stroke that never grows infinitely fast, a polynomial of high enough degree can match it as closely as you like (Weierstrass, 1885).
Intuition. Think of the degree as a bend budget. A line cannot bend (). A parabola can bend once (). A cubic can bend twice. The higher goes, the more turns the curve can make — but never more than .
What Counts as a Polynomial
A polynomial in a single variable is any expression of the form
where the coefficients are real (or complex) constants, the leading coefficient , and the exponents are non-negative integers. The largest exponent that appears with a non-zero coefficient is the degree .
| Expression | Polynomial? | Why |
|---|---|---|
| 7 | Yes — degree 0 | Constant. a_0 = 7. |
| 3x − 1 | Yes — degree 1 | Linear. Coefficients: a_0 = −1, a_1 = 3. |
| x² + 5x + 6 | Yes — degree 2 | Quadratic. |
| x⁴ − 4x² + 2 | Yes — degree 4 | All exponents are non-negative integers. |
| x³ − 3x | Yes — degree 3 | Our running example. |
| √x + 2 | No | Exponent 1/2 is not an integer. |
| 1/(x² − 1) | No | Negative exponent hidden in the denominator. |
| sin(x) | No | Transcendental — no finite polynomial equals sin. |
| e^x − x³ | No | e^x is not a polynomial; sums with one bad term stay bad. |
Anatomy: Degree, Leading Term, Constant
Every polynomial has three landmarks worth naming:
- The degree — the highest exponent. It controls everything important: how the curve flies off at the edges, how many roots and turning points it can have, and how fast it grows.
- The leading coefficient — the multiplier on the highest-degree term. Its sign decides whether the tails point up or down. Its magnitude is the eventual growth rate of the curve.
- The constant term — the y-intercept: , because every with dies at .
Interactive — Shape Explorer
Below is a polynomial up to degree five whose every coefficient is on a slider. Try this experiment first: pick the cubic preset , then sweep from to . You will see the curve flip vertically — that single sign change rewrites both tails. Then sweep : the whole curve slides up and down without changing shape. The middle coefficients dent and ripple the curve, but the tails refuse to budge.
What to notice. Red dots mark real roots — places where . Amber dots mark turning points — places where the curve momentarily stops going up (or stops going down) and reverses. The widget recomputes both every time you move a slider; the counts honour the bend budget .
End Behavior — The Tails Tell the Truth
Why does the leading term own the tails? Because for large , every other term is dwarfed:
Each correction goes to zero because the denominator blows up. So for large the polynomial behaves exactly like . That gives the four-way rule:
| Degree parity | Leading sign | As x → −∞ | As x → +∞ | Shape memory |
|---|---|---|---|---|
| even (2, 4, 6, …) | a_n > 0 | +∞ | +∞ | bowl — both tails up |
| even (2, 4, 6, …) | a_n < 0 | −∞ | −∞ | umbrella — both tails down |
| odd (1, 3, 5, …) | a_n > 0 | −∞ | +∞ | rising S — left down, right up |
| odd (1, 3, 5, …) | a_n < 0 | +∞ | −∞ | falling S — left up, right down |
Roots: Where the Curve Crosses Zero
A root (or zero) of is any number for which . Visually it is exactly where the curve meets the x-axis. Two truths govern them, and almost everything else about polynomials follows from these two.
The Fundamental Theorem of Algebra (1799, Gauss)
Every polynomial of degree has exactly roots in the complex numbers, counted with multiplicity. Some of those roots may be real (you see them as x-axis crossings); others may be complex conjugate pairs (you only see them as "something is missing" in the graph).
Consequence over the real numbers: a real polynomial of degree has at most real roots. If is odd, it has at least one real root, because the tails point to opposite infinities and the curve is continuous — it has to cross zero on the way.
So the root-count is bounded by the degree:
| Degree n | Possible numbers of real roots | Always has ≥ 1 real root? |
|---|---|---|
| 1 | 1 | Yes |
| 2 | 0, 1, or 2 | No (e.g. x² + 1 has no real root) |
| 3 | 1, 2, or 3 | Yes |
| 4 | 0, 1, 2, 3, or 4 | No |
| 5 | 1, 2, 3, 4, or 5 | Yes |
| n (even) | 0 to n | No |
| n (odd) | 1 to n | Yes |
Factored Form & Multiplicity
Whenever we have all the real roots , we can rebuild the polynomial as a product:
where is the multiplicity of root — how many times that linear factor appears. The multiplicities have to add up to the degree: .
Why multiplicity matters geometrically. Near a root , the polynomial behaves like for some constant . The function tells you exactly how the curve approaches zero:
- m = 1 (simple root): changes sign when passes through , so changes sign — the curve crosses the x-axis transversally, like a line.
- m = 2 (double root): on both sides, so does not change sign — the curve touches the axis and bounces back, like a parabola at its vertex.
- m = 3 (triple root): changes sign but with zero slope — the curve flexes through the axis with a horizontal tangent, like a cubic at the origin.
- Even multiplicities → touch and bounce. Odd multiplicities → cross.
Turning Points — The Bend Budget
A turning point (a local maximum or local minimum) is a place where the curve briefly stops climbing and starts falling, or vice-versa. Between every two distinct real roots of a smooth function, there has to be at least one turning point — otherwise the curve could not get back to zero. So once you know how many roots a polynomial has, you already know a lower bound on its turning points.
The upper bound comes from a fact you will prove in Chapter 4: the turning points of are exactly the real roots of its derivative . If has degree , then has degree , and by the fundamental theorem can have at most real roots. That is the famous bend budget:
A line has 0 turning points. A parabola has exactly 1. A cubic has 0 or 2 (never just one — they come in pairs of local-max/local-min, or the inflection swallows both). A quartic has 1 or 3. Open the explorer above, switch to degree 5, and try to make a curve with exactly 4 turning points — you can; with 5 — you cannot.
Worked Example —
Let us put every idea above to work on a single cubic. Read first, then open the foldout and finish it with pen and paper before looking at the answers.
Click to expand — hand-trace the cubic step by step
Step 1 — Read off the anatomy.
- Degree: (the highest exponent).
- Leading coefficient: .
- Constant term: , so the curve passes through the origin: .
Step 2 — Predict the tails. Degree is odd, leading sign is positive, so the curve drops from on the left and rises to on the right — a rising S.
Step 3 — Find the roots. Factor out the common :
Three real roots, each with multiplicity one: . The curve crosses the x-axis transversally at all three.
Step 4 — Count and locate the turning points. Differentiate (rule preview from Chapter 4 — multiply by the exponent, drop the exponent by one):
Set : , so . That gives exactly two turning points (the maximum allowed for a cubic), at and .
Step 5 — Classify each turning point. Plug in:
- . Coming from the left the curve rises and at this point reverses — this is a local maximum at .
- . The curve falls past zero, bottoms out here, then climbs — this is a local minimum at .
Step 6 — Sketch the silhouette. Connect the dots: come up from on the far left, cross zero at , peak at , fall through the origin, bottom at , cross zero at , rise to on the right. Compare with the interactive widget above — it is the same picture.
Step 7 — Sanity-check by plugging numbers in.
| x | p(x) by hand | Interpretation |
|---|---|---|
| −2 | (−2)³ − 3(−2) = −8 + 6 = −2 | below axis (tail diving) |
| −√3 | 0 | left root (crossing) |
| −1 | −1 + 3 = 2 | local maximum |
| 0 | 0 | middle root (crossing) |
| 1 | 1 − 3 = −2 | local minimum |
| √3 | 0 | right root (crossing) |
| 2 | 8 − 6 = 2 | above axis (tail rising) |
Every entry agrees with the silhouette. The polynomial is fully understood with no machinery beyond arithmetic and a single derivative.
Python: Evaluate by Hand vs. Horner's Method
Translating the hand-trace into code does two things. First, it cements the convention you will see in every library: coefficients live in a vector indexed by exponent. Second, it reveals why nobody actually evaluates a polynomial by summing in production — Horner's method is faster and more numerically stable for free.
numpy.polynomial, SciPy, PyTorch's internal kernels — uses Horner or a close cousin (Estrin's scheme for vectorisation).PyTorch: Polynomials as Vectorised Tensors
The same algorithm scales straight to a tensor. The reason this matters is that polynomials are everywhere in modern machine learning — feature transforms, positional encodings, Chebyshev approximations, the polynomial activation layers explored in Kolmogorov-Arnold Networks (KANs). All of them rely on evaluating one polynomial at many points, fast.
poly_horner is a differentiable PyTorch op, you can compute with torch.autograd for free. That is exactly how a linear regression with polynomial features works — the model learns the coefficient vector by gradient descent on . You will revisit this in Chapter 4.Where Polynomials Show Up in the Real World
- Physics — projectile motion. Height as a function of time is the quadratic . The single root in is the landing time; the unique turning point is the apex. A degree-2 polynomial captures the entire flight.
- Economics — cost & revenue curves. Total cost of producing units is often modelled as : a fixed cost plus marginal costs that rise nonlinearly. Roots of marginal cost (the derivative) give the production sweet spots.
- Computer graphics — Bézier splines. Every curve in a font, every path in an SVG, every CAD surface is a piecewise polynomial. The smoothness you feel in fonts is built into the fact that consecutive cubic Bézier pieces agree on value and first derivative at their seams.
- Numerical analysis — Taylor approximation. Any well-behaved function can be approximated, near a point, by a polynomial whose coefficients are the function's derivatives at that point. Polynomials are the universal "local" language of smooth functions — Chapter 13 turns this into a precise theorem.
- Machine learning — polynomial features.
sklearn.preprocessing.PolynomialFeaturessimply maps so that a linear model can fit polynomial relationships. The bend budget you learned today is the same bend budget that controls how much such a model can overfit.
Common Pitfalls
numpy.poly1d takes coefficients highest power first, while numpy.polynomial.Polynomial takes them lowest first. Always double-check; a reversed list silently produces a totally different curve.Summary
- A polynomial is a finite sum with and non-negative integer exponents.
- The degree caps the number of real roots () and turning points () — your bend budget.
- The leading term owns the tails: parity of + sign of fully determines end behaviour.
- In factored form, the multiplicity of a root tells you whether the curve crosses (odd), bounces (even-2), or flexes (odd-≥3) the x-axis.
- Horner's method is the production algorithm for evaluating polynomials — fewer multiplications, better numerical stability, and identical structure on a CPU loop or a GPU tensor kernel.
Polynomials are the language a calculator can speak fluently. They are also the language in which limits, derivatives, integrals, and Taylor expansion all begin. Master their shape — degree, leading term, roots, multiplicity, turning points — and the next ten chapters will feel like reading prose instead of decoding hieroglyphs.