rtoy / maxima

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

Simplification/Infinite sum #2595

Open rtoy opened 2 months ago

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:08:43 Created by chrisrein on 2012-06-15 14:05:32 Original: https://sourceforge.net/p/maxima/bugs/2424


Enter in Maxima:

simplify_sum(sum(n^2/(2*n)!,n,1,inf));

Maxima returns:

(sqrt(%pi)*(sqrt(2)*bessel_i(3/2,1)+2^(3/2)*bessel_i(1/2,1)))/8

Maxima should return: %e/4

build_info("5.27.0","2012-04-24 08:52:03","i686-pc-mingw32","GNU Common Lisp (GCL)","GCL 2.6.8")

Regards

Chris

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:08:44 Created by rtoy on 2012-06-15 17:51:58 Original: https://sourceforge.net/p/maxima/bugs/2424/#893e


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:08:48 Created by rtoy on 2012-06-15 17:51:58 Original: https://sourceforge.net/p/maxima/bugs/2424/#ed41


expand(exponentialize(ev(%,besselexpand=true))) -> %e/4

I only knew to try this because bessel_i with half integer orders have representations in elementary functions, which you get by setting besselexpand to true.

Marking as pending/wontfix

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:08:51 Created by chrisrein on 2012-06-16 11:19:57 Original: https://sourceforge.net/p/maxima/bugs/2424/#eea3


Thanks for your help!

Yes, if you are a specialist, it’s quite simple. If not, you have a problem. First you notice that all simplifications in the pull down menu of wx Maxima fail. Then you have to read a chapter about Bessel functions until you find “besselexpand”. After applying “besselexpand”, Maxima returns a sum of hyperbolic functions. Now you need “exponentialize” to get a sum of e functions and finally you see %e/4.

Why do I have to do all these things? If I enter sum(n^2/(2*n)!,n,1,inf) in Wolfram Alpha I immediately get the correct result.

<marking as pending/wontfix> Ok.

Thanks again

Chris

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:08:55 Created by chrisrein on 2012-06-16 11:19:57 Original: https://sourceforge.net/p/maxima/bugs/2424/#702d


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:08:58 Created by rtoy on 2012-06-20 07:00:57 Original: https://sourceforge.net/p/maxima/bugs/2424/#9aff


I think it's very hard in general to know what the right answer should be. Yes %e/4 is a very simple answer. But sometimes it's also nice to know that the sum can be expressed in terms of bessel_i, which might lead to insight into other similar sums. If maxima simplified to %e/4, you wouldn't know about bessel_i, possibly missing out on the insight.

But it's also nice to know that maxima can simplify the result to %e/4, for the case where you don't care about the insight. :-)

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:09:01 Created by robert_dodier on 2023-05-04 03:54:51 Original: https://sourceforge.net/p/maxima/bugs/2424/#7880


rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:09:05 Created by robert_dodier on 2023-05-04 03:54:52 Original: https://sourceforge.net/p/maxima/bugs/2424/#88fa


Looks like the reported result is correct, although it's clumsy.

At present, the result is (sinh(1) + cosh(1))/4 which is equivalent to %e/4, and not too much more complicated; ev((sinh(1) + cosh(1))/4, exponentialize); ratsimp(%); yields %e/4. (I agree those steps are kind of clumsy too.)

Closing this as not-a-bug since the result isn't incorrect, although it could be more concise.

rtoy commented 2 months ago

Imported from SourceForge on 2024-07-06 16:09:09 Created by macrakis on 2023-05-04 16:55:56 Original: https://sourceforge.net/p/maxima/bugs/2424/#88fa/d427


No need for the dangerous ev(il) -- simply ratsimp(exponentialize(...)) works. Actually pretty much any simplification operation will work: ratsimp, factor, expand, rat -- even trigrat.