The simplim%function the incomplete gamma function uses direct
substitution (that is, limit(f(x),x,a) = f(a)) in cases where I think
it should not.
Deleting the direct substitution case from simplim%gamma_incomplete gives (OK, I think)
(%i10) integrate(sin(x)/x^2,x,1,inf);
(%o10) -(gamma_incomplete(-1,%i)+gamma_incomplete(-1,-%i))/2
(%i11) float(%);
(%o11) 0.50406706190693
But also the bogus:
(%i14) integrate(sin(x)/x^4,x,1,b);
"Is "b-1" positive, negative, or zero?"pos;
(%o14) 0
So deleting the direct substitution case isn't correct.
--bw
(defun simplim%gamma_incomplete (expr var val)
;; Look for the limit of the arguments.
(let ((a (limit (cadr expr) var val 'think))
(z (limit (caddr expr) var val 'think)))
(cond
((eq z '$infinity) ;; http://dlmf.nist.gov/8.11#i
(cond ((and (zerop1 ($realpart (caddr expr)))
(eq ($csign (m+ -1 (cadr expr))) '$neg))
0)
(t (throw 'limit t))))
;; Handle an argument 0 at this place.
((or (zerop1 z)
(eq z '$zeroa)
(eq z '$zerob))
(let ((sgn ($sign ($realpart a))))
(cond ((zerop1 a) '$inf)
((member sgn '($neg $nz)) '$infinity)
((eq sgn '($pos)) ($gamma a))
;; Call the simplifier of the function.
(t (simplify (list '(%gamma_incomplete) a z))))))
(t
nil))))
;; All other cases are handled by the simplifier of the function.
;;(simplify (list '(%gamma_incomplete) a z))))))