# 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[1] \[Element] Integers && n < 1/4 + C[1] && C[1] >= 1 && C[1] < 1/4 + n]  My question is: what is C[1] 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 ≤ 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[1] 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[1] is not an integration constant, it is part of the conditional on n Commented 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? Commented 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. Commented May 30, 2017 at 17:29
• So, what's the point of C[1] in the result? Also it doesn't say n must be ±1/4 of an integer, since C[1] need not be an integer. Commented May 30, 2017 at 18:41
• If it's changed since v10.1, that's also a mystery! Commented 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? Commented May 30, 2017 at 17:16
• Assuming seems to apply an extra simplify step. Commented 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.sstatic.net/22OdB.png Commented May 30, 2017 at 17:48
• What Integrate does with Assumptions is, in my opinion, far the safer handling in general. Commented May 30, 2017 at 18:31

I believe the C[1] comes from this:

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


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"?