acos(0) simplifies to %pi/2, but acosh(0) stays a nounform, so limit(asech(x),x,inf) prints as acosh(0) rather than %i*%pi/2. Between -1 and 1, the argument lies on acosh's branch cut, where acosh(y) = %i*acos(y), so acosh can answer wherever acos's table of special values does:
acosh(0) = %i*%pi/2 acosh(-1) = %i*%pi
acosh(1/2) = %i*%pi/3 acosh(-1/2) = 2*%i*%pi/3
acosh(1/sqrt(2)) = %i*%pi/4 acosh(sqrt(3)/2) = %i*%pi/6
I guess this is kind of an historical artifact where Maxima worked with real numbers instead of complex. Also note that
acos(2)returns the noun form, but a call torectformwill give-(%i*log(2-sqrt(3))).Also
rectform(acosh(0))returns%i*%pi/2.What is my point? Not sure, but I think we should be consistent here so if we're going to simplify acosh(0), we should also simplify acos(2). However, I think I'd prefer to use
rectformto get the complex value.I'd restrict it to the values that
acossimplifies automatically.I think I'd prefer to keep existing behavior where only real results are returned. (Is that true for other elementary functions? I don't know.)
But maybe ask on the mailing list for a consensus since we disagree?
We have
sqrt(-2)->%i*sqrt(2), if that's some kind of precedent. And we haveli[2](2)->%pi^2/4-%i*%pi*log(2)(not elementary).I don't have strong feelings for or against it, it just came up when
limit(asech(x),x,inf)returnedacosh(0).Maxima's general rule seems to be that
f(%i*v)returns a different form if that form is "simple".So for example
sin(%i*x) => %i*sinh(x).But not when the form is messy, big or hard to understand, so
asinh(%i*x), log(%i*x), ...do not expand by default. Results involvingatan2are particularly problematic.The case
acos(2) => -(%i*log(2-sqrt(3)))seems somewhat messy/big, so it's not clear. But bothlogarcandrectformare available to expand it.I tend to think that the current behavior is OK, but I don't feel strongly about it.