# Principal value

In mathematics, specifically complex analysis, the principal values of a multivalued function are the values along one chosen branch of that function, so that it is single-valued. A simple case arises in taking the square root of a positive real number. For example, 4 has two square roots: 2 and −2; of these the positive root, 2, is considered the principal root and is denoted as ${\sqrt {4}}.$

## Motivation

Consider the complex logarithm function log z. It is defined as the complex number w such that
    $e^{w}=z.$
Now, for example, say we wish to find log i. This means we want to solve
    $e^{w}=i$
for $w$. The value $i\pi /2$ is a solution.
However, there are other solutions, which is evidenced by considering the position of i in the complex plane and in particular its argument $\arg i$. We can rotate counterclockwise $\pi /2$ radians from 1 to reach i initially, but if we rotate further another $2\pi$ we reach i again. So, we can conclude that $i(\pi /2+2\pi )$ is also a solution for log i. It becomes clear that we can add any multiple of $2\pi$ to our initial solution to obtain all values for log i.
But this has a consequence that may be surprising in comparison of real valued functions: log i does not have one definite value. For log z, we have
    $\log {z}=\ln {|z|}+i\left(\mathrm {arg} \ z\right)=\ln {|z|}+i\left(\mathrm {Arg} \ z+2\pi k\right)$
for an integer k, where Arg z is the (principal) argument of z defined to lie in the interval $(-\pi ,\ \pi ]$. Each value of k determines what is known as a branch (or sheet), a single-valued component of the multiple-valued log function. When the focus is on a single branch, sometimes a branch cut is used; in this case removing the non-positive real numbers from the domain of the function and eliminating $\pi$ as a possible value for Arg z. With this branch cut, the single-branch function is continuous and analytic everywhere in its domain.
The branch corresponding to k = 0 is known as the principal branch, and along this branch, the values the function takes are known as the principal values.

## General case

In general, if f(z) is multiple-valued, the principal branch of f is denoted
    $\mathrm {pv} \,f(z)$
such that for z in the domain of f, pv f(z) is single-valued.

### Principal values of standard functions

Complex valued elementary functions can be multiple-valued over some domains. The principal value of some of these functions can be obtained by decomposing the function into simpler ones whereby the principal value of the simple functions are straightforward to obtain.

#### Logarithm function

We have examined the logarithm function above, i.e.,
    $\log {z}=\ln {|z|}+i\left(\mathrm {arg} \ z\right).$
Now, arg z is intrinsically multivalued. One often defines the argument of some complex number to be between $-\pi$ (exclusive) and $\pi$ (inclusive), so we take this to be the principal value of the argument, and we write the argument function on this branch Arg z (with the leading capital A). Using Arg z instead of arg z, we obtain the principal value of the logarithm, and we write
    $\mathrm {pv} \log {z}=\mathrm {Log} \,z=\ln {|z|}+i\left(\mathrm {Arg} \,z\right).$

#### Square root

For a complex number $z=re^{i\phi }\,$ the principal value of the square root is:
    $\mathrm {pv} {\sqrt {z}}=\exp \left({\frac {\mathrm {pv} \log z}{2}}\right)={\sqrt {r}}\,e^{i\phi /2}$
with argument $-\pi <\phi \leq \pi .$ Sometimes a branch cut is introduced so that negative real numbers are not in the domain of the square root function and eliminating the possibility that $\phi =\pi .$

#### Inverse trigonometric and inverse hyperbolic functions

Inverse trigonometric functions (arcsin, arccos, arctan, etc.) and inverse hyperbolic functions (arsinh, arcosh, artanh, etc.) can be defined in terms of logarithms and their principal values can be defined in terms of the principal values of the logarithm.

#### Complex argument

The principal value of complex number argument measured in radians can be defined as:
* values in the range $[0,2\pi )$
* values in the range $(-\pi ,\pi ]$
For example, many computing systems include an atan2(y, x) function. The value of atan2(imaginary_part(z), real_part(z)) will be in the interval $(-\pi ,\pi ].$ In comparison, atan y/x is typically in $({\tfrac {-\pi }{2}},{\tfrac {\pi }{2}}].$