Bug ID: 640332 "Need to specdisrep more systematically"



I had a look at the bug report ID: 640332 "Need to specdisrep more
systematically".

As mentioned in the bug report it is perhaps only a small problem, but I
would like to close this bug report too.

I have not looked systematically into the code, but only taken the given
examples. These are the places we can improve:

1. in SDIFF

(defmfun sdiff (e x) ; The args to SDIFF are assumed to be simplified.
  (setq x (specrepcheck x)) ; Remove a special representation.

...
        ((eq (caar e) 'mrat) (ratdx e x))
        ;; Handle the diff of Poisson series in $poisdiff
        ((eq (caar e) 'mpois) ($poisdiff e x))
...

2. in $TAYLOR

(defmfun $taylor (e &rest args)
  (when (and (not (atom e)) (eq (caar e) 'mpois))
    ;; Remove a Poisson series representation.
    (setq e ($outofpois e)))
   (taylor* e args))

3. in FULLRATSIMP

(defun fullratsimp (l)
  (let (($expop 0) ($expon 0) (inratsimp t) $ratsimpexpons)
    (when (and (not (atom l)) (eq (caar l) 'mpois))
      ;; Remove a Poisson series representation.
      (setq l ($outofpois l)))
    (setq l ($totaldisrep l))
    (fr1 l varlist)))

These are the examples of the bug report:

(%i2) diff(rat(x),rat(x));
(%o2) 1
(%i3) diff(x,rat(x));
(%o3) 1
(%i4) diff(intopois(sin(u)),u);
(%o4) cos(u)
(%i5) taylor(intopois(sin(u)),u,0,3);
(%o5) u-u^3/6
(%i6) ratsimp(intopois(sin(u)));
(%o6) sin(u)

The following gives a wrong result, but this is a problem of the routine
$poisdiff which only works for very special expressions:

(%i7) diff(intopois(u),u);
(%o7) 0

I do not know much about Poisson series. It is a bit tedious to insert a
check for this special representation at a lot of places, perhaps we do
it only at the places above to close the bug report.

An alternative might be to add a warning about the use of poisson series
into the documentation and let the handling to be incomplete.

A useful addition is perhaps the specrecpcheck in sdiff for the variable
of derivation.

Dieter Kaiser