Spotted by Gemini.
(%i1) integrate(acoth(x), x);
(%o1) log(1-x^2)/2+x*acoth(x)
acoth(x) is real for abs(x) > 1. But then log(1-x^2) becomes complex.
Change the antiderivative to log(x^2-1)/2+x*acoth(x) to make it real where acoth(x) is real. Bonus: Differentiating this directly gives acoth(x) without further manipulation.
I'm a bit hesitant about this because having both
atanh(x)andacoth(x)uselog(1-x^2)probably has some advantages. But for people using Maxima for "real" calculus, this may seem like a bug. Opinions?Good question. I think I prefer your solution because
acoth(x)is real only whenabs(x) >= 1.For kicks, I tried
integrate(acoth(x),x,1,t):Rather messy, but Maxima can differentiate this and get
atanh(1/t). At least this useslog(t^2-1), so, that's some hint that your solution is better.