Skip to content

Root ​

The nth root of x: xn=x1/n\sqrt[n]{x} = x^{1/n}.

Root(x, n)the nth root xn=x1/n\sqrt[n]{x} = x^{1/n}.
SageMathreal_nth_root(x, n)SymPyreal_root(x, n)Juliaenumeratio_root(x, n)
Typed signatures
TypePackageApplies
(complex | infinity, complex | infinity) -> numbercompute-enginealways

Domain: Arithmetic

Details
  • The nth root: Root(x,n)=x1/n\mathrm{Root}(x, n) = x^{1/n}. See Sqrt for the special case n=2n = 2.
  • Odd roots of a negative number stay real: −83=−2\sqrt[3]{-8} = -2. Even roots of a negative number canonicalize toward Sqrt instead, and evaluate exactly only when the radicand is itself a perfect power.
  • A negative index gives the reciprocal root: Root(x,−n)=x−1/n\mathrm{Root}(x, -n) = x^{-1/n}.
  • Both arguments are required -- unlike Sqrt, there's no default index.
  • Evaluates exactly only when x is a perfect nth power; otherwise it stays in symbolic form, like 23\sqrt[3]{2}.

Plot

ComplexPlot
real slice

Examples

Basic #

The cube root of 27

live ↗
In273\sqrt[3]{27}Out33
live ↗
In164\sqrt[4]{16}Out22

Odd roots of a negative number stay real

live ↗
In−83\sqrt[3]{-8}Out−2-2

Stays symbolic when x isn't a perfect power

live ↗
In23\sqrt[3]{2}Out23\sqrt[3]{2}

A negative index gives the reciprocal root: x−1/nx^{-1/n}

live ↗
In16−2\sqrt[-2]{16}Out14\frac{1}{4}
Scope #

The real cube root, Wolfram's Surd[−27,3]\mathrm{Surd}[-27, 3]

live ↗
In−273\sqrt[3]{-27}Out−3-3

Any odd root of a negative number is real

live ↗
In−325\sqrt[5]{-32}Out−2-2

Approximate negative radicands stay real too

live ↗
In−3.55\sqrt[5]{-3.5}Out−1.284 735 157 123 439 338 68-1.284\,735\,157\,123\,439\,338\,68

Threads element-wise over a list

live ↗
In[−8,27]3\sqrt[3]{\bigl\lbrack-8, 27\bigr\rbrack}Out[−2,3]\bigl\lbrack-2, 3\bigr\rbrack
Applications #

The edge length of a cube with volume 1000

live ↗
In1 0003\sqrt[3]{1\,000}Out1010
Properties #

(xn)n=x(\sqrt[n]{x})^n = x for a perfect nth power

live ↗
In833=8\sqrt[3]{8}^3=8OutTrue\mathrm{True}

Root(x, 2) agrees with Sqrt

live ↗
In16=16\sqrt{16}=\sqrt{16}OutTrue\mathrm{True}
Possible issues #

An even root of a negative, non-perfect-power number canonicalizes to Sqrt and stays symbolic; numerically it's 22 i2\sqrt{2}\,i

live ↗
In−8\sqrt{-8}Out−8\sqrt{-8}
About
Examples13
Checked againstWolfram Language 8 agree5 differSageMath 12 agree1 errorSymPy 13 agreempmath 13 agreeJulia 13 agree
CrosswalkWikipediaMathWorldWikidataBritannicaSageMathSymPyJulia

Implementation

mappedmpmathpackages/oracle/src/mappings.ts

An odd root of a negative real is the real one, as ours; mpmath's root is the principal root.

mappedsagepackages/oracle/src/mappings.ts
mappedjuliapackages/oracle/src/mappings.ts
mappedsympypackages/oracle/src/mappings.ts

See also: Sqrt, Square