Polynomial Calculator
Evaluate a polynomial expression at a given value of x. Supports ax³ + bx² + cx + d form. Use this free math calculator for instant results. No signup.
Understanding Polynomials
A polynomial is an algebraic expression consisting of variables and coefficients, using only addition, subtraction, multiplication, and non-negative integer exponents. The general form of a degree-n polynomial: P(x) = aₙxⁿ + aₙ₋₁xⁿ⁻¹ + ... + a₁x + a₀. Our calculator handles cubic polynomials: P(x) = ax³ + bx² + cx + d.
Key terminology: degree = highest exponent with a non-zero coefficient (degree 3 = cubic). leading coefficient = coefficient of the highest-degree term. constant term = value when x=0 (the 'd' in our form). roots/zeros = values of x where P(x) = 0. The Fundamental Theorem of Algebra states that every degree-n polynomial has exactly n roots counting multiplicity (some may be complex).
Evaluating P(x) for a specific value of x is called function evaluation. For P(x) = x³ − 2x² + x at x=3: P(3) = 27 − 18 + 3 = 12. This calculator evaluates your polynomial at any x value instantly using Horner's method for computational efficiency.
Types of Polynomials by Degree
Polynomials are classified by their degree — the highest power of the variable. Each type has distinct properties:
| Degree | Name | General form | Roots | Graph shape |
|---|---|---|---|---|
| 0 | Constant | P(x) = d | None (unless d=0) | Horizontal line |
| 1 | Linear | P(x) = cx + d | 1 real root | Straight line |
| 2 | Quadratic | P(x) = bx² + cx + d | 0, 1, or 2 real roots | Parabola (U-shape) |
| 3 | Cubic | P(x) = ax³ + bx² + cx + d | 1, 2, or 3 real roots | S-shaped curve |
| 4 | Quartic | P(x) = ax⁴ + ... | 0 to 4 real roots | W or M shape |
| 5 | Quintic | P(x) = ax⁵ + ... | 1 to 5 real roots | Elongated S |
| n | Degree-n | P(x) = aₙxⁿ + ... | At most n real roots | Varies |
Quadratics (degree 2) are the most commonly solved analytically. The quadratic formula x = (−b ± √(b²−4ac)) / (2a) gives the roots explicitly. The discriminant b²−4ac determines root nature: positive → two distinct real roots; zero → one repeated real root; negative → two complex conjugate roots.
Cubics (degree 3, what this calculator uses) always have at least one real root, since complex roots come in conjugate pairs and 3 roots can't all be non-real. Cardano's formula (1545) provides an analytic solution for cubic roots, though it's rarely used manually due to its complexity. For quartics, Ferrari's method provides a solution. For degree 5 and above, no general algebraic formula exists (Abel-Ruffini theorem, 1824).
Evaluating Polynomials: Step-by-Step Examples
To evaluate P(x) = ax³ + bx² + cx + d at a given x, substitute and simplify:
| Polynomial P(x) | x value | Calculation | Result |
|---|---|---|---|
| x³ − 2x² + x | x = 3 | 27 − 18 + 3 + 0 | P(3) = 12 |
| x³ + 0x² + 0x − 8 | x = 2 | 8 + 0 + 0 − 8 | P(2) = 0 (root!) |
| 2x³ − 3x² + x − 5 | x = −1 | −2 − 3 − 1 − 5 | P(−1) = −11 |
| x³ − 6x² + 11x − 6 | x = 1 | 1 − 6 + 11 − 6 | P(1) = 0 (root!) |
| x³ − 6x² + 11x − 6 | x = 2 | 8 − 24 + 22 − 6 | P(2) = 0 (root!) |
| x³ − 6x² + 11x − 6 | x = 3 | 27 − 54 + 33 − 6 | P(3) = 0 (root!) |
The last three rows illustrate the Factor Theorem: if P(r) = 0, then (x−r) is a factor. Since x³ − 6x² + 11x − 6 equals zero at x=1, 2, and 3, we know it factors as (x−1)(x−2)(x−3). Expanding confirms: (x−1)(x−2)(x−3) = x³ − 6x² + 11x − 6. ✓
Horner's Method: Efficient Polynomial Evaluation
The naïve method of evaluating ax³ + bx² + cx + d requires computing x², x³, then multiplying by coefficients — a total of 5 multiplications and 3 additions. Horner's method restructures the polynomial to require only 3 multiplications and 3 additions, regardless of degree:
P(x) = ax³ + bx² + cx + d = ((ax + b)x + c)x + d
Evaluation at x=4 for P(x) = 2x³ − 3x² + x − 5:
- Start: 2
- Multiply by 4, add −3: 2×4 + (−3) = 5
- Multiply by 4, add 1: 5×4 + 1 = 21
- Multiply by 4, add −5: 21×4 + (−5) = 79
Result: P(4) = 79. Verify directly: 2(64) − 3(16) + 4 − 5 = 128 − 48 + 4 − 5 = 79 ✓
Horner's method is not just a computational shortcut — it forms the basis of synthetic division (a method for dividing polynomials by linear factors) and is the standard algorithm used in compilers and calculators for polynomial evaluation. For high-degree polynomials, the reduction from O(n²) to O(n) operations is significant.
Polynomial Operations: Addition, Subtraction, and Multiplication
Before evaluating polynomials, it helps to understand basic polynomial arithmetic:
Addition/Subtraction: Combine like terms (same degree). (3x² + 2x + 1) + (x² − x + 4) = 4x² + x + 5.
Multiplication: Each term in the first polynomial multiplies each term in the second, then like terms are combined. The classic FOIL method is a special case for two binomials:
(2x + 3)(x² − x + 2) = 2x³ − 2x² + 4x + 3x² − 3x + 6 = 2x³ + x² + x + 6
Division: Polynomial long division divides one polynomial by another. Synthetic division is a shortcut for dividing by a linear factor (x − r). By the Remainder Theorem, when P(x) is divided by (x − r), the remainder equals P(r) — the same value our calculator computes.
| Operation | Method | Key rule |
|---|---|---|
| Addition | Combine like terms | Degrees must match |
| Subtraction | Negate second, add | Distribute the minus sign |
| Multiplication | Distribute each term | Add exponents of like bases |
| Division | Long division or synthetic | Degree of quotient = deg(P) − deg(Q) |
Polynomials in Science, Engineering, and Interpolation
Polynomials are among the most versatile mathematical tools with applications across every scientific and engineering discipline.
Physics and engineering: Kinematic equations are polynomial in time. Position s(t) = s₀ + v₀t + ½at² is a quadratic polynomial in t. Cubic and higher-degree polynomials model more complex physical systems: projectile motion with air resistance, stress-strain relationships in materials, and circuit response curves.
Taylor and Maclaurin series: Any smooth (infinitely differentiable) function can be approximated as an infinite polynomial: sin(x) ≈ x − x³/6 + x⁵/120 − ... This is how calculators and computers evaluate transcendental functions — they use polynomial approximations accurate to machine precision. A cubic polynomial approximation of sin(x) is valid to within 0.1% for |x| < 0.5 radians.
Numerical interpolation: Given n+1 data points, there is a unique polynomial of degree ≤ n passing through all of them (Lagrange interpolation). This is used in numerical analysis, data compression, and signal processing. However, high-degree polynomial interpolation can suffer from Runge's phenomenon — wild oscillations between data points — which is why piecewise cubic splines (piecewise degree-3 polynomials joined smoothly) are used in practice.
Computer graphics: Bézier curves (used in fonts, vector graphics, and animation paths) are polynomial parametric curves. Cubic Bézier curves (degree 3) are the standard in SVG, PostScript/PDF, and CSS animations. They provide smooth, visually pleasing curves with four control points that designers can manipulate intuitively.
Finding Roots of Polynomials
A root (or zero) of a polynomial P(x) is a value r where P(r) = 0. Finding roots is one of the central problems in mathematics, with both analytic and numerical approaches:
- Linear (degree 1): cx + d = 0 → x = −d/c. Always exactly one root.
- Quadratic (degree 2): Use the quadratic formula. Discriminant determines 0, 1, or 2 real roots.
- Cubic (degree 3): Cardano's formula gives exact roots, but is complex. Depressed cubic substitution simplifies calculations. Always has at least 1 real root.
- Degree 5+: No general formula (Abel-Ruffini theorem). Use numerical methods: Newton-Raphson, bisection, Brent's method.
Newton-Raphson method for finding roots numerically: starting from an initial guess x₀, iterate: xₙ₊₁ = xₙ − P(xₙ)/P'(xₙ). Each iteration approximately doubles the number of correct decimal places (quadratic convergence). For our cubic P(x) = ax³ + bx² + cx + d, the derivative P'(x) = 3ax² + 2bx + c.
The Rational Root Theorem provides candidate rational roots for polynomials with integer coefficients: possible rational roots are ±(factors of d) / (factors of a). For x³ − 6x² + 11x − 6, possible rational roots are ±{1, 2, 3, 6} — testing each finds that 1, 2, and 3 are all roots.
Frequently Asked Questions
What is the degree of a polynomial?
The degree is the highest power of the variable with a non-zero coefficient. x³ + 2x − 1 has degree 3 (cubic). 5x² + x + 7 has degree 2 (quadratic). A non-zero constant like 4 has degree 0. The zero polynomial (all coefficients zero) has no degree (or degree −∞ by convention).
How many roots does a cubic polynomial have?
A cubic polynomial (degree 3) has exactly 3 roots counting multiplicity (Fundamental Theorem of Algebra). These may be: 3 distinct real roots; 1 real root + 2 complex conjugate roots; or 1 repeated real root + 1 simple real root. A cubic always has at least 1 real root, since complex roots come in conjugate pairs.
What is Horner's method?
Horner's method evaluates polynomials efficiently by nesting: ax³+bx²+cx+d = ((ax+b)x+c)x+d. This requires only 3 multiplications and 3 additions for a cubic, versus 6 multiplications naively. It's the standard algorithm for polynomial evaluation in computing and is equivalent to synthetic division.
What is the Remainder Theorem?
The Remainder Theorem states that when a polynomial P(x) is divided by (x−r), the remainder equals P(r). This means evaluating P(r) — exactly what our calculator does — is equivalent to finding the remainder of polynomial division by (x−r). If P(r) = 0, then (x−r) is a factor (the Factor Theorem).
How do you factor a cubic polynomial?
Find one root r using the Rational Root Theorem, Newton-Raphson, or inspection. Then divide P(x) by (x−r) using synthetic division to get a quadratic quotient. Solve the quadratic with the quadratic formula to find the remaining two roots. The factored form is a(x−r₁)(x−r₂)(x−r₃) where r₁, r₂, r₃ are the three roots.
What makes a polynomial "depressed"?
A depressed polynomial is one where the second-highest degree term has a zero coefficient. For a cubic ax³ + bx² + cx + d, substituting x = t − b/(3a) eliminates the x² term, creating a "depressed cubic" t³ + pt + q. Cardano's formula applies to depressed cubics. This substitution is the first step in analytically solving cubic equations.
Can you evaluate polynomials with complex numbers?
Yes. Polynomial evaluation P(x) works for complex x values using the same formula. This is important because the roots of polynomials are often complex. For a quadratic x² + 1 = 0, the roots are x = i and x = −i (where i = √(−1)), giving P(i) = i² + 1 = −1 + 1 = 0. Complex evaluation is fundamental to signal processing (z-transforms) and control theory.
What is a monic polynomial?
A monic polynomial has a leading coefficient of 1 (the coefficient of the highest-degree term is 1). For example, x³ − 5x + 6 is monic (a=1). Any polynomial can be made monic by dividing all coefficients by the leading coefficient. Monic polynomials are useful in algebra because their factored form is cleaner: (x−r₁)(x−r₂)(x−r₃).
Why can't polynomials of degree 5+ be solved with a formula?
The Abel-Ruffini theorem (1824, proved by Abel and partially by Ruffini) demonstrates that no general formula using arithmetic operations and radicals (square roots, cube roots, etc.) exists for polynomial equations of degree 5 or higher. Galois theory explains why: the symmetry group of a general quintic is not solvable. Some specific quintics can be solved (like x⁵ − 1 = 0), but no formula works for all quintics.
What is polynomial regression?
Polynomial regression fits a polynomial of specified degree to a set of data points by minimizing the sum of squared residuals (least squares). Degree-2 fits parabolas (useful for U-shaped trends), degree-3 fits cubic curves (for S-shaped or asymmetric trends). Caution: too high a degree causes overfitting — the polynomial passes through all points but oscillates wildly between them (Runge's phenomenon).
Practical Applications of Cubic Polynomials
Cubic polynomials (degree 3, the form this calculator evaluates) appear throughout science and engineering in ways that are not always obvious. Recognizing when a cubic model is appropriate — and knowing how to evaluate it quickly — is a practical skill in many technical fields.
Volume and geometry: The volume of a sphere is V = (4/3)πr³ — a cubic polynomial in r. The volume of a cube with side length s is simply s³. Many engineering volumes (tanks, vessels, molds) are described by cubic polynomial relationships between dimensions and capacity. If a cylindrical tank has a variable fill shape at the bottom, the volume as a function of height may follow a cubic polynomial derived from integration of the cross-sectional area.
Physics and kinematics: When air resistance is proportional to velocity squared, the position of a projectile becomes a third-degree polynomial in time in some models. The deflection of a non-uniform beam under distributed load is described by a fourth-order polynomial ODE, but its solution for specific cases reduces to cubic expressions. The relationship between stress and strain in certain non-linear elastic materials is modeled with cubic polynomials.
Economics and cost analysis: Total cost functions in microeconomics are often cubic: C(q) = aq³ + bq² + cq + d, where q is quantity produced. This cubic shape reflects economies of scale (decreasing marginal cost at first) followed by diminishing returns (increasing marginal cost at high output). The marginal cost function C'(q) = 3aq² + 2bq + c is quadratic, which is why economics courses spend significant time on the quadratic formula and its relationship to profit maximization.
Computer graphics and animation: Cubic splines and Bézier curves are piecewise cubic polynomials. Every smooth curve in a font file (TrueType, OpenType), a SVG illustration, a CSS animation path, or a 3D model consists of cubic polynomial segments joined end-to-end. The four control points of a cubic Bézier curve define a parametric cubic polynomial P(t) = (1−t)³P₀ + 3(1−t)²tP₁ + 3(1−t)t²P₂ + t³P₃ for t ∈ [0,1]. Evaluating this for many values of t traces the smooth curve rendered on screen.
Signal processing and filter design: Digital filters in audio processing, image processing, and communications often use polynomial approximations. A cubic interpolation filter smooths between discrete samples: given four sample values, a cubic polynomial is fit to the four points and evaluated at intermediate positions. This is how digital audio players produce smooth playback from discrete sample data, and how images are interpolated when resized.
The cubic polynomial form ax³ + bx² + cx + d is the mathematical sweet spot between simplicity and expressiveness. Linear and quadratic polynomials are often too simple to capture real-world complexity. Quartic and higher polynomials are often unnecessarily complex and prone to overfitting. The cubic polynomial, with its one inflection point and S-shaped curve, captures a remarkable range of natural phenomena — which explains its ubiquity across every quantitative field.