1
$\begingroup$

I am trying to integrate:

Integrate[(Exp[x]*(x^m)/((Exp[x] + 1)^2)), {x, -Infinity, Infinity}]

I know that for odd m the result is zero. How can I tell Mathematica that m is odd? Using Assumptions maybe?

$\endgroup$
  • $\begingroup$ Welcome to Mathematica.SE! Please format your posts in the future. Formatting instructions are displayed on the right of the edit box. $\endgroup$ – Szabolcs Jan 12 at 11:46
  • 4
    $\begingroup$ Yes, Assumptions -> m ∈ Integers && Mod[m, 2] == 1 $\endgroup$ – Edmund Jan 12 at 11:46
  • $\begingroup$ I'm curious for general forumla if m is even? $\endgroup$ – Mariusz Iwaniuk Jan 12 at 13:08
  • $\begingroup$ The same but the modulus must be set equal to zero. $\endgroup$ – ApolloRa Jan 12 at 13:09
  • $\begingroup$ But Mathematica can't find solution ? $\endgroup$ – Mariusz Iwaniuk Jan 12 at 13:09
3
$\begingroup$

Integrand is symmetric in x for odd m. Therefore integral must be zero. Write 2*m+1 (Element [m,Integers]) for odd integers.

integrand[x_] = (Exp[x]*(x^(2 m + 1))/((Exp[x] + 1)^2));

integrand[x] == -integrand[-x] // 
   FullSimplify[#, x \[Element] Reals && m \[Element] Integers] &

(*   True   *)

Edit

For even m, integral can be found with integer search engines from http://oeis.org/

(*    Integrate[(Exp[x]*(x^(2 m))/((Exp[x] + 1)^2)), 
                     {x, -Infinity, Infinity}] 
== (-2 + 4^m) Abs[BernoulliB[2 m]]*Pi^(2 m)    *)

tab = Table[
   Integrate[integrand[x, j], {x, -\[Infinity], \[Infinity]}], {j, 1, 
  20}];

tab2 = Table[(-2 + 4^m) Abs[BernoulliB[2 m]]*Pi^(2 m), {m, 1, 20}]

tab == tab2

(*  True    *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.