0
$\begingroup$

I would like to integrate:

Integrate[
  1/((0.64*E^(2*(a/d)^1.7)*Sqrt[Pi *a]))^3, {a, a0, ac},
  Assumptions -> {d > 0, a > 0, ac > a0 > 0}
]

I know this has a known solution and if I choose values for a0 and ac I get a solution.

$\endgroup$
2

2 Answers 2

5
$\begingroup$
expr[a_, d_] = 
 Hold[1/((0.64*E^(2*(a/d)^1.7)*Sqrt[Pi*a]))^3] /. 
    x_Real :> Rationalize[x, 0] // ReleaseHold // FullSimplify

(* 15625/(E^(6*(a/d)^(17/10))*(4096*a^(3/2)*Pi^(3/2))) *)

With the usual form of Assumptions the integral fails to evaluate

Assuming[{d > 0, ac > a0 > 0}, Integrate[expr[a, d], {a, a0, ac}]]

(* Integrate[15625/(E^(6*(a/d)^(17/10))*(4096*a^(3/2)*Pi^(3/2))), {a, a0, ac}] *)

Using an unusual assumption of d > a evaluates with a condition; however, the resulting condition is exactly the assumption that previously failed.

int1 = Assuming[{d > a, ac > a0 > 0}, Integrate[expr[a, d], {a, a0, ac}] // 
  Simplify]

(* ConditionalExpression[
   (1/(4096*Pi^(3/2)))*
     (15625*(2/(E^(6*(a0/d)^(17/10))*Sqrt[a0]) - 
           2/(E^(6*(ac/d)^(17/10))*Sqrt[ac]) - 
           (2*6^(5/17)*Gamma[12/17, 6*(a0/d)^(17/10)])/
             Sqrt[d] + (2*6^(5/17)*
                Gamma[12/17, 6*(ac/d)^(17/10)])/Sqrt[d])), d > 0] *)

Reversing the assumption on d also evaluates but without a condition.

int2 = Assuming[{a > d, ac > a0 > 0}, 
  Integrate[expr[a, d], {a, a0, ac}] // Simplify]

(* (1/(4096*Pi^(3/2)))*
   (15625*(2/(E^(6*(a0/d)^(17/10))*Sqrt[a0]) - 
         2/(E^(6*(ac/d)^(17/10))*Sqrt[ac]) - 2*6^(5/17)*
           ((1/d)^(17/10))^(5/17)*
           Gamma[12/17, 6*(a0/d)^(17/10)] + 
         2*6^(5/17)*((1/d)^(17/10))^
             (5/17)*Gamma[12/17, 6*(ac/d)^(17/10)])) *)

Under the appropriate assumptions, the two results are equivalent

int1 == int2 // Simplify[#, {d > 0, ac > a0 > 0}] &

(* True *)

So the integral appears to be

int[a0_, ac_, d_] = int2 // FullSimplify

(* (1/(2048*Pi^(3/2)))*
   (15625*(1/(E^(6*(a0/d)^(17/10))*Sqrt[a0]) - 
         1/(E^(6*(ac/d)^(17/10))*Sqrt[ac]) + 6^(5/17)*
           ((1/d)^(17/10))^(5/17)*
           (-Gamma[12/17, 6*(a0/d)^(17/10)] + 
              Gamma[12/17, 6*(ac/d)^(17/10)]))) *)

Numerically verifying for some random values of the parameters

SeedRandom[0]

And @@ Table[Module[{a0, ac, d},
   a0 = SetPrecision[RandomReal[{0, 5}], 20];
   ac = SetPrecision[a0 + RandomReal[{0, 5}], 20];
   d = SetPrecision[RandomReal[{1, 10}], 20];
   exact = int[a0, ac, d];
   Abs[(exact - Integrate[expr[a, d], {a, a0, ac}])/exact] < 10^-12], {100}]

(* True *)
$\endgroup$
5
$\begingroup$
Integrate[1/((0.64*E^(2*(a/d)^1.7)*Sqrt[Pi*a]))^3, {a, a0, ac}, Assumptions -> d > 0 && a > 0 && ac > a0 > 0]

(*(0.682581 Gamma[-0.294118, (6. a0^1.7)/d^1.7] - 0.682581 Gamma[-0.294118, 6. (ac/d)^(17/10)])/d^0.5*)

I get your code to work fine if I separate the assumptions with && instead of commas.

$\endgroup$
1
  • $\begingroup$ that also does the job: Integrate[1/((0.64*E^(2*(a/d)^1.7)*Sqrt[Pi*a]))^3, {a, a0, ac}, Assumptions -> {0 < a0 < ac, d > 0}] $\endgroup$
    – rmw
    Nov 15, 2018 at 10:48

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.