returns the branch cuts of a given mathematical expression

 Calling Sequence FunctionAdvisor(branch_cuts, expression, plot = ..., options=value)

Parameters

 branch_cuts - literal name; 'branch_cuts' expression - The name of mathematical function, or a mathematical expression, involving +, *, ^, possibly fractional powers and mathematical functions calls plot = ... - optional, the right-hand-side can be 2D, 3D or 32D, also 2d', 3d, 32d, to respectively plot the branch cuts in 2D, 3D or 3D projected on the 2D (x, y) plane with black and white contrast parameters = ... - optional, the right-hand-side can be a set or list of names parametrizing the expression method = ... - optional, the right hand side can be any of Standard, RealVariables, ComplexVariable to performing intermediate steps solving for the complex variable of for its real and imaginary parts options = value - optional, any of the options supported by 2D and 3D plots

Description

 • The FunctionAdvisor(branch_cuts, expression) command returns the branch cuts or segments of discontinuity of a given mathematical expression, if any, or the string "No branch cuts" when there are none. If the information necessary to perform the calculation is not available, FunctionAdvisor returns NULL, depending on the case including informative related messages.
 • The expression indicated can be just the name of a mathematical function, e.g. arcsin, or a mathematical function call like $\mathrm{arcsin}\left(x\right)$, or a whole mathematical expression, involving compositions between +, *, ^, possibly fractional powers, with every mathematical function call for which FunctionAdvisor knows the branch cuts, with no restrictions to the level of nesting in the expression.
 • CAVEAT 1: Depending on the mathematical expression, there is a situation where the program cannot guarantee an exhaustive list of branch cuts. This happens, typically, when a non-rational expression needs to be algebraically inverted, and the system can only invert it using RootOf, which means, basically, that the system does not know how many roots are around or exactly where they are located). Example: $\mathrm{arctan}\left(\frac{{J}_{2}\left(z\left(1+z\right)\right)}{-{z}^{3}+1}\right)$, where ${J}_{2}\left(z\left(1+z\right)\right)$ is the BesselJ function.
 • CAVEAT 2: Depending on the mathematical expression, the algebraic cuts returned may contain some spurious cuts in the sense that the expression is actually continuous over the those cuts. You can determine this by visualizing the expression cuts directly, by using the options plot = 3D or  plot = 32D (the spurious cuts are not visualized as discontinuities) and comparing with the 2D plot where these spurious cuts are shown together with the real discontinuities of the expression.
 Note: In Maple, by convention, when you say, for instance, z <= 1, it is implicitly assumed that $\mathrm{\Im }$(z) = 0.
 • Regarding the 3D plots, they are generated with plotcompare, they are centered at the origin, and the options used by default are scale_range = Pi, orientation = [-115, 81, 7], and grid = [200, 200] in order to display the cuts sharply. Depending on the case, centering at the origin may not be appropriate - to override that use the option shift_range explained in plotcompare. Likely, the default value for orientation may not visualize the discontinuities optimally - you can then rotate the plot with the mouse or use the option orientation = [a, b, c] explained in plot3D options. The high value used for grid may slowdown the visualization - to override speeding up use the option grid = [a, b] with smaller values of a and b; typically 50 would suffice. In all cases the array of plots is assigned to the variable _P so that it can be accessed for subsequent manipulation.
 • The option 32D is as the option 3D but for orientation = [-90, 0, 0], style = surface and shading = zgrayscale, so that the 3D plot is viewed from above, projected over the 2D (x, y) plane, as a smooth surface and with black and white contrast. The resulting visualization is similar to the one obtained using plot = 2D, but it has the advantage that it is free of the spurious cuts mentioned above in CAVEAT 2, and helps visualizing the branch points by contrast (see the last example).
 • The algebraic calculation is by default performed using the method so-called Standard; other optional choices for method are RealVariables and ComplexVariable. These methods and their limitations are discussed in the reference (at the end). Briefly summarized, given a mathematical expression involving functions ${f}_{i}\left(p\left(z\right)\right)$ where $p\left(z\right)$ is rational or involve fractional powers of $z$,
 1 Obtain the branch cuts ${C}_{j}\left(z\right)$ of ${f}_{i}\left(z\right)$
 2 Set $z=iy+x$ and compute two expressions, $R\left(x,y\right)=\mathrm{\Re }\left(p\left(x,y\right)\right)$ and $I\left(x,y\right)=\mathrm{\Im }\left(p\left(x,y\right)\right)$
 3 For each ${C}_{i}\left(p\left(z\right)\right)$, set $p\left(x,y\right)=R+Ii$ and solve for $\left\{x,y\right\}$
 4 Reintroduce $z$, resulting in algebraic expressions ${G}_{k}\left(z\right)=\mathrm{...}$ for each cut ${C}_{j}$ of ${f}_{i}\left(p\left(z\right)\right)$
 5 Take for branch cuts of the given expression the union of the ${G}_{k}\left(z\right)$
 This approach can produce spurious branch cuts due to the denesting of powers at the time of solving for $x$ and $y$ or because of the intersection of cuts of different parts of an expression. Some of these spurious cuts can be detected automatically and are removed before returning the sequence of cuts for the given expression.

Examples

The FunctionAdvisor knows about the branch cuts of the mathematical functions in general

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},\mathrm{arcsin}\right)$
 $\left[{\mathrm{arcsin}}{}\left({z}\right){,}{z}{\le }{-1}{\vee }{1}{\le }{z}\right]$ (1)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_points},\mathrm{arcsin}\right)$
 $\left[{\mathrm{arcsin}}{}\left({z}\right){,}{z}{\in }\left[{-1}{,}{1}{,}{\mathrm{\infty }}{+}{\mathrm{\infty }}{}{I}\right]\right]$ (2)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},\mathrm{BesselJ}\right)$
 $\left[{\mathrm{BesselJ}}{}\left({a}{,}{z}\right){,}{a}{::}\left({¬}{'}{\mathrm{integer}}{'}\right){\wedge }{z}{<}{0}\right]$ (3)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},\mathrm{exp}\right)$
 $\left[{{ⅇ}}^{{z}}{,}{"No branch cuts"}\right]$ (4)

The branch cuts are sometimes compactly expressed in terms of RealRange or ComplexRange; in these cases converting the result to relation may be of help to figure out where the cuts are

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},\mathrm{arccot}\right)$
 $\left[{\mathrm{arccot}}{}\left({z}\right){,}{z}{\in }{\mathrm{ComplexRange}}{}\left({-}{\mathrm{\infty }}{}{I}{,}{-I}\right){\vee }{z}{\in }{\mathrm{ComplexRange}}{}\left({I}{,}{\mathrm{\infty }}{}{I}\right)\right]$ (5)
 > $\mathrm{convert}\left(,\mathrm{relation}\right)$
 $\left[{\mathrm{arccot}}{}\left({z}\right){,}\left({\mathrm{\Re }}{}\left({z}\right){=}{0}{\wedge }{-}{\mathrm{\infty }}{\le }{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{-1}\right){\vee }\left({\mathrm{\Re }}{}\left({z}\right){=}{0}{\wedge }{1}{\le }{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{\mathrm{\infty }}\right)\right]$ (6)

Note that the output of FunctionAdvisor involves local variables, to avoid conflict with the related global variables you may be using. So,

 > $\mathrm{has}\left(,z\right)$
 ${\mathrm{false}}$ (7)

To have the output using global variables, pass the function call, not just the function's name; you could use any variable, not just z

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},\mathrm{arccot}\left(z\right)\right)$
 $\left[{\mathrm{arccot}}{}\left({z}\right){,}{z}{\in }{\mathrm{ComplexRange}}{}\left({-}{\mathrm{\infty }}{}{I}{,}{-I}\right){\vee }{z}{\in }{\mathrm{ComplexRange}}{}\left({I}{,}{\mathrm{\infty }}{}{I}\right)\right]$ (8)
 > $\mathrm{has}\left(,z\right)$
 ${\mathrm{true}}$ (9)

You can also plot general mathematical expressions; to have also a plot of the branch_cuts pass use plot = ... where the right-hand-side can be either 2D or 3D

 > $\mathrm{ln}\left(\sqrt{{z}^{3}}\right)$
 $\frac{{\mathrm{ln}}{}\left({{z}}^{{3}}\right)}{{2}}$ (10)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=3.\right)$  $\left[\frac{{\mathrm{ln}}{}\left({{z}}^{{3}}\right)}{{2}}{,}{z}{<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\frac{\sqrt{{3}}{}{\mathrm{\Im }}{}\left({z}\right)}{{3}}{\wedge }{\mathrm{\Im }}{}\left({z}\right){<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}\frac{\sqrt{{3}}{}{\mathrm{\Im }}{}\left({z}\right)}{{3}}{\wedge }{0}{<}{\mathrm{\Im }}{}\left({z}\right)\right]$ (11)

These 3D plots are constructed with plotcompare using its option expression_plot. You can rotate the two 3D plots above with the mouse; there you see in which of the real or imaginary parts of the expression (10) are the branch cuts located, in this example only in the imaginary part.

A 2D plot of the same cuts

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=2.\right)$ $\left[\frac{{\mathrm{ln}}{}\left({{z}}^{{3}}\right)}{{2}}{,}{z}{<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\frac{\sqrt{{3}}{}{\mathrm{\Im }}{}\left({z}\right)}{{3}}{\wedge }{\mathrm{\Im }}{}\left({z}\right){<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}\frac{\sqrt{{3}}{}{\mathrm{\Im }}{}\left({z}\right)}{{3}}{\wedge }{0}{<}{\mathrm{\Im }}{}\left({z}\right)\right]$ (12)

A similar visualization is obtained viewing the related 3D plot from above, projected over the (x, y) plane, with black and white contrast, using the plot = 32D option

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=32.\right)$  $\left[\frac{{\mathrm{ln}}{}\left({{z}}^{{3}}\right)}{{2}}{,}{z}{<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\frac{\sqrt{{3}}{}{\mathrm{\Im }}{}\left({z}\right)}{{3}}{\wedge }{\mathrm{\Im }}{}\left({z}\right){<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}\frac{\sqrt{{3}}{}{\mathrm{\Im }}{}\left({z}\right)}{{3}}{\wedge }{0}{<}{\mathrm{\Im }}{}\left({z}\right)\right]$ (13)

Each of the plots above can also be rotated with the mouse. The option plot = 32D is particularly useful when there are spurious branch cuts, indistinguishable from the real branch cuts when using plot = 2D.

All the optional arguments of plot (for 2D), plotcompare and plot3D (for 3D) can be used

 > $\mathrm{arcsin}\left(2z\sqrt{1-{z}^{2}}\right)$
 ${\mathrm{arcsin}}{}\left({2}{}{z}{}\sqrt{{-}{{z}}^{{2}}{+}{1}}\right)$ (14)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=3.,\mathrm{orientation}=\left[-118,50,-10\right]\right)$  $\left[{\mathrm{arcsin}}{}\left({2}{}{z}{}\sqrt{{-}{{z}}^{{2}}{+}{1}}\right){,}{1}{<}{z}{,}{z}{<}{-1}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\frac{\sqrt{{4}{}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{2}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}\frac{\sqrt{{4}{}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{2}}}{{2}}\right]$ (15)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=2.\right)$ $\left[{\mathrm{arcsin}}{}\left({2}{}{z}{}\sqrt{{-}{{z}}^{{2}}{+}{1}}\right){,}{1}{<}{z}{,}{z}{<}{-1}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\frac{\sqrt{{4}{}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{2}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}\frac{\sqrt{{4}{}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{2}}}{{2}}\right]$ (16)

To see how this 2D plot is related to the 3D plot use the option plot = 32D and rotate the plot in the right window using the mouse:

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=32.\right)$  $\left[{\mathrm{arcsin}}{}\left({2}{}{z}{}\sqrt{{-}{{z}}^{{2}}{+}{1}}\right){,}{1}{<}{z}{,}{z}{<}{-1}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\frac{\sqrt{{4}{}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{2}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}\frac{\sqrt{{4}{}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{2}}}{{2}}\right]$ (17)
 > $\mathrm{arctan}\left(z\right)+\mathrm{arctan}\left({z}^{2}\right)-\mathrm{arctan}\left(\frac{z\left(1+z\right)}{1-{z}^{3}}\right)$
 ${\mathrm{arctan}}{}\left({z}\right){+}{\mathrm{arctan}}{}\left({{z}}^{{2}}\right){-}{\mathrm{arctan}}{}\left(\frac{{z}{}\left({z}{+}{1}\right)}{{-}{{z}}^{{3}}{+}{1}}\right)$ (18)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=3.,\mathrm{orientation}=\left[-110,67,24\right]\right)$  $\left[{\mathrm{arctan}}{}\left({z}\right){+}{\mathrm{arctan}}{}\left({{z}}^{{2}}\right){-}{\mathrm{arctan}}{}\left(\frac{{z}{}\left({z}{+}{1}\right)}{{-}{{z}}^{{3}}{+}{1}}\right){,}{\mathrm{\Re }}{}\left({z}\right){=}{0}{\wedge }{1}{\le }{\mathrm{\Im }}{}\left({z}\right){,}{\mathrm{\Re }}{}\left({z}\right){=}{0}{\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{-1}{,}{\mathrm{\Re }}{}\left({z}\right){=}{\mathrm{\Im }}{}\left({z}\right){\wedge }\frac{\sqrt{{2}}}{{2}}{\le }{\mathrm{\Im }}{}\left({z}\right){,}{\mathrm{\Re }}{}\left({z}\right){=}{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{-}\frac{\sqrt{{2}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}{\mathrm{\Im }}{}\left({z}\right){\wedge }\frac{\sqrt{{2}}}{{2}}{\le }{\mathrm{\Im }}{}\left({z}\right){,}{\mathrm{\Re }}{}\left({z}\right){=}{-}{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{-}\frac{\sqrt{{2}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}\sqrt{{-}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{1}}{\wedge }{-}\frac{\sqrt{{2}}}{{2}}{\le }{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){<}{0}{,}{\mathrm{\Re }}{}\left({z}\right){=}\sqrt{{-}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{1}}{\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }\frac{\sqrt{{2}}}{{2}}{\wedge }{0}{<}{\mathrm{\Im }}{}\left({z}\right){,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\sqrt{{-}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{1}}{\wedge }{-1}{\le }{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){<}{-}\frac{\sqrt{{3}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\sqrt{{-}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{1}}{\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{1}{\wedge }\frac{\sqrt{{3}}}{{2}}{<}{\mathrm{\Im }}{}\left({z}\right){,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\sqrt{{-}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{1}}{\wedge }\frac{\sqrt{{2}}}{{2}}{\le }{\mathrm{\Im }}{}\left({z}\right){\wedge }{\mathrm{\Im }}{}\left({z}\right){<}\frac{\sqrt{{3}}}{{2}}{,}{\mathrm{\Re }}{}\left({z}\right){=}{-}\sqrt{{-}{{\mathrm{\Im }}{}\left({z}\right)}^{{2}}{+}{1}}{\wedge }{\mathrm{\Im }}{}\left({z}\right){\le }{-}\frac{\sqrt{{2}}}{{2}}{\wedge }{-}\frac{\sqrt{{3}}}{{2}}{<}{\mathrm{\Im }}{}\left({z}\right)\right]$ (19)
 > $2\mathrm{arccosh}\left(\frac{3+2z}{3}\right)-2\mathrm{arccosh}\left(\frac{12+5z}{3\left(z+4\right)}\right)$
 ${2}{}{\mathrm{arccosh}}{}\left({1}{+}\frac{{2}{}{z}}{{3}}\right){-}{2}{}{\mathrm{arccosh}}{}\left(\frac{{12}{+}{5}{}{z}}{{3}{}{z}{+}{12}}\right)$ (20)
 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=3.\right)$  $\left[{2}{}{\mathrm{arccosh}}{}\left({1}{+}\frac{{2}{}{z}}{{3}}\right){-}{2}{}{\mathrm{arccosh}}{}\left(\frac{{12}{+}{5}{}{z}}{{3}{}{z}{+}{12}}\right){,}{z}{<}{-}\frac{{9}}{{2}}{,}{z}{\le }{0}{\wedge }{-3}{<}{z}{,}{-4}{<}{z}{\wedge }{z}{<}{-3}\right]$ (21)

A classic example in the theory of branch cut calculation is that of Kahan's teardrop:

 > $-2\mathrm{arccosh}\left(2\left(z+3\right)\sqrt{\frac{z+3}{27\left(z+4\right)}}\right)$
 ${2}{}{\mathrm{arccosh}}{}\left({1}{+}\frac{{2}{}{z}}{{3}}\right){-}{2}{}{\mathrm{arccosh}}{}\left(\frac{{12}{+}{5}{}{z}}{{3}{}{z}{+}{12}}\right){-}{2}{}{\mathrm{arccosh}}{}\left({2}{}\left({z}{+}{3}\right){}\sqrt{\frac{{z}{+}{3}}{{27}{}{z}{+}{108}}}\right)$ (22)

This expression is equal to zero for all values of $z$ in the complex plane except for a small teardrop shaped region over the negative real axis, as shown in the 3D plot on the right (you can rotate it with the mouse). To see just the plot, without the display of the algebraic description of the cuts, end the input with colon ':'

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=3.,\mathrm{shift_range}=-3,\mathrm{scale_range}=2,\mathrm{orientation}=\left[-124,20,14\right]\right):$  A 2D visualization with black and white contrast obtained viewing the 3D plot from above: change 3D by 32D in the input line above; try rotating this image using the mouse:

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=32.,\mathrm{shift_range}=-3,\mathrm{scale_range}=2\right):$  As an example where a spurious cut is present due to intersection of cuts of different parts of the expression, consider $\mathrm{ln}\left(1+z\right)$, which has a cut from $-\mathrm{\infty }$ to -1, and $\mathrm{ln}\left(z-1\right)$ has this cut $-\mathrm{\infty }$ to 1, and take their difference:

 > $\mathrm{ln}\left(z+1\right)-\mathrm{ln}\left(z-1\right)$
 ${\mathrm{ln}}{}\left({z}{+}{1}\right){-}{\mathrm{ln}}{}\left({z}{-}{1}\right)$ (23)

Computing the cuts of the sub-expressions as mentioned in the Description we arrive at this result and 2D plot of the cuts

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=2.\right)$ $\left[{\mathrm{ln}}{}\left({z}{+}{1}\right){-}{\mathrm{ln}}{}\left({z}{-}{1}\right){,}{-1}{\le }{z}{\wedge }{z}{<}{1}\right]$ (24)

So according to this result and plot, there is a cut or discontinuity for this expression from $-\mathrm{\infty }$ to 1. Looking at the 3D visualization of the discontinuity, however, we see that it is only from -1 to 1

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=3.,\mathrm{orientation}=\left[112,80,15\right]\right):$  Another way of removing the spurious cuts from the visualization, also contrasting the branch points at the extremes of the cut, is using the option plot = 32D,

 > $\mathrm{FunctionAdvisor}\left(\mathrm{branch_cuts},,\mathrm{plot}=32.\right):$  > 

You can experiment furthermore by rotating the plots above with the mouse.

References

 England M., Bradford R., Davenport J.H., Wilson, D. "Understanding branch cuts of expressions". http://opus.bath.ac.uk/32511/
 Cheb-Terrab, E.S. "The function wizard project: A Computer Algebra Handbook of Special Functions". Proceedings of the Maple Summer Workshop, University of Waterloo, Ontario, Canada, 2002.