# step function

While the sum of an inverse sine and inverse cosine has a simple behavior on the entire complex plane,

$sin−1z +cos−1z =π2$

the corresponding statement for inverse tangents is a bit more complicated,

$tan−1z +cot−1z ={ π2 ,Rez>0 −π2 ,Rez<0$

as can be seen in an interactive graphic of the real part of the sum:

Similarly, while the inverse hyperbolic sine is simply related to the inverse sine on the entire complex plane,

$sinh−1z =−isin −1iz$

the inverse hyperbolic cosine has a bit more complicated relation with the inverse cosine,

$cosh−1z ={ icos−1z , Imz>0 −icos−1z , Imz<0$

as can be seen in a graphic of the imaginary part of the ratio of the two functions:

In both cases one can write an analytic expression for each right-hand side that holds on the entire complex plane,

$tan−1z +cot−1z =π2 z2z$

$cosh−1z =z-1 1-z cos−1z$

so that the functions

$z2z z-1 1-z$

act as step functions on the complex plane, the first in the real direction and the second in the imaginary direction. Let’s see why this is so!

When parametrizing complex variables with the exponential form $z=r{e}^{i\phi }$ , one has the tendency to represent the angle with an inverse tangent function:

$x+iy =x2 +y2 [cosφ +isinφ] =x2 +y2 exp(tan−1 yx)$

The last part of this equation is only true in the right-hand half of the complex plane, since the principal branch of the inverse tangent is restricted to the range $[−π2, π2]$ . To keep track of the entire complex plane when performing complex arithmetic, one must instead use the alternate function atan2 that has a range of $[−π,π]$ . This function was invented for such purposes, and this is how complex arithmetic is handled in Math.

The two-argument inverse tangent, or argument function, can be defined in terms of the standard inverse tangent as

$atan2(y,x) ={ tan−1yx ,x>0 tan−1yx +π, x<0, y>0 tan−1yx -π, x<0, y<0$

and looks like this:

This function clearly consists of the principal branch of the inverse tangent, along with halves of the complex branches above and below the principal branch.

Consider the first step function in exponential form:

$z2z =x2 -y2 +2ixy x+iy =exp[ i2 atan2(2xy, x2 -y2) -iatan2 (y,x)]$

The radial factors cancel one another, leaving just the phase factor. Without the imaginary unit the exponent function looks like this:

Understanding this behavior requires an addition formula for real values:

$tan−1u +tan−1u =tan−1 (2u 1-u2) , |u|<1$

To see how to extend this relation outside of its indicated domain, first plot half of each side together:

When $u>1$ the denominator in the right-hand side becomes negative. If this denominator is taken as the second argument of the two-argument function defined above, then when u is positive the inverse tangent will be shifted up by $π2$ , and when u is negative it will be shifted down by $π2$ . These are exactly the corrections needed to extend the addition formula. One then has

$tan−1u =12 atan2(2u, 1-u2)$

which can be tested by plotting the two-argument function together with the inverse tangent:

The first term in the exponent of the step function is thus exactly $tan−1yx$ regardless of the relative signs of the two arguments. The behavior of the whole exponent depends on the second part and is easily seen to be

$12 atan2(2xy, x2 -y2) -atan2(y,x) ={ 0, x>0 −π, x<0, y>0 π, x<0, y<0$

which is precisely the behavior illustrated in the graphic above. Since the second and third values are equivalent in phase factors, the behavior of the step function itself is

$z2z ={ 1, Rez>0 −1, Rez<0$

exactly as expected. To move the step to a different axis on the complex plane, simply shift the complex argument by a real amount,

$(z-c )2 z-c ={ 1, Rez>c −1, Rez

which looks like this:

Now consider the second step function in exponential form:

$z-1 1-z =x-1+iy 1-x-iy =exp[ i2 atan2(y,x-1) +i2 atan2(y,1-x) ]$

The radial factors again cancel, leaving just the phase factor. Without the imaginary unit the exponent function looks like this:

The expected negative sign on the second term of the exponent from algebraic inversion is canceled by the sign of the first argument of that term. This can be justified with an explicit sign on the first argument,

$atan2(−y,x) ={ −tan−1 yx ,x>0 −tan−1 yx-π ,x<0 =−atan2 (y,x)$

since the inverse tangent is an odd function of its single argument. Similarly, with an explicit sign on the second argument one has

$atan2(y,−x) ={ −tan−1 yx+π ,y>0 −tan−1 yx-π , y<0$

so that adding together two two-argument functions that differ in the sign of the second argument gives

$atan2(y,x) +atan2(y,−x) ={ π ,y>0 −π ,y<0$

Since the exponent in the step function contains half of this value, the behavior of the step function is

$z-1 1-z ={ i, Imz>0 −i, Imz<0$

which is the expected imaginary step. Note that in getting this result the quantity of unity under the radicals was not even considered, which means that its exact value is irrelevant. Any real constant can be used to generate the step.

To move the step to a different axis on the complex plane, simply shift the complex argument by an imaginary amount,

$z-ic-1 1-z+ic ={ i, Imz>c −i, Imz

which looks like this:

As a final comment, both steps can be made to extend in the other direction by simply multiplying by negative one. The same behavior for the second step can be achieved with algebraic inversion, which is easy to establish.