# Is it possible to use an assumption that a parameter is an odd or even number?

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?

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

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    *)