# The Square Root
The square root $\sqrt x$ is a non-negative number that when squared gives $x$: $\left(\sqrt x \right)^2 = x$. In other words, the square root is function that is inverted by squaring.
Note that the above definition DOES NOT mean that the square root is an inverse of squaring (although the opposite is true). The inverse of squaring does not exist because squaring IS NOT a 1-to-1 function[^1]. It can only be said that the square root is an inverse of squaring on a limited domain, that of $[0, +\infty)$.
Per the above (square root is an inverse of squaring on a limited domain): $\sqrt {x^2} = |x|$.
[^1]: A 1-to-1 function is defined as one where for each output there exists only one input. This is not the case for squaring because $x^2 = (-x)^2$ for all $x$. See [[Inverse (in Algebra)]] for more.
If the above definition of a square root as a non-negative numbers is unclear see [Does a square root have two values?](https://brilliant.org/wiki/plus-or-minus-square-roots/) from Brilliant.
As a function, the square root's domain are all real numbers, and its codomain complex numbers.
See [[Exponent Rules]], as well as [[Misconception About Multiplying Square Roots]] and [[Misconception About Roots and Fractions]] for rules. See [[Complex Numbers]] for complex numbers.