On Dec 11, 10:59 pm, achrzesz <achrz...@wp.pl> wrote: > On Dec 11, 7:30 pm, achrzesz <achrz...@wp.pl> wrote: > > > > > sage: N(pi^2/6, digits=17) > > 1.6449340668482264 > > sage: numerical_integral(x/(exp(x)-1),0,oo) > > (1.6449340668482264, 5.9356452836178026e-10) > > > On Dec 11, 6:45 pm, "andres.ordonez" <andres.felipe.ordo...@gmail.com> > > wrote: > > > > That'll do. Thanks > > > > On Dec 10, 8:19 pm, Renan Birck Pinheiro <renan.ee.u...@gmail.com> > > > wrote: > > > > > 2011/12/10 andres.ordonez <andres.felipe.ordo...@gmail.com> > > > > > > Hi, I'm having trouble evaluating this integral > > > > > > integral( x / (exp(x) - 1) , (x,0,oo)).n() > > > > > > I get > > > > > > TypeError: cannot evaluate symbolic expression numerically > > > > > > The answer (according to mathematica) should be pi^2 / 6 > > > > > > Is something wrong with my code? > > > > > > Thanks! > > > > > Apparently it stumbles upon a limit which Maxima is incapable of doing. > > > > > sage: integrate(x/(exp(x)-1),(x,0,oo)) > > > > -1/6*pi^2 + limit(-1/2*x^2 + x*log(-e^x + 1) + polylog(2, e^x), x, > > > > +Infinity) > > > > > if oo is replaced by a very large number, seems to work... > > > > > sage: (real_part(integrate(x/(exp(x)-1),(x,0,1000)).n()) - (pi^2/6)).n() > > > > -4.41002789841605e-11 > > > > > -- > > > > Renan Birck Pinheiro - Grupo de Microeletrônica > > > > <http://www.ufsm.br/gmicro>- Engenharia > > > > Elétrica <http://www.ufsm.br/cee>/UFSM <http://www.ufsm.br> > > > > >http://renanbirck.blogspot.com/skype:renan.ee.ufsm > > Using the geometric series one can obtain > > x/(e^x-1)=xe^(-x)/(1-e^(-x))=\sum_0^\infty x(e^(-(k+1)x) > > Integrating term by term > > sage: var('k x') > sage: maxima('assume(k>-1)') > [k>-1] > sage: maxima('integrate(x*exp(-(k+1)*x),x,0,inf)') > 1/(k+1)^2 > > one can obtain the exact integral > > sage: sum(1/k^2,k,1,oo) > 1/6*pi^2 > > Andrzej Chrzeszczyk
Maxima knows the expansion: sage: maxima('powerseries(x*exp(-x)/(1-exp(-x)),exp(-x),0)') x*%e^-x*'sum(%e^-(i1*x),i1,0,inf) Andrzej Chrzeszczyk -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org