rtoy / maxima

A Clone of Maxima's repo
Other
0 stars 0 forks source link

unsimplified antiderivative #3136

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 14:52:40 Created by willisbl on 2013-05-24 11:34:19 Original: https://sourceforge.net/p/maxima/bugs/2580


::: text
(%i3) integrate(a^(d*z)*h^(c*z),z);
"Is  "log(a)*d*(c*log(h)+log(a)*d)"  zero or nonzero?"nonzero;
(%o3) (a^(d*z))^((c*log(h))/(log(a)*d)+1)/(log(a)*d*((c*log(h))/(log(a)*d)+1))

%o3 is unsimplified:

(%i4) expand(%,0,0);
(%o4) (a^(d*z))^((c*log(h))/(log(a)*d)+1)/(log(a)*((c*log(h))/(log(a)*d)+1)*d)
rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 14:52:41 Created by rswarbrick on 2013-05-27 18:40:19 Original: https://sourceforge.net/p/maxima/bugs/2580/#5017


(Bug reported edited to tell Sourceforge that this is a code block)

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 14:52:44 Created by rswarbrick on 2013-05-27 19:07:17 Original: https://sourceforge.net/p/maxima/bugs/2580/#3dee


I've looked into this a little bit. The bit of code that should be simplifying the result is superexpt in sin.lisp, which calls $multthru. Unfortunately, this doesn't work in this case because the things that should be multiplied through are denominators. See this example:

:::text
(%i42) multthru(log(a)*d*(c*log(h)/(log(a)*d)+1));
(%o42)                        c log(h) + log(a) d
(%i43) multthru(1/(log(a)*d*(c*log(h)/(log(a)*d)+1)));
                                       1
(%o43)                      -----------------------
                                      c log(h)
                            log(a) d (-------- + 1)
                                      log(a) d

Basically, this runs afoul of the "$multthru ignores exponents" rule.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 14:52:48 Created by rswarbrick on 2013-05-27 19:09:58 Original: https://sourceforge.net/p/maxima/bugs/2580/#f358


A simpler example showing the same behaviour:

:::text
(%i53) multthru(a*(1/a+1));
(%o53)                               a + 1
(%i54) multthru(1/(a*(1/a+1)));
                                       1
(%o54)                             ---------
                                    1
                                   (- + 1) a
                                    a
rtoy commented 2 months ago

Imported from SourceForge on 2024-07-07 14:52:51 Created by robert_dodier on 2013-06-17 03:42:43 Original: https://sourceforge.net/p/maxima/bugs/2580/#168f