I have finished an implementation of integrals of the type
integrate(t^w*exp(-t^s)*log(t)^m,t,0,inf)
It works for m=0,1,2,3, ... and (w+1)/s > 0. The parameter m,w, and s
can be given symbolically.
(%i1) declare(m,integer)$
(%i2) assume(m>0,s>0,w>0)$
The most general result is:
(%i3) integrate(t^w*exp(-t^s)*log(t)^m,t,0,inf);
(%o3) s^(-m-1)*('at('diff(gamma(t),t,m),t = (w+1)/s))
This is a special case with m=1,w=0,s=1:
(%i4) integrate(exp(-t)*log(t),t,0,inf);
(%o4) -%gamma
Some more inegrals as an example:
(%i5) integrate(exp(-t)*log(t)^2,t,0,inf);
(%o5) %pi^2/6+%gamma^2
(%i6) integrate(exp(-t)*log(t)^3,t,0,inf);
(%o6) -2*zeta(3)-%gamma*%pi^2/2-%gamma^3
(%i7) integrate(exp(-t)*log(t)^4,t,0,inf);
(%o7) 8*%gamma*zeta(3)+3*%pi^4/20+%gamma^2*%pi^2+%gamma^4
(%i8) integrate(exp(-t^2)*log(t),t,0,inf);
(%o8) sqrt(%pi)*(-2*log(2)-%gamma)/4
(%i9) integrate(t*exp(-t^2)*log(t),t,0,inf);
(%o9) -%gamma/4
(%i10) integrate(t^-2*exp(-t^-2)*log(t),t,0,inf);
(%o10) -sqrt(%pi)*(-2*log(2)-%gamma)/4
(%i11) integrate(t^-2*exp(-t^-3)*log(t),t,0,inf);
(%o11) -gamma(1/3)*(-3*log(3)/2-%pi/(2*sqrt(3))-%gamma)/9
I have added the following to the routine defint
((and (zerop1 ll)
(eq ul '$inf)
(setq ans (defint-log-exp exp var)))
;; Found an integral of the type t^w*exp(-t^s)*log(t)^m
(return ans)))
This is the code to match the expression and to return the result:
;;; Recognize c*z^w*log(z)^m*exp(-t^s)
(defvar *debug-defint-log* nil)
(defun m2-log-exp-1 (expr)
(m2 expr
'((mtimes)
(c freevar)
((mexpt) (z varp) (w freevar))
((mexpt) $%e ((mtimes) -1 ((mexpt) (z varp) (s freevar))))
((mexpt) ((%log) (z varp)) (m freevar)))
nil))
(defun defint-log-exp (expr var)
(let ((x nil))
(cond
((setq x (m2-log-exp-1 expr))
(let ((c (cdras 'c x))
(w (cdras 'w x))
(m (cdras 'm x))
(s (cdras 's x)))
(cond ((and (maxima-integerp m)
(member ($sign m) '($pos $pz $zero))
(not (eq ($sign s) '$zero))
(eq ($sign (div (add w 1) s)) '$pos))
(mul c
(simplify (list '(%signum) s))
(power s (mul -1 (add m 1)))
($at ($diff (list '(%gamma) var) var m)
(list '(mequal)
var
(div (add w 1) s)))))
(t nil))))
(t nil))))
I have taken the algorithm from the paper "Evaluation of Classes of
Definite Integrals Involving Elementary functions via Differentiation of
Special Functions" by Geddes et. al.
The paper presents more algorithm. I would like to implement the other
general cases too.
There is one change:
Maxima already can integrate integrands like t^w*exp(-t^s). But if w and
s are not numbers Maxima tend do ask a lot of questions even when the
sign of the parameter is known to Maxima. I have not switched off this
cases from the new algorithm. Therefore we get this types of integrals
without any questions, when the sign of the parameter is known to
Maxima.
Any suggestions?
Dieter Kaiser