|
From: andre m. <and...@gm...> - 2023-05-16 18:37:03
|
FYI. simplify_sum gives for me a sum of 6 gamma_incomplete_lower terms with the help of https://mathworld.wolfram.com/IncompleteGammaFunction.html shouldn't e.g. gamma_incomplete_lower(4,-1) be computable exactly? I wonder what's the preferred way of exactly evaluating such integrals with Maxima? - Andre ----- $ rmaxima Maxima 5.45.1 https://maxima.sourceforge.io using Lisp SBCL 2.0.1-8.fc36 Distributed under the GNU Public License. See the file COPYING. Dedicated to the memory of William Schelter. The function bug_report() provides bug reporting information. (%i1) display2d : false; (%o1) false (%i2) load("simplify_sum"); (%o2) "/usr/share/maxima/5.45.1/share/solve_rec/simplify_sum.mac" (%i3) S : sum(sin(n*%pi/3)^3*cos(n*%pi/3)/n,n,1,inf); (%o3) 'sum((cos((%pi*n)/3)*sin((%pi*n)/3)^3)/n,n,1,inf) (%i4) h : ratsimp(simplify_sum(S)); (%o4) (3^(3/2)*'realpart(gamma_incomplete_lower(4,-1)) +3^(3/2)*%i*'imagpart(gamma_incomplete_lower(4,-1)) -3^(5/2)*'realpart(gamma_incomplete_lower(3,-1)) -3^(5/2)*%i*'imagpart(gamma_incomplete_lower(3,-1)) +3^(3/2)*'realpart(gamma_incomplete_lower(2,-1)) +3^(3/2)*%i*'imagpart(gamma_incomplete_lower(2,-1))) /8 (%i5) a:4; x:-1; hgfred([a],[1+a],-x); (%o5) 4 (%o6) -1 (%o7) 4*gamma_incomplete_lower(4,-1) ----- On 5/14/23 14:28, philippe wrote: > Hi, > > 3 years after our discussion about simplify_sum errors, I've found another example where maxima (and sagemath) fails to simplify a summation. Wolframalpha.com also fails to find the simplest expression (pi/16) but gives different closed forms and a numerical value compatible with it. Here is a minimal example showing the problem in maxima : > > 'S=S:sum(sin(n*%pi/3)^3*cos(n*%pi/3)/n,n,1,inf); > 'S=S:ratsimp(simplify_sum(S2)); /* false!*/ > S_exact:%pi/16; > S_num:float(sum(sin(n*%pi/3)^3*cos(n*%pi/3)/n,n,1,10000)); > S_exact=float(S_exact); > > you can check that the value given by simplify_sum is far from the numerical value, and this one is compatible with pi/16 (which has been obtained by Dirichlet Theorem for the Fourier series of some piecewise constant function): > > S= 3/8*sqrt(3)*e + 3/8*sqrt(3) = 2.4150948914066888 > S_exact= 1/16*pi = 0.19634954084936207 > S_num= 0.1965659389111564 > > I've added this example in comment to bug report 3630 : > > https://sourceforge.net/p/maxima/bugs/3630/ > > thanks for reading, > Philippe > > Le 07/04/2020 à 22:52, philippe a écrit : >> Hi, >> >> I want to check the limit of the following serie >> >> sum((k*sin((k*%pi)/3))/(4*k^2-1),k,1,inf) >> >> I know it converge to (sqrt(3)*%pi)/16=0.3400873807939158... >> >> simplify_sum find the limit in terms of erf(%i) but floating point >> approximation is far from the expected value : 2.564242426927912... >> >> I don't know if the problem comes from simplify_sum or floating point >> approximations of erf function, but there is no error for the similar serie >> >> sum(k*sin(k*%pi/2)/(4*k^2-1),k,1,inf)=sqrt(2)*%pi/16 >> >> if some one is interested in this problem here is a short piece of code >> to test it : >> >> load(simplify_sum)$ >> S2:sum(k*sin(k*%pi/3)/(4*k^2-1),k,1,inf)$ >> S2s:simplify_sum(S2)$ >> S2c:sqrt(3)*%pi/16$ >> print(S2,"=",S2s,"=",float(S2s)); >> print(S2,"=",S2c,"=",float(S2c)); >> >> thanks for reading, >> Philippe > > > > > _______________________________________________ > Maxima-discuss mailing list > Max...@li... > https://lists.sourceforge.net/lists/listinfo/maxima-discuss |