Skip to content
🛠️ToolsShed

Polynomial Solver

Solve linear, quadratic, and cubic polynomial equations with step-by-step solutions.

About this tool

A polynomial equation is a mathematical statement involving variables raised to non-negative integer powers. Solving these equations is fundamental to algebra, calculus, and applied sciences. This tool handles linear (degree 1), quadratic (degree 2), and cubic (degree 3) polynomials, providing exact algebraic solutions using time-tested formulas like the quadratic formula for degree 2 and Cardano's method for degree 3 equations.

To use this solver, select the polynomial degree, enter your coefficients, and click Solve. The tool displays all roots—both real and complex—along with detailed step-by-step calculations so you can follow the mathematical reasoning. It is invaluable for algebra homework, verifying hand calculations, preparing for exams, and understanding the methods behind polynomial solution techniques.

Keep in mind that for degree 1 and 2, solutions are exact; for degree 3, small rounding errors may appear due to numerical computation, though they are typically negligible. All calculations run locally in your browser, ensuring your data remains private. This solver is perfect for students, educators, and anyone needing quick, reliable polynomial solutions.

Frequently Asked Questions

Code Implementation

import numpy as np

def solve_polynomial(coefficients: list[float]) -> list[complex]:
    """
    Solve polynomial given coefficients [a_n, ..., a_1, a_0].
    E.g., [1, -3, 2] represents x^2 - 3x + 2
    """
    roots = np.roots(coefficients)
    return roots.tolist()

# x^2 - 3x + 2 = 0  ->  roots: 2.0, 1.0
coeffs = [1, -3, 2]
roots = solve_polynomial(coeffs)
for r in roots:
    print(f"x = {r.real:.6f}" if r.imag == 0 else f"x = {r.real:.4f} + {r.imag:.4f}i")

# x^3 - 6x^2 + 11x - 6 = 0  ->  roots: 3, 2, 1
coeffs2 = [1, -6, 11, -6]
print(np.roots(coeffs2))  # [3. 2. 1.]

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.