I want to solve the integral


Mathematica can do the indefinite integral immediately:

>>> Integrate[(T + Γ (p0 - p))*(1/p), p]
-p Γ + (T + p0 Γ) Log[p]

But addind bounds suddenly makes it choke, i.e. the following never returns:

>>> Integrate[(T + Γ (p0 - p))*(1/p), {p, p0, p1}]

even though I can do this just fine:

FullSimplify[Limit[-Γ p + (Γ P + T) Log[p], p -> p1] - Limit[-Γ p + (Γ P + T) Log[p], p -> p0]]

What is the issue?

  • 1
    $\begingroup$ Is the subscript $p$ on $\Gamma$ in the first equation a typo? Is that not the same $p$ as the integration variable? $\endgroup$
    – nanoman
    Sep 23 at 12:26

Likely this is due to the fact that antiderivative are troublesome in computer algebra systems. Do this:

Integrate[(T + \[CapitalGamma] (p0 - p))*(1/p), {p, p0, p1},   Assumptions -> {p1 > p0 > 0}]

Assuming, of course, that p1 > p0 > 0 is actually true.

  • $\begingroup$ +1 for linking back to that Wolfram blog post. $\endgroup$ Sep 23 at 15:02

Mathematica likely has problems with four parameters which are assumed to be complex numbers and an antiderivative with branches. The GenerateConditions -> False/True option does the job.

Integrate[(T + \[CapitalGamma] (p0 - p))*(1/p), {p, p0, p1}, GenerateConditions -> False]

p0 - p1) \[CapitalGamma] - (T + p0 \[CapitalGamma]) Log[ p0] + (T + p0 \[CapitalGamma]) Log[p1]

Integrate[(T +\[CapitalGamma] (p0 - p))*(1/p), {p, p0, p1}, 
Assumptions -> {p0, p1, \[CapitalGamma],T} \[Element] Reals,GenerateConditions -> True]

ConditionalExpression[(p0 - p1) \[CapitalGamma] + (T + p0 \[CapitalGamma]) Log[p1/p0], p0 > 0 && p0 != p1 && p1 > 0]


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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