# Real integral evaluates to imaginary number

The following integral:Integrate[Exp[-2/3 Log[1 + x^3]], {x, 0, 1}] is evaluating to an imaginary number. Its closed-form expression should be (2^(-2/3) Gamma[1/3] Gamma[7/6])/Sqrt[\[Pi]]

How can I get Mathematica to produce this expression? (I need a closed form at another point, where I can't guess the actual value.)

You're getting an imaginary number because you're using integers.

Integrate[Exp[-2./3. Log[1. + x^3.]], {x, 0, 1}]


(* 0.883319 *)

Also:

Integrate[Exp[-a Log[1 + x^3]], {x, 0, 1}]


(* Hypergeometric2F1[1/3, a, 4/3, -1] *)

You can then replace a by $2/3$:

Hypergeometric2F1[1/3, a, 4/3, -1] /. a -> 2/3


$\frac{\Gamma \left(\frac{1}{3}\right) \Gamma \left(\frac{4}{3}\right)}{2 \Gamma \left(\frac{2}{3}\right)}$

• Or use NIntegrate: NIntegrate[Exp[-2/3 Log[1 + x^3]], {x, 0, 1}] gives 0.883319 Mar 4 '15 at 17:54
• I need the exact form, not approximate. Mar 10 '15 at 23:27

We can see why this happens looking at the indefinte integral:

 indef = Integrate[Exp[-2/3 Log[1 + x^3]], x]


analytic expression involving Hypergeometric2F1

This expression changes character and picks up an imaginary component right at 1:

 Plot[{ Re[indef ], Im[indef ]}, {x, 0, 1.3}]


Evaluating the definite integral using the left value at 1 we get the correct result:

 ( indef /. x -> 0.9999 ) - ( indef /. x -> 0 ) // Chop


0.883256

now we can get there like this as well:

 Integrate[Exp[-2/3 Log[1 + x^3]], {x, 0, 1 - 10^-8}] // N // Chop