How to graph a cubic, quadratic, or linear polynomial
This calculator treats every input as the general cubic f(x) = ax³ + bx² + cx + d. Setting a coefficient to zero degrades the function automatically — a = 0 gives a quadratic bx² + cx + d, and a = b = 0 gives a line cx + d — so the same tool covers all three cases without a separate mode switch. It then computes the five features you need to sketch an accurate graph: the y-intercept, the real x-intercepts (roots), the local maximum/minimum points, the inflection point, and the end behavior as x → ±∞.
Finding the roots (x-intercepts)
For a genuine cubic (a ≠ 0), the calculator first divides by a and substitutes x = t − b/(3a) to remove the quadratic term, producing a depressed cubic t³ + pt + q = 0 with p = c/a − b²/(3a²) and q = 2b³/(27a³) − bc/(3a²) + d/a. The discriminant Δ = −4p³ − 27q² decides how many real roots exist: if Δ > 0 there are three distinct real roots, found with the trigonometric form of Cardano's formula t_k = 2√(−p/3)·cos[(1/3)arccos((3q/2p)√(−3/p)) − 2πk/3]; if Δ ≤ 0 there is exactly one real root, found with Cardano's radical formula t = ∛(−q/2 + √(q²/4 + p³/27)) + ∛(−q/2 − √(q²/4 + p³/27)). Each t is shifted back with x = t − b/(3a). When a = 0 the calculator instead applies the quadratic formula, and when a = b = 0 it solves the linear equation directly.
Finding local extrema, the inflection point, and end behavior
Local maxima and minima occur where the slope is zero, so the calculator solves f'(x) = 3ax² + 2bx + c = 0 with the quadratic formula. Each solution is classified using the second derivative f''(x) = 6ax + 2b: a negative value means the curve is concave down (a local maximum), a positive value means concave up (a local minimum). The single inflection point of a cubic — where concavity flips — solves f''(x) = 0, giving x = −b/(3a). Finally, end behavior follows from the sign and degree of the leading term: for a true cubic (a ≠ 0) the two ends of the graph point in opposite directions (up-right/down-left if a > 0, the reverse if a < 0); for a quadratic (a = 0, b ≠ 0) both ends point the same direction as the sign of b; for a line (a = b = 0) the graph rises or falls steadily according to the sign of c.
Common uses
Sketching polynomials by hand for algebra and precalculus homework, checking a hand-solved cubic before committing to a final graph, exploring how moving a coefficient shifts roots and turning points, and verifying factored forms — if you already suspect f(x) factors as a(x−r₁)(x−r₂)(x−r₃), the calculated roots let you confirm r₁, r₂, and r₃ directly.