# Analytical evaluation of Fermi-Dirac integrals

It seems that sagemath is unable to calculate Fermic-Dirac type integrals, e. g.

integrate(x^2/(1+ e^x),x,0,oo) =>
limit(1/3*x^3 - x^2*log(e^x + 1) - 2*x*dilog(-e^x) + 2*polylog(3, -e^x), x, +Infinity, minus) + 3/2*zeta(3)

integrate(x^3/(1+ e^x),x,0,oo)==>
-7/120*pi^4 + limit(1/4*x^4 - x^3*log(e^x + 1) - 3*x^2*dilog(-e^x) + 6*x*polylog(3, -e^x) - 6*polylog(4, -e^x), x,
+Infinity, minus)


Normally, the former evaluates to (3Zeta)/2 and the latter to (7Pi^4)/120, using Mathematica.

edit retag close merge delete

1

A salty answer to another question about these integrals contains references for the symbolic evaluation. Sage (by default) uses Maxima for the evaluation of the integral, so maybe it is a good idea to implement those methods in Maxima.

Sort by » oldest newest most voted

Maxima (i.e. Sage) is perfectly able to find a primitive of your function,. For your second example, it gives :

sage: f(x)=x^2/(1+e^x)
sage: f(x).integrate(x)
sage: g(x)=f(x).integrate(x)
sage: g
x |--> 1/3*x^3 - x^2*log(e^x + 1) - 2*x*dilog(-e^x) + 2*polylog(3, -e^x)


This can be easily checked:

sage: g(x).diff(x).factor()
x^2/(e^x + 1)


Sage can find the limit at x=0...

sage: g(x).limit(x=0)
-3/2*zeta(3)


... but not at x=$\infty$:

sage: g(x).limit(x=oo)
limit(1/3*x^3 - x^2*log(e^x + 1) - 2*x*dilog(-e^x) + 2*polylog(3, -e^x), x, +Infinity)


Mathematica agrees with Sage for x=0...

sage: mathematica("Limit[x^3/3-x^2*Log[1+Exp[x]]-2*x*PolyLog[2,-Exp[x]]+2*PolyLo
....: g[3,-Exp[x]],x->0]")
(-3*Zeta)/2


And gives an answer for x=$\infty$:

sage: mathematica("Limit[x^3/3-x^2*Log[1+Exp[x]]-2*x*PolyLog[2,-Exp[x]]+2*PolyLo
....: g[3,-Exp[x]],x->Infinity]")
0


A quick numeric check (by comparison to numerical integration) lets us think that Mathamatica's answer is reasonable:

sage: numerical_integral(f(x),0,oo):
(1.8030853547394121, 5.780826801595601e-08)
sage: g(x).limit(x=0).n()
-1.80308535473939


Therefore, this is a bug. I'll check if this is already reported...

BTW, Sympy gives a wrong answer here :

sage: g(x).limit(x=oo, algorithm="sympy")
-Infinity


...but fails to find a primitive anyway:

sage: f(x).integrate(x, algorithm="sympy")
integrate(x^2/(e^x + 1), x)

more