# My integral doesn't evaluate

i'm doing something called Sommerfeld expansion i got somehelp online source i will show after code. Sommerfeld expansion to integrate Fermi-Dirac equation to find total number of particles N for energy i define to be x.

The problem is sometimes either of my integral eq1 or eq2 dosn't work! i need them to be evaluated. can someone help please! Thanks in advance.

Here is the code

Clear["Global*"]

f[x_] := 1/(Exp[(x - u)/(k*t)] + 1);

h[x] = -D[f[x], x];

g1 = Normal[Series[g[x], {x, u, 7}]];
g2 = Normal[Series[g[x], {x, u, 10}]];
g3 = g2 - g1;
G1 = Simplify[g1*h[x] /. {x -> u + k*t*y}];
G2 = Simplify[g3*h[x] /. {x -> u + k*t*y}];

eq1 = Simplify[k*t*Integrate[G1, {y, -Infinity, Infinity},
Assumptions -> {k > 0, t > 0}]]

eq2 = Simplify[k*t*Integrate[G2, {y, -Infinity, Infinity},
Assumptions -> {k > 0, t > 0}]]

f1 = PowerExpand[eq1 + eq2]


I just did the same! but no result!? the result should be given as in last lines here

• You're taking the Series expansion of g, which is undefined in your code. Is this intended, or is g actually supposed to be f? – march Apr 9 '19 at 20:18
• it's defined both g 1 and g 2 , f is something else in the beginning – Medo Apr 9 '19 at 20:19
• i edited and added some source code picture look at it – Medo Apr 9 '19 at 20:21
• I'm not sure why Mathematica is able to compute the first integral in one case but not another, but here's one thing you can do to ensure that it computes the integral. In the definition of eq1, do Integrate[#, {y, -Infinity, Infinity}, Assumptions -> {k > 0, t > 0}] & /@ Expand@G1 instead of Integrate[G1, {y, -Infinity, Infinity}, Assumptions -> {k > 0, t > 0}]. – march Apr 9 '19 at 20:29
• that's smart solved the problem – Medo Apr 9 '19 at 20:34

Integrate[#, {y, -Infinity, Infinity}, Assumptions -> {k > 0, t > 0}] & /@ Expand@G1

It also doesn't help to Expand` the integrand first, which is strange, since I figured that the symbolic pre-processing that Mathematica does would include using the linearity of the integral. (Although, I guess Mathematica can't assume this since there are some integrands for which the integral of each term diverges where the integral of the sum of the integrands does.)