Polynomial
evaluator.
Type a polynomial and a value of x to get P(x), its slope there and its real roots.
- Slope at x = 4
- 11
- Real roots
- 3
- Horner steps
- 3 × and 3 +
Dividing P(x) by x − 4 leaves a remainder of 6. The curve is above the x-axis here and rising, with a slope of 11.
Graph with the tangent
Drag the point along the curvey = x³ − 6x² + 11x − 6 passes through (4, 6), where the dotted tangent has slope 11. It meets the x-axis at 1, 2, 3. Turning points: 1 high, 1 low.
Working
- 1Write P(x) in nested form((x − 6)·x + 11)·x − 6
- 2Bring down the leading coefficient1
- 3Multiply by 4, then add the next coefficient1 × 4 − 6 = −2
- 4Multiply by 4, then add the next coefficient−2 × 4 + 11 = 3
- 5Multiply by 4, then add the next coefficient3 × 4 − 6 = 6
- 6Check: work out each term and add them64 − 96 + 44 − 6 = 6
Horner table
| Coefficient | Carried × x | Running total |
|---|---|---|
| 1 | 0 | 1 |
| −6 | 4 | −2 |
| 11 | −8 | 3 |
| −6 | 12 | 6 |
Every total but the last is a coefficient of P(x) divided by x − 4. The last total is the remainder, P(4).
Values around your x
| x | P(x) | Sign |
|---|---|---|
| 0 | −6 | Negative |
| 1 | 0 | Zero |
| 2 | 0 | Zero |
| 3 | 0 | Zero |
| 4 | 6 | Positive |
| 5 | 24 | Positive |
| 6 | 60 | Positive |
| 7 | 120 | Positive |
| 8 | 210 | Positive |
A sign change between two rows means a root lies between them.
| # | x |
|---|---|
| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 |
P(x) for each x
| x | P(x) |
|---|---|
| −2 | −60 |
| −1 | −24 |
| 0 | −6 |
| 1 | 0 |
| 2 | 0 |
| 3 | 0 |
Coefficient list
Reads as P(x) = x³ − 6x² + 11x − 6
How it's worked out
Horner's method rewrites the polynomial as a nest, so you never build a power on its own. Start with the leading coefficient, the number on the highest power. Multiply by x, add the next coefficient, and repeat until the constant term is in.
A polynomial of degree n, where n is the highest power, takes n multiplications and n additions this way. Ostrowski and Pan proved that a general polynomial cannot be done in fewer. Fewer sums also leave less room for a slip when you work by hand.
MathWorld calls the same work synthetic substitution, because it is Horner's rule written as a synthetic division table. The running totals are the coefficients of P(x) divided by x minus your value, and the last total is the remainder. By the remainder theorem, that remainder is the value of P at your x.
The slope comes from the power rule, one term at a time, and Horner's method then evaluates that too. To check the answer, the tool also works out each term by itself and adds them.
Worked examples
Lin checks a quartic from her numerical methods class
Lin needs 2x⁴ − 3x² + 3x − 4 at x = −2. There is no cube term, so a 0 holds its place. The running totals are 2, −4, 5, −7, 10, so the value is 10 and the slope there is −49.
Adding the terms one at a time gives 32, −12, −6, −4, which also total 10. That took more multiplying, because each power had to be built first.
Sam tracks a ball thrown straight up
A ball leaves Sam's hand at 20 m/s from 1.5 m up, so its height in meters is −4.9t² + 20t + 1.5. Treat t, the seconds since the throw, as the x in the tool. At 3 seconds the ball is 17.4 m up, and the slope is its velocity: −9.4 m/s, so it is already falling.
The curve turns at 2.04 seconds, where the ball peaks at 21.91 m. The model ignores air drag, so read these as close estimates rather than exact heights.
Rae gets an exact fraction from a decimal
Rae evaluates x³ − 1 at 0.5 and wants the answer for her worksheet as a fraction. The exact value is −7 over 8, and as a decimal it is −0.875. The exact form works when the coefficients and x are decimals with up to 12 places.
Reading your result
A value of 0 means a root. If P at your x is 0, then x minus that number is a factor. Between 2 and 3, the curve of x³ − 6x² + 11x − 6 is −0.375 at 2.5, and it is 0 at both ends of that gap.
A sign change traps a root. For x³ − 7x + 6, the values at x = −4, −2, 0, 1.5, 3 are −30, 12, 6, −1.125, 12. The sign flips three times along that list, so three roots are trapped: −3, 1, 2.
The sign of the slope says which way the curve is going. Above 0 it rises, below 0 it falls, and at 0 it may turn. Not always, though: x³ has a slope of 0 at 0 and keeps climbing.
Listed roots are real and distinct. The search looks between the turning points, narrowing in on each crossing, and it also tests each turning point for a touch of the axis. For exact fractions, use the rational root theorem calculator.
Common mistakes
- Dropping a zero in the nest. Leave out the empty x cubed in a quartic and every later total is wrong. The maths field fills the gap for you, but on paper you need to write the 0.
- Treating −x² like (−x)². At x = 3, −x² is −9, because the power binds tighter than the minus sign. Type a bracket if you mean the other one.
- Reading a round decimal as exact. At 2 decimal places a small value can show as 0, so a value that rounds to 0 is not proof of a root. Switch to Exact, or raise the decimal places.
- Trusting a huge x. With x near a million and a high degree, the digits run past what a computer's decimal holds, and the last digits lose their meaning.