Menu

#3994 limits of some gamma_incomplete expressions

open
nobody
5
2022-06-23
2022-06-23
No

I think the true value of this limit is zero:

(%i1) limit(x*gamma_incomplete(1/2,x^2+%i*x),x, inf);

limit: variable must be a symbol or subscripted symbol; found: sin(x)

This similar limit is OK, I think:

(%i14) limit(x*gamma_incomplete(1,x^2+%i*x),x, inf);
(%o14)                                 0

Discussion

  • Barton Willis

    Barton Willis - 2022-06-23

    We can make this bug "go away" by changing the call to $limit in gamma-upper-trans to a call to limit-catch

    Calling limit-catch is some what different than calling $limit. And maybe the true bug is somewhere else--that is, gamma-upper-trans never should have been called with the arguments that give rise to this bug.

    But I think this fix is likely harmless?

    (defun gamma-upper-trans (arg func)
      (let ((s (car arg))
        (z (cadr arg)))
        (if (and
         (eq ($sign s) '$pos)
         (zerop1 (limit-catch z (caar tlist) (exp-pt (car tlist)))))
        (taylor2 `((mplus) ((%gamma) ,s)
               ((mtimes) -1 ((%gamma_incomplete_lower) ,s ,z))))
        (taylor2 (diff-expand `((,func) . ,arg)
                      tlist)))))
    
     
  • Barton Willis

    Barton Willis - 2022-06-23
    • Group: None --> Includes_proposed_fix
     
  • Barton Willis

    Barton Willis - 2022-06-23

    Better patch is to use the errcatch macro:

    (defun gamma-upper-trans (arg func)
      (let ((s (car arg))
        (z (cadr arg)))
        (if (and
         (eq ($sign s) '$pos)
         (zerop1 (car (errcatch ($limit z (caar tlist) (exp-pt (car tlist)))))))
        (taylor2 `((mplus) ((%gamma) ,s)
               ((mtimes) -1 ((%gamma_incomplete_lower) ,s ,z))))
        (taylor2 (diff-expand `((,func) . ,arg)
                      tlist)))))
    

    Thanks to Kris Katterjohn for reminding me about this macro.

     
  • Robert Dodier

    Robert Dodier - 2022-06-23

    Thanks for working on it, I agree ERRCATCH is a good solution.

     

Log in to post a comment.