Neatly indent mbinding in defgrad gamma_incomplete
A note. The assume(b>0) is important. Without it, you just get the noun form for the derivative.
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?
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 to rectform will 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 rectform to get the complex value.
Sounds good. I do wonder now if the existing radcans cause issues. Seems that it's ok. There aren't a lot (if any?) issues on rischint producing bad answers. But haven't checked the bug list in a while for this. The mailing list does have examples of radcan simplifying things to zero, but you wouldn't get that by hand because you wouldn't choose those branch cuts.
The commit says you used radcan. Are you sure that's right? radcan sometimes chooses an unexpected branch which is sometimes wrong. I have a vague memory that I removed calls to radcan in various places because that's what was happening to produce incorrect results.
Good question. I think I prefer your solution because acoth(x) is real only when abs(x) >= 1. For kicks, I tried integrate(acoth(x),x,1,t): (%i22) integrate(acoth(x),x,1,t); Is t - 1 positive, negative or zero? pos; Evaluation took 0.0400 seconds (1.8600 elapsed) using 2.560 MB. 2 1 log(t - 1) + 2 atanh(─) t + %i %pi t %i %pi (%o22) ─────────────────────────────────── - log(2) - ────── 2 2 (%i23) expand(%); Evaluation took 0.0000 seconds (0.0000 elapsed) using 12.617 KB. 2 log(t - 1) 1 (%o23) ───────────...
We should document the gcd variable. gcd: default throws an error that it's not valid, of course. But doesn't say what would be valid, and there's no way a user can know what would be valid. So two things: document the variable and fix up the error message to give a hint on what's valid.