The cmath.atanh() function returns the inverse hyperbolic tangent of a number. The input number can be complex or real but the returned value is always a complex number.

x The value(real or complex) whose inverse hyperbolic tangent we want.

The function returns a complex number representing the angle in radians whose hyperbolic tangent is .

import cmath

print(cmath.atanh(1 + 2j))
print(cmath.atanh(-2 + 2j))