Integral of the hypergeometric function



Am Sonntag, den 15.11.2009, 22:47 +1100 schrieb David Billinghurst:
> The following code allows maxima to integrate the hypergeometric function.
> hypergeometric([a1,...,ap],[b1,...,bq],z).  It is added to
> share/hypergeometric/hypergeometric.lisp.
> 
> At present it returns a "Division by 0" error if any of ai are equal to one.
> Is this too harsh?  I really don't see the value in giving a different 
> error message.
> 
> ######
> 
> (defun hyp-integral-3 (a b z)
>   "Integral of hypergeometric(a,b,z) wrt z"
>   (let ((a-1 (add a -1))
>         (b-1 (add b -1)))
>     (mul (reduce #'mul (margs b-1))
>          (inv (reduce #'mul (margs a-1)))
>          (take '($hypergeometric) a-1 b-1 z))))
> 
> ;;Integral of hypergeometric(a,b,z).  Only defined for third arg z.
> (putprop '$hypergeometric `((a b z) nil nil ,#'hyp-integral-3) 'integral)
> 
> #####
> 
> (%i1) integrate(hypergeometric([],[2],z),z);
> (%o1)                     hypergeometric([], [1], z)
> (%i2) integrate(hypergeometric([i,j],[3],z),z);
>                    2 hypergeometric([i - 1, j - 1], [2], z)
> (%o2)              ----------------------------------------
>                                (i - 1) (j - 1)
> (%i3) integrate(hypergeometric([1],[2],z),z);
> 
> Division by 0
>  -- an error. To debug this try: debugmode(true);

I have no strong opinion on this topic. But, I would prefer to check the
parameters to be valid and return a noun form if not.

Dieter Kaiser