1
$\begingroup$

How can I get rid of the complex numbers in this result? The actual result is obviously real, but Mathematica gives me this inconvenient complex form.

Integrate[Exp[a*(x^3)], {x, 0, b}, Assumptions -> {a > 0, b > 0}]

((1 - I Sqrt[3]) (Gamma[1/3] - Gamma[1/3, -a b^3]))/(6 a^(1/3))

And I've already seen this related question, but the methods suggested for that problem didn't work for this. ComplexExpand[] just makes it into an absolute mess, and Simply puts it right back into complex form.

How to get rid of all complex numbers and functions?

$\endgroup$
0

3 Answers 3

1
$\begingroup$

Here is dirty trick suitable for that particular case:

rez = Integrate[Exp[5*(x^3)], {x, 0, 7}, 
   Assumptions -> {a > 0, b > 0}] // ToRadicals

rezComplex = 
 Integrate[Exp[a*(x^3)], {x, 0, b}, Assumptions -> {a > 0, b > 0}]

realAnswer = (rez // ToRadicals) /. {5 -> a, -1715 -> -a*b^3}

FullSimplify[(realAnswer - rezComplex), Assumptions -> {a > 0, b > 0}]
(* 0*)
$\endgroup$
1
$\begingroup$

Try the following trick:

realPartRule = Complex[re_, im_] :> Complex[re, 0];
realPart[exp__] := exp /. realPartRule;

Applying this trick to your result we obtain:

realPart[Integrate[Exp[a*(x^3)], {x, 0, b}, 
Assumptions -> {a > 0, b > 0}]]
(*(Gamma[1/3] - Gamma[1/3, -a b^3])/(6 a^(1/3))*)
$\endgroup$
1
$\begingroup$

Assume a<0 instead of a>0 and use -a

Integrate[Exp[-a*(x^3)], {x, 0, b}, Assumptions -> {a < 0, b > 0}]

(*   (Gamma[1/3] - Gamma[1/3, a b^3])/(3 a^(1/3))   *)

Or use Sqrt[a^2] with a>0

Integrate[Exp[Sqrt[a^2]*(x^3)], {x, 0, b}, Assumptions -> {b > 0}] // 
   Simplify[#, a > 0] &

(*   (Gamma[1/3] - Gamma[1/3, -a b^3])/(3 (-a)^(1/3))   *)

But now intermediate imaginary terms (like a^1/3 of a negative number) are only hidden.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.