The previous post described a metric for the Poincaré upper half plane. The development is geometrical rather than analytical. There are also analytical formulas for the metric, at least four that I’ve seen.

It’s not at all obvious that the four equations are equivalent, or that any of them matches the expression in the previous post.
There are equations for expressing arcsinh, arccosh, and arctanh in terms of logarithms and square roots. See the bottom of this post. You could use these identities to show that the metric expressions are equal, but I don’t know of a cleaner way to do this than lots of tedious algebra.
Before diving into the calculations, you might want some assurance that you’re trying to prove the right thing. Here’s some Python code that generates random pairs of complex numbers and shows that the four expressions give he same distance.
import numpy as np
def d1(z1, z2):
return 2*np.arcsinh( abs(z1 - z2) / (2*(z1.imag * z2.imag)**0.5) )
def d2(z1, z2):
return np.arccosh(1 + abs(z1 - z2)**2 / (2*z1.imag * z2.imag) )
def d3(z1, z2):
return 2*np.arctanh( abs( (z1 - z2)/(z1 - np.conjugate(z2)) ) )
def d4(z1, z2):
return 2*np.log( (abs(z2 - z1) + abs(z2 - np.conjugate(z1)))/(2*np.sqrt(z1.imag * z2.imag)) )
np.random.seed(20251127)
for n in range(100):
z1 = np.random.random() + 1j*np.random.random()
z2 = np.random.random() + 1j*np.random.random()
assert( abs(d1(z1, z2) - d2(z1, z2)) < 1e-13 )
assert( abs(d2(z1, z2) - d3(z1, z2)) < 1e-13 )
assert( abs(d3(z1, z2) - d4(z1, z2)) < 1e-13 )
Perhaps you’re convinced that the four expressions are equal, but why should any of them be equivalent to the definition in the previous post?
The previous post pointed out that the metric is invariant under Möbius transformations. We can apply such a transformation to move any pair of complex numbers to the imaginary axis. There you can see that the cross ratio reduces to the ratio of the two numbers.
More generally, if two complex numbers have the same real part, the distance between them is the log of the ratio of their imaginary parts. That is, if

then

if x, y1, and y2 are real and y2 > y1 > 0.
Here’s a little Python code that empirically shows that this gives the same distance as one of the expressions above.
def d5(z1, z2):
assert(z1.real == z1.real)
return abs( np.log( z1.imag / z2.imag ) )
for n in range(100):
x = np.random.random()
z1 = x + 1j*np.random.random()
z2 = x + 1j*np.random.random()
assert( abs(d1(z1, z2) - d5(z1, z2)) < 1e-13 )
So now we have five expressions for the metric, all of which look different. You could slug out a proof that they’re equivalent, or get a CAS like Mathematica to show they’re equivalent, but it would be more interesting to find an elegant equivalence proof.
Update: Although the four expressions at the top of the post are analytically equal, they are not all equally accurate for numerical evaluation. I did a little testing and found the arctahn method to be the least accurate and the rest roughly equally accurate.