Deciphering Branch Behaviour

In Uncategorized on July 22, 2011 by nessgrh

Handling branches in computer systems is indeed unbelievably subtle. Here is one slightly complicated example which comes out correctly, at least when looked at in the right way; this is encouraging. The following integral comes up in an ODE test: $\int \frac{\mathrm{d}x}{x \sqrt{1 - x^2}} = i \arcsin{\frac{1}{x}}$. The right hand side is as computed by the meijerint code and looks suspicious, not being invariant under complex conjugation. However, note that on both sides are branched functions: $\sqrt{1 - x^2}$ and $\arcsin{\frac{1}{x}}$. The left hand side is unbranched at the origin, whereas the right hand side is unbranched at infinity. The left hand side is branched at infinity, whereas the rigth hand side is not. (There is nothing unusual about this, there is no reason to expect indefinite integrals to retain branchpoints.)

Thus in order to understand what is going on, we first have to understand the extension of both functions to true polar numbers $x$, because this is what the meijer g code works with. Since inverse sine is surely nasty, let’s try to understand the square root expression. A clue comes from enabling debug output: the meijerint code decides $\frac{1}{\sqrt{1-x^2}} = G(x^2 e^{i \pi}) = \sqrt{\pi} G_{1, 1}^{1, 1} \left(\begin{matrix}\frac{1}{2} \\ 0 \end{matrix}\middle| x^2 e^{i\pi} \right)$. From the definitions, for $|x| < 1$ we find $G(x) = F(x)$, where $F(x)$, which we shall define only for $|x| < 1$, is $(1 + x)^{-\frac{1}{2}}$, evaluated on the principal branch (indeed it is just a binomial series). Also from the definitions, we find that for $|x| > 1$, $G(x) = \frac{1}{\sqrt{x}} F\left(\frac{1}{x}\right)$, where $\frac{1}{\sqrt{x}}$ denotes the holomorphic function $\mathcal{S} \rightarrow \mathbb{C}$ (which is, in particular, continuous, i.e. free of branch cuts). Finally we know that for $|Arg(x)| < \pi$, these two definitions must patch together continuously.

Note how the branching has been resolved crudely: for every polar number x (outside a set of measure zero which does not disconnect $\mathcal{S}$) the integrand has acquired a definite value, continuous on circles. However, there is a circular branch cut on every other sheet.

Now let’s look back at the integrand. The meijerint code interprets $\int \frac{1}{x \sqrt{1 - x^2}}$ as $\frac{G(e^{i\pi} x^2)}{x}$. [It's $e^{i\pi}$ and not $e^{-i\pi}$ since $-1$ "in the wild" means $e^{i\pi}$ in the standard branch. Of course one can specify this by hand if it is not the desired choice.] Hence for $|x| > 1$, the integrand is $\frac{F\left(\frac{-1}{x^2} \right)}{x \sqrt{e^{i \pi}x^2} } = \frac{F\left(\frac{-1}{x^2} \right)}{x^2 e^{i \pi/2}} = \frac{-i}{x^2 \sqrt{1 - \frac{1}{x^2}}}$ (Recall that in the first term the the square root means the continuous function on $\mathcal{S}$, and so the second term is the same as the first. In the third term the square root denotes the principal branch, which is continuous throughout $|x|>1$ as well.)

Finally, for $|x| < 1$, the derivative of $\arcsin{x}$ is $\frac{1}{\sqrt{1 - x^2}}$, again with the principal branch of the square root (for the same reason as before: continue analytically on circles from the real-valued function). Thus lo and behold, if we differentiate $i\arcsin{\frac{1}{x}}$ for $|x| > 1$, we do get out the right sign. As a side note, if we replace $-x^2$ in the integrand by $e^{-i\pi}x^2$, we get the other sign.

3 Responses to “Deciphering Branch Behaviour”

1. Interesting.

WolframAlpha gives $\log(x) - \log\left(\sqrt{1 - x^2} + 1\right)$ and Maple gives $\tanh^{-1}\left(\frac{1}{\sqrt{1 - x^2}}\right)$.

But don’t feel so bad: computing the logarithmic part is one of the hardest parts of the algebraic Risch algorithm.

2. These manifestly real answers are somewhat nicer of course…

Actually the wolfram alpha result could reasonably be obtained with the g-function algorithm. Indeed recall that slater-expansion often gives two results, which happen to be analytic continuations of each other. My code returns the simpler one. In this case these are the arcsine function. The other branch is a big mess with eulergammas and branch factors, but if we shop off all constants and are somewhat liberal with the branch factors, we get the wolfram alpha result.

I’ll add investigation of this to my todo-later list.