Missing resimplify in lambert_w



> -----Urspr?ngliche Nachricht-----
> Von: David.Billinghurst at riotinto.com [mailto:David.Billinghurst at riotinto.com] 
> Gesendet: Mittwoch, 24. Dezember 2008 00:23
> An: Dieter Kaiser; maxima at math.utexas.edu
> Betreff: RE: [Maxima] Missing resimplify in lambert_w
>
>> From: Dieter Kaiser
>> 
>> Today, I had a long search for a subtle and small bug. 
>
> I hope it wasn't me. I have been extending, documenting 
> and testing the lambert_w code this week.

This bug gave me a change to learn even more about the integrator. At first I
have searched in the integrator for a bug until I have found an unsimplified
expression.

> I was impressed that with a couple of lines of code for the 
> 'integral property, and without touching code elsewhere,
> maxima now knows:
>
> (%i1) integrate(diff(f(x),x)*lambert_w(f(x)),x);
>                                 2
>                  f(x) (lambert_w (f(x)) - lambert_w(f(x)) + 1)
> (%o1)            ---------------------------------------------
>                                lambert_w(f(x))

I was astonished too how easy it is to extend the integrator. The lookup
mechanism could be used in general. The log function and the trigonomentric
functions are wired in the code. This could be completely removed and done by
the lookup mechanism.

> Great.  I am happy to do some detailed coding and testing for
> special functions.  I was looking at your new code last night 
> - trying to work out how to integrate Jacobi elliptic functions.  
> I didn't find a neat, general solution but it looked feasible.

One open point is to extend the integrator for functions with an abitrary number
of arguments and even lists as an argument (this would be needed for the
hypergeomtric functions, the differentiation algorithm can not handle a list as
an argurment too).

I think it is straight forward to implement, because it is clear what the result
has to be, but I have not started to do it.

> I was also wondering how to add a hook/property to integrate 
> (simple) expressions containing a special function, such as:
>  * integrate( sin(x)/x, x)
>  * integrate( x^(n+1).bessel_j(n,x), x)
>  * integrate( jacobi_sn(u,m)^n, dx)
>
> If we could search the expression for special functions and
> have a general, table-driven way of trying custom integration 
> routines.  Perhaps an 'integral-hook (or some better name) 
> property on %sin, %bessel_j .... that returns points to 
> a function with specialized knowledge.

I think all integrals which are not integrable but have to be represented by a
special function have to be looked up.

The natural place to do it, is within the Lisp function intform. Because at this
place we can use all the other wonderful technics which are implemented. As
described in the thesis of Moses, intform tries to find a clue and does the
necessary work to give a result or transform the integrand.

The algorithm of intform is highly recursive and quit tricky. But a direct
implementation of integrals like sin(x)/x would be easy. If you are interessed I
can try to implement some examples.

It is more work to find a more general (table-driven way) which allows the
extension of the integrator by the Maxima User too.

There are a lot of nice things which can be done.

Dieter Kaiser