[Maxima] Further Improvements of bessel_j

Dieter Kaiser drdieterkaiser at web.de
Sun Apr 20 16:41:33 CDT 2008

```I implemented the constants INFINITY, MINF and INF because it seems to me
natural to you use the known constants for the special cases.

For bessel_y I get the following values with the changed code:

bessel_y(0,0.0)    --> minf
bessel_y(2,0.0)    --> infinity
bessel_y(1+%i,0.0) --> infinity

Limit gives the same values:

limit(bessel_y(0,x),x,0)    --> minf
limit(bessel_y(2,x),x,0)    --> infinity
limit(bessel_y(1+%i,x),x,0) --> infinity

For the special case of a purely imaginary order the function is not defined for
arg = 0.0. So I implemented a domain-error.

Bessel_y(%i,0.0) --> domain-error

(I have not found a documentation for other constants which I could use. Now I
have seen that we have '\$UND und '\$IND.)

The other Bessel functions are implemented in a similar manner. So I don't know
the problems which could arise in Maxima if we implement these constants as
return-values.

The function cot is interesting. I get

cot(0)              --> domain-error
limit(cot(x),x,0)   --> und

cot(%pi),numer      --> -8.165 e+15 (should be a domain-error too)
limit(cot(x),x,%pi) --> und

You are right with your hint that a change of bessel_i to use the continuation
formula is only a question of accuracy. So I will do a test.

I think that the implementation of the scaled Bessel functions aren't that
important too. Today, I have tried a routine which calculate the scaled values
for negative order and arg. Because of the connections of the different Bessel
functions one has to implement scaled versions for all other Bessel functions
too. That duplicates the code. Perhaps it is enough to give the Maxima-User

At the moment I have no idea how to implement the Bessel functions for complex
order. I think for complex order completly new numerical approximation routines
have to be written.

D. Kaiser

-----Ursprüngliche Nachricht-----
Von: toy.raymond at gmail.com [mailto:toy.raymond at gmail.com]
Gesendet: Sonntag, 20. April 2008 21:17
An: Dieter Kaiser
Cc: maxima at math.utexas.edu
Betreff: Re: [Maxima] Further Improvements of bessel_j

Dieter Kaiser wrote:
> I have implemented the improvemtents suggested for bessel_j for the other
Bessel
> functions too.
>

I'll integrate these changes soon.   Thanks for working on this!
> 1.
> Complete handling of the different cases of zero argument.
> The return values includes the constants INF, MINF and INFINITY. Is that
useful
> for Maxima?
>
> With this changes you get e.g.
>
> limit(bessel_y(2,x),x,0) ---> INFINITY
> limit(bessel_k(0,x),x,0) ---> INF
>
>
As limits, these are good.  Not quite sure about the first though.  I
think Maxima usually assumes real limits, so maybe und or ind would be
better.

What does maxima say without the limit?   That is bessel_k(0,0) -> ?
And bessel_y(2,0)?

> There is one open question for me. For negative arg we use the analytic
> continuation formulars. The exception is bessel_i. For this case we use for
> negative arg the definition and calculate the values with the help of the
> bessel_j function. So the algorithm is more simple in this case, but it may be
> better to implement the continuation formula too.
>
I suspect the formula used was whatever seemed easiest to implement or
understand.  Or maybe even whatever formula came first in A&S.

If there's a case where the continuation formula is more accurate or
something, then we should change it.  If not, then there's no pressing
reason.

Ray

```