# Assumptions for Definite Integral of Log[]

I have a given function:

sol = t D[ri t/(v - b) - (1/v - 1/(v + b)) a/(b Sqrt[t]), t] // FullSimplify


I now need to integrate this function across $$v$$ within a specific region v1, v2 (which means a relatively 'simple' definite integral of $$\int\frac{1}{v}dv$$ which would be a $$\log_e\frac{v2}{v1}$$ kind of solution.

Integrate[sol, {v, v1, v2}]


However try as I might, it seems that MMA cannot quickly/easily solve this integral. My assumption is, that this has problems in the symbolic solution because of (un)specific constraints, so to reduce the work, I tried.

Integrate[sol,{v,v1,v2}, Assumptions -> {v \[Element] Reals, v1 > 0, v2 > 0}]


However this can't be solved either and try as I can to google or check the documentation I can't seem to find how one would get to the correct solution. For relatively 'simple' equations like this, I can easily solve this by hand...or well 'memory' However I have ever increasingly difficult systems to work with and I would like to calculate these kind of integrals.

How does one do definite integrals of 1/x functions to get the expected symbolic solution of Log[x2/x1]?

The problems are related to the fact that the integral has several parameters. Depending on their values the integral may exist, or not.

Let us see.

sol=(ri t)/(-b + v) + a/(Sqrt[t] (2 b v + 2 v^2));


Let us solve first an undetermined integral, calculating the terms of your function separately:

Integrate[#, v, Assumptions -> {ri > 0, t > 0, b > 0}] & /@ sol

(*  ri t Log[-b + v] + (a (Log[v]/(2 b) - Log[b + v]/(2 b)))/Sqrt[t]   *)


Now, one can see that in order for the integral to exist one should require v-b>0 v+b>0 and t!=0. Besides, it is useful to define that v1>0 and v2>v1. Of course, if the integration along the real axis corresponds to your intention. With this

AbsoluteTiming[
Integrate[sol, {v, v1, v2},
Assumptions -> {ri > 0, t > 0, b > 0, v1 > 0, v2 > v1, v1 > b}]]


in 0.6s yields the result:

(*  {0.619135,
ri t Log[(b - v2)/(b - v1)] + (a Log[((b + v1) v2)/(v1 (b + v2))])/(
2 b Sqrt[t])}  *)


Have fun!

You can immediately get an answer to the indefinite integral:

Integrate[sol, v]

(* Out: (a Log[v] + 2 b ri t^(3/2) Log[-b + v] - a Log[b + v])/(2 b Sqrt[t]) *)


The definite integral churns for a long time without success without assumptions, as you saw. However, if you add assumptions that all parameters are real, and that $$v2>v1>0$$, you can get an answer as a ConditionalExpression:

Integrate[
sol, {v, v1, v2},
Assumptions -> {{t, ri, b, a} ∈ Reals, v2 > v1 > 0}
]

(* Out:
ConditionalExpression[
ri t Log[(b - v2)/(b - v1)] + (a Log[((b + v1) v2)/(v1 (b + v2))])/(2 b Sqrt[t]),
b < v1 && b + v1 > 0
]
*)