limits of signum expressions



Here is a proposal for a simplim%signum function. Comments?

Return a nounform when nothing known about the limit point:

  (%i2) limit(signum(x),x,a);
  (%o2) 'limit(signum(x+a),x,0)

Returning a conditional expression instead of a nounform isn't all
that much of a simplification, I think.

When Maxima knows that the limit point is nonzero, use substitution to find
the limit

  (%i3) limit(signum(x),x,1/a);
  (%o3) signum(1/a)

  (%i4) limit(signum(x + a),x,inf);
  (%o4) 1

Harmless, I think:

  (%i5) limit(signum(x),x,%i);
  (%o5) signum(%i)

Two-sided limit toward 0 is undefined (the one-sided limits are defined)

  (%i8) limit(signum(x),x,0);
  (%o8) und

Bug due do limit(a*x,x,inf) --> infinity

  (%i6) limit(signum(a*x+b),x,inf);
  (%o6) signum(infinity)

The code

(setf (get '%signum 'simplim%function) 'simplim%signum)

(defun simplim%signum (e x pt)
  (let* ((e (limit (cadr e) x pt 'think)) (sgn (mnqp e 0)))
    (cond ((eq t sgn) (take '(%signum) e)) ;; limit of argument of signum
   is not zero
   ((eq nil sgn) '$und)             ;; limit of argument of signum is zero
   (noncontinuous)
   (t (throw 'limit nil)))))        ;; don't know

Also, I've appended the following to rtest_signum:

limit(signum(x),x,minf);
-1$

limit(signum(x),x,0,'minus);
-1$

limit(signum(x),x,0);
und$

limit(signum(x),x,0,'plus);
1$

limit(signum(x),x,inf);
1$

limit(x * signum(x),x,0);
0$

limit(signum(x+a),x,minf);
-1$

limit(signum(x+a),x,inf);
1$

(assume(notequal(a,0)),0);
0$

limit(signum(x),x,a);
signum(a)$

limit(signum(a*x),x,minf);
-signum(a)$

limit(signum(a*x),x,inf);
signum(a)$

limit(signum(x),x,1/a);
signum(1/a)$

Barton