# Riemann surfaces: computing $f(z) = \int_0^z \frac{dx}{\sqrt{P(x)}}$

I am trying to validate that the Schwartz-Christoffel mapping does indeed take the upper-half plane $\mathbb{H} = \{ z: \mathrm{Re}(z) > 0\}$ to a polygon.

This involves integrals of functions of the type and computing at every point.

$$f(z) = \int_0^z \frac{dx}{\sqrt{(x-a)(x-b)}}$$

where $a < b \in \mathbb{R}$.

I would like the case $a = 1,b=-1$. I know this integral can be computed exactly, but not if the denominator $P(z)$ were a cubic or quartic like $x^4 - 1$.

Here is a numpy script I wrote... sorry if it's wrong.

import numpy as np
impott matplotlib.pyplot as plt

f = lambda z: np.cumsum(z, axis=1) + 1j*np.cumsum(z, axis=0)
n = 200
dt = 1.0/n
y = (np.ones((n,2*n)))/n
y = f(y)-1
w = y[(y.imag > 0.001)] # semicircle of radius 1

g = lambda t: np.sqrt(1 - t**2)**-0.5 # function to be integrated

plt.plot((g(w)).real, g(w).imag, 'b.')

plt.axis("Equal")
plt.show()


Here's the picture I came up with... defintely not a polygon. Maybe I have to change the original mesh?

I don't want to compute the antiderivative exactly, since I would like it to work for more complex examples like $\int_0^z \frac{dx}{\sqrt{(x-1)(x-2)(x-3)}}$. Instead I proposed two strategy:

• build a mesh representing values of $\frac{1}{\sqrt{P(z)}}$
• transform the mesh into the values of $\int_0^z$ at each point
• if the roots of $P(z)$ are real and we stick to $\mathrm{Re}(z)> 0$ the square-root is still single-valued at least
• Alternatively can think of the differential equation $\frac{dw}{dz} = \tfrac{1}{\sqrt{P(z)}}$. – john mangual Nov 11 '14 at 20:50
• Where exactly are you integrating the function? I can see $1/\sqrt{1-w^2}$ being plotted. – Kirill Nov 11 '14 at 23:24
• @Kirill yeah it loos like I forget the cumulative sum. it doesn't really compute the "integral" anyway – john mangual Nov 12 '14 at 11:07

Note that the integral is $$\int^z \frac{dx}{\sqrt{x-a}\sqrt{x-b}},$$ and in general for complex variables $$\sqrt{x-a}\sqrt{x-b} \not\equiv \sqrt{(x-a)(x-b)}.$$
I'm not sure what you were trying to do with your code, so I can't help you there. I don't see where in your code you do the integration, it seems to plot some other function entirely: the issue is not with the mesh. When I did your example in Mathematica, $a=-b=1$, and I got this:
-((I \[Pi])/2) + 2 ArcSinh[Sqrt[-1 + z]/Sqrt[2]] /. z -> x + I y;