8

I want to solve the integral

$\int_{p_0}^{p_1}\left(T_0+\Gamma_p(p_0-p)\right)\frac{1}{p}dp$

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?

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

2 Answers2

13

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.

march
  • 23,399
  • 2
  • 44
  • 100
3

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]

user64494
  • 26,149
  • 4
  • 27
  • 56