Am Samstag, den 03.09.2011, 08:18 -0500 schrieb Barton Willis:
> Shouldn't limit dispatch the simplim%function earlier? Consider
>
> (%i8) :lisp(trace simplim%bessel_j)
> (SIMPLIM%BESSEL_J)
>
> These cases do not dispatch the simplim%function (what mechanism decides that bessel_j is continuous?)
>
> (%i8) limit(bessel_j(0,x),x,a);
> (%o8) bessel_j(0,a)
>
> (%i9) limit(bessel_j(0,x),x,0);
> (%o9) 1
>
> (%i10) limit(bessel_j(a,x),x,0);
> (%o10) bessel_j(a,0)
>
> (%i11) limit('(bessel_j(a,x)),x,a);
> (%o11) bessel_j(a,a)
>
> Finally, limit dispatches simplim%bessel_j
>
> (%i12) limit(bessel_j(a,x),x,inf);
> 1> (SIMPLIM%BESSEL_J ((%BESSEL_J SIMP) $A $X) $X $INF)
> <1 (SIMPLIM%BESSEL_J 0)
> (%o12) 0
>
> How can I prevent the limit from assuming continuity and call the simplim%function?
>
> --Barton (who was trying to get limits to work for the generalized Lambert function)
The above limits are calculated in the function simplimit. The function
simplimit first calls the functions simplimsubst, which returns the
results from above. This is a trace:
(%i2) limit(bessel_j(0,x),x,a);
0: (SIMPLIMIT ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A #:G1056)) #:G1056
$ZEROA)
1: (SIMPLIMSUBST $ZEROA ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A
#:G1056)))
1: SIMPLIMSUBST returned ((%BESSEL_J SIMP) 0 $A)
0: SIMPLIMIT returned ((%BESSEL_J SIMP) 0 $A)
0: (SIMPLIMIT ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A #:G1056)) #:G1056
$ZEROB)
1: (SIMPLIMSUBST $ZEROB ((%BESSEL_J SIMP) 0 ((MPLUS SIMP) $A
#:G1056)))
1: SIMPLIMSUBST returned ((%BESSEL_J SIMP) 0 $A)
0: SIMPLIMIT returned ((%BESSEL_J SIMP) 0 $A)
(%o2) bessel_j(0, a)
For the following functions simplimsubst is not called:
sin, cos, atanh, cosh, sinh, tanh, factorial, and log
These functions have special code to get the limit. Perhaps it is the
best to check first for a simplim%function, which should handle all
special cases.
By the way: The special handling of some functions in simplimit can be
reimplemented as a simplim%function. This approach would be much
clearer.
Dieter Kaiser