# Mystery Constant of Integration

Upon evaluating the integral

Integrate[Exp[-x^(2 n)] x^(2 k), {x, -\[Infinity], \[Infinity]},
Assumptions -> {n > 0, k > 0, (n | k) \[Element] Integers}]


I get the result ($Version="11.1.0 for Mac OS X x86 (64-bit) (March 16, 2017)") ConditionalExpression[ (((-1)^(2 n))^(-((1 + 2 k)/(2 n))) ((-1)^(2 k) + ((-1)^(2 n))^((1 + 2 k)/(2 n))) Gamma[(1 + 2 k)/(2 n)])/(2 n), C \[Element] Integers && n < 1/4 + C && C >= 1 && C < 1/4 + n]  My question is: what is C doing there? It's a definite integral, so there should be no constant of integration. Moreover, it doesn't show up in the "value" part of the ConditionalExpression. Putting the inequalities with n together just gives n < 1/2 + n, which is always true, so I think the only thing that it enforces is that (saturating the bound on C), 1 ≤ 1/4 + n so that n must be at least 1 (if it's going to be an integer). But I already told Mma that it's a positive integer, so in the end those conditionals should all be satisfied. So: what's the point of C in this result? As an added (but not super-important) follow-up, if I tell Mma that n and k are integers, why doesn't it simplify (-1)^(2 k) or the other squares of -1? # Update as of Version 13.0 As of $Version == "13.0.0 for Mac OS X x86 (64-bit) (December 3, 2021)" the result I get is

(((-1)^(2 n))^(-((1+2 k)/(2 n))) ((-1)^(2 k)+((-1)^(2 n))^((1+2 k)/(2 n))) Gamma[(1+2 k)/(2 n)])/(2 n)


which, at least, has eliminated the unneeded mystery constant. Of course, it's still not leveraging all of the assumptions, since

FullSimplify[%,
Assumptions -> {n > 0, k > 0, (n | k) \[Element] Integers}]


yields Gamma[(1+2 k)/(2 n)]/n.

So, why doesn't Integrate actually leverage the assumptions?

• the C is not an integration constant, it is part of the conditional on n May 30, 2017 at 17:12
• Why is there an arbitrary constant introduced in order to formulate a conditional on n that's redundant with what I already specified? May 30, 2017 at 17:15
• IDK. It is redundant, it says n must be +/- 1/4 of an integer >=1 , ie true for all integers > 0. FWIW v10.1 just gives the (unsimplified) expression, not conditional. May 30, 2017 at 17:29
• So, what's the point of C in the result? Also it doesn't say n must be ±1/4 of an integer, since C need not be an integer. May 30, 2017 at 18:41
• If it's changed since v10.1, that's also a mystery! May 30, 2017 at 18:42

In:

Assuming[{n > 0 && k > 0 && {n, k} \[Element] Integers},
Integrate[Exp[-x^(2 n)] x^(2 k), {x, -\[Infinity], \[Infinity]}]]


Out: If anyone is interested in it, you can check the implemention.

Needs["GeneralUtilities"]
PrintDefinitions[Integrate]
PrintDefinitions[Assuming]

• I get the same result, using Assuming rather than Assumptions->. Why the difference? May 30, 2017 at 17:16
• Assuming seems to apply an extra simplify step. May 30, 2017 at 17:25
• I alway prefer Assuming. I guess Assumptions failed me many times. Integrate always ask Assumptions to shut it up. i.stack.imgur.com/22OdB.png May 30, 2017 at 17:48
• What Integrate does with Assumptions is, in my opinion, far the safer handling in general. May 30, 2017 at 18:31

I believe the C comes from this:

Reduce[k > 0 && n > 0 && Re[(-1)^(1 + 2 n)] < 0, Complexes]
Simplify[%, (k | n) ∈ Integers && k >= 1 && n >= 1]
(*
C ∈ Integers &&
k > 0 && (0 < n < 1/4 || (C >= 1 && 1/4 (-1 + 4 C) < n < 1/4 (1 + 4 C)))
C ∈ Integers && C >= 1 && C < 1/4 + n && n < 1/4 + C
*)


One can get the Reduce commands used in Integrate[] with this:

Trace[
Integrate[Exp[-x^(2 n)] x^(2 k), {x, -∞, ∞},
Assumptions -> {n > 0, k > 0, (n | k) ∈ Integers}],
_Reduce,
TraceInternal -> True]


It's hard to say exactly what Reduce is being used for beyond the easy guess that it has something to do with convergence.

The follow-up question about simplifying (-1)^(2 k) is a key to another workaround:

Integrate[Exp[-x^(2 n)] x^(2 k), {x, -∞, ∞},
Assumptions -> {n > 0, k > 0, (n | k) ∈ Integers, (-1)^(2 k) == 1, (-1)^(2 n) == 1}]
(*  Gamma[(1 + 2 k)/(2 n)]/(2 n)  *)


And Mathematica can simplify (-1)^(2k):

Simplify[{(1)^(2 k), (-1)^(1 + 2 k)}, k ∈ Integers]
(*  {1, -1}  *)


Simplify uses the assumptions from \$Assumptions, which are added to by Assuming`; it is probably why @UnchartedWorks's workaround works, and perhaps why @Daniel warns against it.

Some related Q&A:

Usage of Assuming for Integration

Solution to a specific problem caused by generic simplification

Simplify is excluding indeterminate expression from output

What is a "generic case"?