Hello,
In the description below you can find an error, which occurs for a Rational function of exponent argument. Do I miss anything?
Followed the instruction and attached the problem description below. Hope it is readable now.
Still, in my opinion it looks not as good as the original code in Mathematica
(e.g. fractions are without horizontal lines, no symbolic representation for 'Pi' and 'Infinity').
1. Integrate the following
Integrate[Exp[a x]/(1 + Exp[b x])^2, {x, -\[Infinity], \[Infinity]}, Assumptions -> 2 b > a && a > 0]
to obtain
((-a + b) \[Pi] Csc[(a \[Pi])/b])/b^2
The resulting expression coincides with the known formula in integration books (e.g. Gradshtein & Ryshik)
2. Now let us consider the more general integral
Integrate[Exp[a x]/(1 + Exp[b x])^c, {x, -\[Infinity], \[Infinity]},
Assumptions -> b c > a && a > 0 && b > 0]
to obtain
Hypergeometric2F1[a/b, c, (a + b)/b, -1]/a +
Hypergeometric2F1[c, -(a/b) + c, 1 - a/b + c, -1]/(-a + b c)
As internal check choose the previous c = 2 value.
c = 2; FullSimplify[
Hypergeometric2F1[a/b, c, (a + b)/b, -1]/a +
Hypergeometric2F1[c, -(a/b) + c, 1 - a/b + c, -1]/(-a + b c)
]
to obtain
((-a + b) \[Pi] Csc[(a \[Pi])/b])/b^2
the latter concides with case 1.
Now the error.
3. Remove the assumptions in case 2
Integrate[Exp[a x]/(1 + Exp[b x])^c, {x, -\[Infinity], \[Infinity]}]
to obtain
ConditionalExpression[-(Hypergeometric2F1[a/b, c, (a + b)/b, -1]/a) +
Hypergeometric2F1[c, -(a/b) + c, 1 - a/b + c, -1]/( a - b c),
(Re[(-1)^(-1/b)] >= 1 ||
Re[(-1)^(-1/b)] <= 0 || (-1)^(-1/b) \[NotElement]
Reals) && (Re[(-1)^(1/b)] >= 1 ||
Re[(-1)^(1/b)] <= 0 || (-1)^(1/b) \[NotElement] Reals) &&
Re[b] < 0 && Re[a - b c] < 0 && Re[a] > 0]
The first term acquires now an additional minus sign
Insert c = 2 to compare with case 2 considered above
c = 2;
FullSimplify[-(Hypergeometric2F1[a/b, c, (a + b)/b, -1]/a) +
Hypergeometric2F1[c, -(a/b) + c, 1 - a/b + c, -1]/(a - b c)]
to obtain
((a - b) \[Pi] Csc[(a \[Pi])/b])/b^2
It differs from case 2 by a minus sign!
To summarize, the same integrals (cases 1 and 3), were obtained by two different paths and yield two different results.
'Pi' and 'Infinity' didn't appear as symbolic when I pasted the code. It appeard as symbolic only after I pressed the "Publish" button.
The fraction lines are still not horizontal as in original file.