Menu

#3973 limit of even function is different from plus or minus direction

None
not-a-bug
nobody
5
2022-05-10
2022-05-06
No

This limit is computed correctly:

(%i3) limit(log(4*sin(t)**2)-log(t**2), t, 0, plus);
(%o3)                               log(4)

This limit isn't:

(%i6) limit(log(4*sin(t)**2)-log(t**2), t, 0, minus);
(%o6)                         log(4) - 2 log(- 1)

(Observe that the function is even.)

Observed using

Maxima 5.45.1 https://maxima.sourceforge.io
using Lisp GNU Common Lisp (GCL) GCL 2.6.12

installed from Debian.

Discussion

  • Robert Dodier

    Robert Dodier - 2022-05-07
    • labels: --> limit, log
    • summary: Miscomputed limit --> limit of even function is different from plus or minus direction
     
  • Robert Dodier

    Robert Dodier - 2022-05-07

    I think this isn't a bug since it appears to coming from the action of logexpand which is true by default. Looking at the expression by itself,

    (%i6) log(4*sin(t)**2)-log(t**2);
                                        2
    (%o6)                      log(4 sin (t)) - 2 log(t)
    

    so, trying the limit again with logexpand = false,

    (%i7) log(4*sin(t)**2)-log(t**2), logexpand = false;
                                        2            2
    (%o7)                      log(4 sin (t)) - log(t )
    (%i8) limit(log(4*sin(t)**2)-log(t**2), t, 0, minus), logexpand = false;
    (%o8)                               log(4)
    

    seems to give the expected result.

     
  • Robert Dodier

    Robert Dodier - 2022-05-08

    @dgildea @macrakis can I ask you for a second opinion on this? As I was saying in the previous comment, I think it's not a bug.

     
    • Stavros Macrakis

      @robert_dodier, I agree completely. How is limit supposed to know that 2*log(t) came from log(t^2)?

      We could think about finer-grained settings for the logexpand flag, e.g., logexpand:'abs makes log(x^EVEN) => EVEN*log(abs(x)) (since everything is assumed real by default) and log(PZ^EXP) => EXP*log(PZ), but nothing else, but that's another issue.

       
  • Robert Dodier

    Robert Dodier - 2022-05-10
    • status: open --> not-a-bug
     
  • Robert Dodier

    Robert Dodier - 2022-05-10

    Marking this ticket as not a bug. Thanks, Stavros, for weighing in on the subject.

     

Log in to post a comment.