WOLFRAM

Sqrt[z]

or gives the square root of z.

Details

  • Mathematical function, suitable for both symbolic and numerical manipulation.
  • can be entered using or (@z).
  • Sqrt[z] is converted to .
  • Sqrt[z^2] is not automatically converted to z.
  • Sqrt[a b] is not automatically converted to Sqrt[a]Sqrt[b].
  • These conversions can be done using PowerExpand, but will typically be correct only for positive real arguments.
  • For certain special arguments, Sqrt automatically evaluates to exact values.
  • Sqrt can be evaluated to arbitrary numerical precision.
  • Sqrt automatically threads over lists. »
  • In StandardForm, Sqrt[z] is printed as .
  • z can also be used for input. The character is entered as sqrt or \[Sqrt].

Examples

open allclose all

Basic Examples  (6)Summary of the most common use cases

Evaluate numerically:

Out[1]=1

Enter using :

Out[1]=1

Negative numbers have imaginary square roots:

Out[1]=1

Plot over a subset of the reals:

Out[1]=1

Plot over a subset of the complexes:

Out[1]=1

is not necessarily equal to :

Out[1]=1

It can be simplified to if one assumes :

Out[2]=2

Scope  (39)Survey of the scope of standard use cases

Numerical Evaluation  (7)

Evaluate numerically:

Out[1]=1

Evaluate to high precision:

Out[1]=1

The precision of the output tracks the precision of the input:

Out[2]=2

Complex number inputs:

Out[1]=1

Evaluate efficiently at high precision:

Out[1]=1
Out[2]=2

Sqrt can deal with realvalued intervals:

Out[1]=1

Compute the elementwise values of an array using automatic threading:

Out[1]=1

Or compute the matrix Sqrt function using MatrixFunction:

Out[2]=2

Compute average-case statistical intervals using Around:

Out[1]=1

Specific Values  (4)

Values of Sqrt at fixed points:

Out[1]=1

Values at zero:

Out[1]=1

Values at infinity:

Out[1]=1
Out[2]=2

Find a value of for which using Solve:

Out[1]=1

Substitute in the result:

Out[2]=2

Visualize the result:

Out[3]=3

Visualization  (4)

Plot the real and imaginary parts of the Sqrt function:

Out[1]=1

Compare the real and imaginary parts of and (Surd[x,2]):

Out[1]=1

Plot the real part of :

Out[1]=1

Plot the imaginary part of :

Out[2]=2

Polar plot with :

Out[1]=1

Function Properties  (10)

The real domain of Sqrt:

Out[1]=1

It is defined for all complex values:

Out[2]=2

Sqrt achieves all non-negative values on the reals:

Out[1]=1

The range for complex values is the right half-plane, excluding the negative imaginary axis:

Out[2]=2

Find limits at branch cuts:

Out[1]=1
Out[2]=2

Enter a character as sqrt or \[Sqrt], followed by a number:

Out[1]=1

is not an analytic function:

Out[1]=1

Nor is it meromorphic:

Out[2]=2

is neither non-decreasing nor non-increasing:

Out[1]=1

However, it is increasing where it is real valued:

Out[2]=2

is injective:

Out[1]=1
Out[2]=2

Not surjective:

Out[3]=3
Out[4]=4

is non-negative on its domain of definition:

Out[1]=1

has a branch cut singularity for :

Out[1]=1

However, it is continuous at the origin:

Out[2]=2

is neither convex nor concave:

Out[1]=1

However, it is concave where it is real valued:

Out[2]=2

Differentiation  (3)

The first derivative with respect to z:

Out[1]=1

Higher derivatives with respect to z:

Out[1]=1

Plot the higher derivatives with respect to z:

Out[2]=2

Formula for the ^(th) derivative with respect to z:

Out[1]=1

Integration  (3)

Compute the indefinite integral using Integrate:

Out[1]=1

Verify the anti-derivative:

Out[2]=2

Definite integral:

Out[1]=1

More integrals:

Out[1]=1
Out[2]=2

Series Expansions  (4)

Find the Taylor expansion using Series:

Out[1]=1

Plots of the first three approximations around :

Out[2]=2

The general term in the series expansion using SeriesCoefficient:

Out[1]=1

The first-order Fourier series:

Out[1]=1

The Taylor expansion at a generic point:

Out[1]=1

Function Identities and Simplifications  (4)

Primary definition:

Out[1]=1

Connection with Exp and Log:

Out[1]=1

is not automatically replaced by :

Out[1]=1

It can be simplified to if one assumes :

Out[2]=2

It can be simplified to TemplateBox[{x}, Abs] if one assumes x in TemplateBox[{}, Reals]:

Out[3]=3

PowerExpand can be used to force cancellation without assumptions:

Out[4]=4

Expand assuming real variables x and y:

Out[1]=1

Applications  (4)Sample problems that can be solved with this function

Roots of a quadratic polynomial:

Out[1]=1

Generate periodic continued fractions:

Out[1]=1
Out[2]=2
Out[3]=3

Solve a differential equation with Sqrt:

Out[1]=1

Compute an elliptic integral from the Sqrt function:

Out[1]=1

Properties & Relations  (12)Properties of the function, and connections to other functions

Sqrt[x] and Surd[x,2] are the same for non-negative real values:

Out[1]=1

For negative reals, Sqrt gives an imaginary result, whereas the real-valued Surd reports an error:

Out[2]=2

Reduce combinations of square roots:

Out[1]=1

Evaluate power series involving square roots:

Out[1]=1

Expand a complex square root assuming variables are real valued:

Out[1]=1

Factor polynomials with square roots in coefficients:

Out[1]=1
Out[2]=2

Simplify handles expressions involving square roots:

Out[1]=1

There are many subtle issues in handling square roots for arbitrary complex arguments:

Out[1]=1

PowerExpand expands forms involving square roots:

Out[1]=1

It generically assumes that all variables are positive:

Out[2]=2

Finite sums of integers and square roots of integers are algebraic numbers:

Out[1]=1

Take limits accounting for branch cuts:

Out[1]=1
Out[2]=2

Sqrt can be represented as a DifferentialRoot:

Out[1]=1

The generating function for Sqrt:

Out[1]=1
Out[2]=2

Possible Issues  (3)Common pitfalls and unexpected behavior

Square root is discontinuous across its branch cut along the negative real axis:

Out[1]=1
Out[2]=2

Sqrt[x^2] cannot automatically be reduced to x:

Out[1]=1
Out[2]=2

With x assumed positive, the simplification can be done:

Out[3]=3

Use PowerExpand to do the formal reduction:

Out[4]=4

Along the branch cut, these are not the same:

Out[1]=1

Neat Examples  (2)Surprising or curious use cases

Approximation to GoldenRatio:

Out[1]=1
Out[2]=2

Riemann surface for square root:

Out[1]=1
Wolfram Research (1988), Sqrt, Wolfram Language function, https://reference.wolfram.com/language/ref/Sqrt.html (updated 1996).
Wolfram Research (1988), Sqrt, Wolfram Language function, https://reference.wolfram.com/language/ref/Sqrt.html (updated 1996).

Text

Wolfram Research (1988), Sqrt, Wolfram Language function, https://reference.wolfram.com/language/ref/Sqrt.html (updated 1996).

Wolfram Research (1988), Sqrt, Wolfram Language function, https://reference.wolfram.com/language/ref/Sqrt.html (updated 1996).

CMS

Wolfram Language. 1988. "Sqrt." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Sqrt.html.

Wolfram Language. 1988. "Sqrt." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 1996. https://reference.wolfram.com/language/ref/Sqrt.html.

APA

Wolfram Language. (1988). Sqrt. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Sqrt.html

Wolfram Language. (1988). Sqrt. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/Sqrt.html

BibTeX

@misc{reference.wolfram_2025_sqrt, author="Wolfram Research", title="{Sqrt}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Sqrt.html}", note=[Accessed: 28-March-2025 ]}

@misc{reference.wolfram_2025_sqrt, author="Wolfram Research", title="{Sqrt}", year="1996", howpublished="\url{https://reference.wolfram.com/language/ref/Sqrt.html}", note=[Accessed: 28-March-2025 ]}

BibLaTeX

@online{reference.wolfram_2025_sqrt, organization={Wolfram Research}, title={Sqrt}, year={1996}, url={https://reference.wolfram.com/language/ref/Sqrt.html}, note=[Accessed: 28-March-2025 ]}

@online{reference.wolfram_2025_sqrt, organization={Wolfram Research}, title={Sqrt}, year={1996}, url={https://reference.wolfram.com/language/ref/Sqrt.html}, note=[Accessed: 28-March-2025 ]}