Roots[lhs==rhs,var]
yields a disjunction of equations which represent the roots of a polynomial equation.
Roots
Roots[lhs==rhs,var]
yields a disjunction of equations which represent the roots of a polynomial equation.
Details and Options
- Roots uses Factor and Decompose in trying to find roots.
- You can find numerical values of the roots by applying N.
- Roots can take the following options:
-
Cubics True whether to generate explicit solutions for cubics EquatedTo Null expression to which the variable solved for should be equated Modulus 0 integer modulus Multiplicity 1 multiplicity in final list of solutions Quartics True whether to generate explicit solutions for quartics Using True subsidiary equations to be solved - Roots is generated when Solve and related functions cannot produce explicit solutions. Options are often given in such cases.
- Roots gives several identical equations when roots with multiplicity greater than one occur.
Examples
open all close allBasic Examples (1)
Scope (7)
Equation with exact numeric coefficients:
Roots[x ^ 4 - 2x ^ 2 - 7 == 0, x]Equation with symbolic coefficients:
Roots[x ^ 3 - 2a ^ 2 x + a ^ 3 == 0, x]General equations of degree five and higher cannot be solved in radicals:
Roots[x ^ 5 - 22x + 19 == 0, x]This equation of degree nine is solved in radicals using factorization and decomposition:
Roots[x ^ 9 - 5x ^ 6 + 5x ^ 3 - 1 == 0, x]An equation with inexact numeric coefficients:
Roots[x ^ 5 - 1.7x ^ 3 - 22.5x - 9.7 == 0, x]Multiple roots are repeated the corresponding number of times:
Roots[(x - a)(x - b) ^ 2(x - c) ^ 3 == 0, x]Find roots over the integers modulo 7:
Roots[x ^ 5 - 2x - 1 == 0, x, Modulus -> 7]Options (10)
Cubics (3)
By default Roots uses the general formulas for solving cubic equations in radicals:
Roots[x ^ 3 + 2 x ^ 2 + 3 x + 4 == 0, x]With Cubics->False, Roots does not use the general formulas for solving cubics in radicals:
Roots[x ^ 3 + 2 x ^ 2 + 3 x + 4 == 0, x, Cubics -> False]Solving this cubic equation in radicals does not require the general formulas:
Roots[x ^ 3 - 7 == 0, x, Cubics -> False]EquatedTo (1)
Modulus (1)
Multiplicity (1)
Quartics (3)
By default Roots uses the general formulas for solving quartic equations in radicals:
Roots[x ^ 4 + 2 x ^ 2 + 3 x + 4 == 0, x]//LastWith Quartics->False, Roots does not use the general formulas for solving quartics:
Roots[x ^ 4 + 2 x ^ 2 + 3 x + 4 == 0, x, Quartics -> False]Solving this quartic equation in radicals does not require the general formulas:
Roots[x ^ 4 - 7x ^ 2 + 5 == 0, x, Quartics -> False]Properties & Relations (5)
Solutions returned by Roots satisfy the equation:
f = x ^ 3 - 2x + 1;
Roots[f == 0, x]Use ToRules to convert equations returned by Roots to replacement rules:
f == 0 /. {ToRules[%]}Solve uses Roots to find solutions of univariate equations and returns replacement rules:
Solve[f == 0, x]Roots finds all complex solutions:
f = x ^ 6 + x ^ 4 - 10x ^ 2 + 8;
Roots[f == 0, x]Use Reduce to find solutions over specified domains:
Reduce[f == 0, x, Reals]Reduce[f == 0, x, Integers]Use FindInstance to find one solution:
FindInstance[f == 0, x]Use Solve or Reduce to find solutions of systems of multivariate equations:
Solve[x ^ 2 + y ^ 2 == 1 && 2x + 3y == 5, {x, y}]Reduce[x ^ 2 + y ^ 2 == 1 && 2x + 3y == 5, {x, y}]Use Reduce to find solutions of systems of equations and inequalities:
Reduce[x ^ 2 + y ^ 2 <= 1 && 2x + 3y == 1 / 2, {x, y}]Use NRoots to find numeric approximations of roots of a univariate equation:
NRoots[2x ^ 5 - 3x + 11 == 0, x]Tech Notes
Related Guides
History
Introduced in 1988 (1.0)
Text
Wolfram Research (1988), Roots, Wolfram Language function, https://reference.wolfram.com/language/ref/Roots.html.
CMS
Wolfram Language. 1988. "Roots." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/Roots.html.
APA
Wolfram Language. (1988). Roots. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Roots.html
BibTeX
@misc{reference.wolfram_2026_roots, author="Wolfram Research", title="{Roots}", year="1988", howpublished="\url{https://reference.wolfram.com/language/ref/Roots.html}", note=[Accessed: 13-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_roots, organization={Wolfram Research}, title={Roots}, year={1988}, url={https://reference.wolfram.com/language/ref/Roots.html}, note=[Accessed: 13-June-2026]}