root - Maple Programming Help

root

nth root of an algebraic expression

Calling Sequence

 root(x, n) root[n](x) ${\mathrm{root}}_{n}\left(x\right)$ root(x, n, symbolic) root[n](x, symbolic) ${\mathrm{root}}_{n}\left(x,\mathrm{symbolic}\right)$

Parameters

 x - any algebraic expression n - positive integer

Description

 • The function root computes an nth root of x where x can be:
 - A real or complex floating-point constant, for example, 2.0 or 2.0+0.5*I
 - An integer or complex rational constant, for example, 8 or 2+I/2
 - A general symbolic expression, for example, b, -8*a^4*y, or ln(1+x)
 • If x is a real or complex floating-point constant, the root is computed in floating-point arithmetic. Otherwise, the root function tries to simplify x^(1/n). If no simplifications can be made, the power x^(1/n) is simply returned.
 • You can enter the command root using any of the equivalent calling sequences.
 • root(x,n) represents the "principal root", defined by the formula root(x,n) = exp(1/n * ln(x))
 • For example, the three roots of y^3+8=0 are -2, 1+I*sqrt(3), and 1-I*sqrt(3). Thus root(-8.0,3) returns 1.000000000 + 1.732050808 I, not the real number -2.0. See surd if you want the real nth root of a real number.
 • For fractional powers of rational constants, that is, radicals a^(n/d) and (a/b)^(n/d) where a, b, n, d are integers, Maple automatically writes them in a canonical form as fractional powers of integers by applying the following transformations

 (1) ${a}^{\frac{n}{d}}={a}^{qd+\frac{r}{d}}$ ==> ${a}^{q}{a}^{\frac{r}{d}}$ where $0$<$r$<$d$ (2) ${\left(\frac{a}{b}\right)}^{\frac{n}{d}}$ ==> ${a}^{\frac{n}{d}}{b}^{-\frac{n}{d}}$ where $b$>$0$, $d$>$0$

 For example, 3^(5/2) ==> 3^(2+1/2) ==> 3^2*3^(1/2) ==> 9*3^(1/2) and (5/3)^(1/2) ==> 5^(1/2)*3^(-1/2) ==> 5^(1/2)*3^(1/2)/3. The root function does transformation (1) and the following transformations

 (4) ${\mathrm{root}}_{n}\left(\frac{a}{b}\right)$ ==> $\frac{{\mathrm{root}}_{n}\left(a{b}^{n-1}\right)}{b}$ (5) ${\mathrm{root}}_{n}\left(-a\right)$ ==> ${\left(-1\right)}^{\frac{1}{n}}{\mathrm{root}}_{n}\left(a\right)$ (6) ${\mathrm{root}}_{n}\left({p}^{n}a\right)$ ==> $p{\mathrm{root}}_{n}\left(a\right)$ for prime $p$<$150$ (7) ${\mathrm{root}}_{n}\left({a}^{n}\right)$ ==> $a$ where $a$>$0$

 For example, root[3](-8) ==> 2*(-1)^(1/3) and root[3](24/5) ==> root[3](24*5^2)/5 ==> 2*root[3](3*5^2)/5 ==> 2/5*75^(1/3). Note that no attempt is made to factor the input integer x.
 • For symbolic expressions, a number of simplifications are attempted. The main one is:

 (8) ${\mathrm{root}}_{n}\left({a}^{n}b\right)$ ==> $a{\mathrm{root}}_{n}\left(b\right)$ if $\mathrm{signum}\left(a\right)=1$, and (9) ${\mathrm{root}}_{n}\left({a}^{n}b\right)$ ==> $-a{\mathrm{root}}_{n}\left({\left(-1\right)}^{n}b\right)$ if $\mathrm{signum}\left(a\right)=-1$

 where n is a positive integer and the condition signum(a)=1 means a is provably real and positive. Similar simplifications are made for negative powers. These simplifications are only made for explicit integer powers appearing in x. No attempt to factor the input x is made. See RootFinding[Isolate] if you want the real roots (zeros) of a univariate polynomial.
 • Note: Maple does not simplify root[n](x^n) to x. This is wrong for general x. Maple returns (x^n)^(1/n).  Sometimes, because of the context of your work, you know that this transformation is valid.  If the symbolic option is specified, and signum(x) is not known, then the command root applies transformation (8), effectively assuming that a is positive. It is also possible to force the root function to make a simplification by making the appropriate assumption, for example, assume(a>0).

Examples Using root

 > root(3.0,3);
 ${1.442249570}$ (1)
 > root[3](3.0);
 ${1.442249570}$ (2)
 > root(3,3);
 ${{3}}^{{1}{/}{3}}$ (3)
 > root(8,3);
 ${2}$ (4)
 > root[3](8);
 ${2}$ (5)
 > root(24,3);
 ${2}{}{{3}}^{{1}{/}{3}}$ (6)
 > root(-8,3);
 ${2}{}{\left({-}{1}\right)}^{{1}{/}{3}}$ (7)
 > root(-8.0,3);
 ${1.000000000}{+}{1.732050807}{}{I}$ (8)
 > root[3](3+4*I);
 ${\left({3}{+}{4}{}{I}\right)}^{{1}{/}{3}}$ (9)
 > root[3](3.0+4.0*I);
 ${1.628937146}{+}{0.5201745022}{}{I}$ (10)
 > root[3](x);
 ${{x}}^{{1}{/}{3}}$ (11)
 > root[3](16*x^3*y);
 ${2}{}{{2}}^{{1}{/}{3}}{}{\left({{x}}^{{3}}{}{y}\right)}^{{1}{/}{3}}$ (12)
 > root[4](-16*x^4*y);
 ${2}{}{\left({-}{{x}}^{{4}}{}{y}\right)}^{{1}{/}{4}}$ (13)
 > root[3](16*x^3*y,symbolic);
 ${2}{}{x}{}{{2}}^{{1}{/}{3}}{}{{y}}^{{1}{/}{3}}$ (14)
 > root[4](-16*x^4*y,symbolic);
 ${2}{}{x}{}{\left({-}{y}\right)}^{{1}{/}{4}}$ (15)
 > assume(x>0);
 > root[3](16*x^3*y);
 ${2}{}{\mathrm{x~}}{}{{2}}^{{1}{/}{3}}{}{{y}}^{{1}{/}{3}}$ (16)
 > root[4](-16*x^4*y);
 ${2}{}{\mathrm{x~}}{}{\left({-}{y}\right)}^{{1}{/}{4}}$ (17)
 > assume(x<0);
 > root[3](16*x^3*y);
 ${-}{2}{}{\mathrm{x~}}{}{\left({-}{2}{}{y}\right)}^{{1}{/}{3}}$ (18)
 > root[4](-16*x^4*y);
 ${-}{2}{}{\mathrm{x~}}{}{\left({-}{y}\right)}^{{1}{/}{4}}$ (19)
 > root[4]((x-1)^4*y);
 $\left({-}{\mathrm{x~}}{+}{1}\right){}{{y}}^{{1}{/}{4}}$ (20)
 > f := expand( (x-1)^3 );
 ${f}{:=}{{\mathrm{x~}}}^{{3}}{-}{3}{}{{\mathrm{x~}}}^{{2}}{+}{3}{}{\mathrm{x~}}{-}{1}$ (21)
 > root[3](f);
 $\left({-}{\mathrm{x~}}{+}{1}\right){}{\left({-}{1}\right)}^{{1}{/}{3}}$ (22)
 > root[3](f*y);
 ${\left(\left({{\mathrm{x~}}}^{{3}}{-}{3}{}{{\mathrm{x~}}}^{{2}}{+}{3}{}{\mathrm{x~}}{-}{1}\right){}{y}\right)}^{{1}{/}{3}}$ (23)
 Note the differences among the outputs of the root, ^, and surd commands.
 > (8)^(1/3); root(8, 3); surd(8, 3);
 ${{8}}^{{1}{/}{3}}$
 ${2}$
 ${2}$ (24)
 > (8.0)^(1/3); root(8.0, 3); surd(8.0, 3);
 ${2.000000000}$
 ${2.000000000}$
 ${2.000000000}$ (25)
 > (-8)^(1/3); root(-8, 3); surd(-8, 3);
 ${\left({-}{8}\right)}^{{1}{/}{3}}$
 ${2}{}{\left({-}{1}\right)}^{{1}{/}{3}}$
 ${-}{2}$ (26)
 > (-8.0)^(1/3); root(-8.0, 3); surd(-8.0, 3);
 ${1.000000000}{+}{1.732050807}{}{I}$
 ${1.000000000}{+}{1.732050807}{}{I}$
 ${-}{2.000000000}$ (27)