Skip to content

PolynomialRoot ​

The kk-th root of the polynomial pp in its one unknown, in Wolfram's order: real roots first, increasing, then complex roots by real part and imaginary part. Wolfram's Root; compute-engine's Root is the nn-th root.

PolynomialRoot(p, k)the kk-th root of pp, exact: rational and quadratic roots are written as radicals, others stay a name for the root
Typed signatures
TypePackageApplies
(any, integer) -> numbernumber-theoryalways

Domain: Number theory

Details
  • A root of degree 3 or more stays PolynomialRoot(p, k), an exact algebraic number that MinimalPolynomial, NumberFieldDiscriminant and the other number-field heads read
  • Roots of a reducible pp are left unevaluated rather than reduced to a factor's

Examples

Basic #

the first root of x2+x+1x^2 + x + 1 is the one with negative imaginary part, (−1−i3)/2(-1 - i\sqrt 3)/2

live ↗
InPolynomialRoot(x2+x+1,1)\mathrm{PolynomialRoot}(x^2+x+1, 1)Out12(−3i−1)\frac{1}{2}(-\sqrt{3}i-1)

real roots come in increasing order: −2-\sqrt 2 first

live ↗
InPolynomialRoot(x2−2,1)\mathrm{PolynomialRoot}(x^2-2, 1)Out−2-\sqrt{2}

a cubic's root is its own name

live ↗
InPolynomialRoot(x3−x2−2x−8,1)\mathrm{PolynomialRoot}(x^3-x^2-2x-8, 1)OutPolynomialRoot(x3−x2−2x−8,1)\mathrm{PolynomialRoot}(x^3-x^2-2x-8, 1)
About
Examples3
Checked againstWolfram Language 2 agree1 differ

Implementation

primitive · kernela kernel — an algorithm over mutable state that would not be readable as a tree

nativeenginetypescriptpackages/ce-patches/src/compute-engine/library/algebraic-numbers.ts
mappedwolframpackages/oracle/src/mappings.ts

Wolfram's Root, which compute-engine's nth-root Root would shadow.

See also: MinimalPolynomial, NumberFieldIntegralBasis, Root