sqrt
compute the square root
Calling Sequence
Parameters
Description
Examples
sqrt(x)
x
sqrt(x, symbolic)
-
algebraic expression
The sqrt(x) function computes the square root of x.
You can enter the command sqrt using either the 1-D or 2-D calling sequence. For example, sqrt(3.0) is equivalent to 3.0.
If x is a real or complex floating-point constant, the square root is computed in floating-point arithmetic.
The square root of a negative real numeric constant returns a purely imaginary value and signals real_to_complex. Otherwise the sqrt(x) function tries to simplify x^(1/2). If no simplifications can be made, the expression x^(1/2) is returned.
sqrt(x) represents the "principal square root", defined by the formula sqrt(x) = exp(1/2 * ln(x))
Maple automatically writes roots of rational constants (radicals a^(n/d) and (a/b)^(n/d) where a, b, n, and d are integers) in canonical form as fractional powers of integers by applying the following transformations.
(1) and = aq+rd ==> aq⁢ard where 0⁢≤⁢r⁢<⁢d
(2) abnd ==> and⁢b−nd 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 sqrt function does transformation (1) and the transformations
(3) ab ==> a⁢bb
(4) −n ==> I⁢n
(5) p2⁢n ==> p⁢n if the prime factorization of either p or n has no terms greater than 149 (try radnormal otherwise)
(6) n2 ==> n where n>0
Examples: sqrt(-4) ==> I*sqrt(4) ==> 2*I and sqrt(24) ==> sqrt(2^2*6) ==> 2*6^(1/2). No attempt is made to factor the input integer x. The simplification sqrt(999988999906999847) = sqrt(1000003^2*999983) ==> 1000003*999983^(1/2) is not attempted because it is too expensive in general to try to find the factors 1000003 and 999983.
For symbolic expressions, a number of simplifications are attempted. The main ones are:
(7) a2⁢b ==> a⁢b if signum⁡a=1
(8) a2⁢b ==> −a⁢b if signum⁡a=−1
(9) a4⁢b ==> a2⁢b if ℑ⁡a=0
where 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.
Note: Maple does not simplify sqrt(x^2) to x. This is wrong for negative x. Maple returns (x^2)^(1/2). 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 sqrt applies transformation (7), effectively assuming that x is positive. Note, it is also possible to force the sqrt function to make a simplification by making the appropriate assumption, for example, assume(x>0).
The purpose of the symbolic option is to allow the context where the sign of the answer does not matter. Beware that simplify(sqrt( x^2 - 2*x*y + y^2 ), symbolic) may return either x-y or y-x.
Without the symbolic option, Maple computes simplify((x^2)^(1/2)) as csgn(x)*x.
sqrt⁡3.0
1.732050808
sqrt⁡3
3
sqrt⁡4
2
sqrt⁡12
2⁢3
sqrt⁡3579757
3579757
radnormal⁡
151⁢157
sqrt⁡−4
2⁢I
sqrt⁡3+4⁢I
2+I
sqrt⁡4+2⁢sqrt⁡3
1+3
sqrt⁡x
sqrt⁡−9⁢x2⁢y
3⁢−x2⁢y
To use the symbolic option, the sqrt command must be written in 1-D or 2-D command form and not in mathematical notation. See Entering Commands in 2-D for more information.
sqrt⁡−9⁢x2⁢y,symbolic
3⁢x⁢−y
assume⁡0<x
3⁢x~⁢−y
assume⁡x<0
−3⁢x~⁢−y
sqrt⁡−9⁢yx5
3⁢−yx~x~2
f≔x−12⁢y
f≔x~−12⁢y
sqrt⁡f
−x~+1⁢y
sqrt⁡expand⁡f
x~2⁢y−2⁢x~⁢y+y
See Also
assume
iroot
isqrt
issqr
NumberTheory[ModularSquareRoot]
NumberTheory[QuadraticResidue]
psqrt
radnormal
RealDomain
root
simplify/sqrt
type/sqrt
Download Help Document