# Wrong constant outside of gamma function when integrating $e^{x^n}$?

$$\int e^{x^n}\text{ d}x$$ We use the substitution $$t = -(x^n),\qquad \frac{dt}{dx}=-n x^{n-1}\Longleftrightarrow x=(-t)^{\frac1n},\qquad dx = -\frac1n x^{1-n}dt$$ We perform the substitution and get $$\int e^{\left((-t)^{\frac1n}\right)^n}\cdot -\frac1n \left((-t)^{\frac1n}\right)^{1-n} dt=-\frac1n\int e^{-t}\cdot (-t)^{\frac1n -1}dt = -\frac1n\int e^{-t}\cdot (-1)^{\frac1n -1}\cdot t^{\frac1n -1}dt$$ We pull out constants to get $${\color{red}-}\frac{(-1)^{\frac1n {\color{red}{-1}}}}{n}\int e^{-t}\cdot t^{\frac1n -1}dt=\frac{(-1)^{\frac1n}}{n}\Gamma\left(\frac1n, -(x^n)\right)+C$$

Wolfram alpha says otherwise:
https://www.wolframalpha.com/input?i=integrate+e%5E%28x%5En%29
https://www.wolframalpha.com/input?i=simplify+-%28x+%28-x%5En%29%5E%28-1%2Fn%29%29%2Fn
This is the constant they give that is outside of the gamma function

What am I doing wrong?

The first issue is that you're misusing (or just using a different definition?) of the incomplete Gamma function.

Here's a link showing that WolframAlpha uses $$\int e^{-t} t^{\frac 1 n - 1} dt = - \Gamma \left( \frac 1 n, t \right).$$

In general, WolframAlpha and Mathematica use the definition $$\int_r^\infty e^{-t} t^{r-1} dt = \Gamma(s, r)$$ which is the same as Wikipedia's definition. Therefore your last step is off by a factor of -1, so you should have instead obtained $$-\frac{(-1)^{\frac1n}}{n}\Gamma\left(\frac1n, -(x^n)\right)+C$$

After fixing the issue above, the results still don't perfectly match. Your method gave a constant of $$-\frac{(-1)^{\frac1n}}{n}$$ and WolframAlpha got $$\frac{(-1)^{1-1/n}}{n}$$. The difference is coming from the step where you "simplified" like this:

$$(-t)^{1/n-1} = (-1)^{1/n-1} t^{1/n-1}$$

In general, the identity $$(ab)^c = a^c b^c$$ doesn't hold for complex numbers. Or rather - it still holds, but you need to be careful about your branch cuts. With Wolfram's default branch cuts, the identity you tried to use is valid if $$x < 0$$ (and thus $$t > 0$$) but not valid if $$x > 0$$ (and $$t < 0$$). The alternate version

$$(-t)^{1/n-1} = (-1)^{-1/n-1} t^{1/n-1}$$

holds for $$x > 0$$ (and $$t < 0$$).

In summary, there's a reason why WolframAlpha originally computed the constant as $$-\frac{x (-x^n)^{-1/n}}{n}$$ and then put an "Alternate form assuming n and x are positive" warning on the simpler version $$\frac{(-1)^{1-1/n}}{n}$$. When we're dealing with complex numbers, raising to powers becomes a multi-valued function, so a lot of "standard identities" become false or require careful thinking about branch cuts.

• wait how does the second part regarding the (-1) hold? the positive power and negative power mirrors over the real axis, so they differ in their imaginary parts. how do we justify that they would basically be the same thing? is it because we won't consider n that make it imaginary since it is out of scope perhaps or something else? Commented Jan 6, 2023 at 14:26
• @Max0815 In general, it's dangerous to assume $(-1)^{1/n} = e^{i \pi/n}$ since there are lots of other $n$th roots of 1 in complex numbers. That said, I think my previous explanation was very incomplete and I've edited to add more detail. Commented Jan 6, 2023 at 18:13
• That makes sense. Thanks! Commented Jan 6, 2023 at 18:14