# Integration leading to logarithms and chosing branch

I m doing this interal with Mathematica

Integrate[(((1+b*t)^2)t)^(-1),t,Assumptions->b>0]


what I get back is

1/(1 + b t) + Log[-b t] - Log[1 + b t]


However there is a problem with the second term: imagine I set b to some positive number, as well as t, this would lead to an imaginary number instead a real one, as should be for a real integral. Indeed, just changing the sign works good, but I am puzzled about why Mathematica choses this solution. I guess must be related to choosing some branch for the logarithm or something similar, but still I don't figure out what Any suggestions?

-
If Cos[x] element of Real domain and can be expressed in terms of 1/2 (e^ix+e^-ix) than are you sure real integration cannot have complex solutions ? – Rorschach Jul 19 '13 at 18:22
I'm not sure what the question really is, since Mathematica has to choose certain branch working on the symbolic level. When passing to definite integrals sometimes there appear some problems and in order to resolve them we have to work on case by case basis. Closely related problem you could find here Why does Integrate declare a convergent integral divergent? – Artes Jul 19 '13 at 18:55
My favorite permutation of available input choices I've tried is Integrate[(((1 + b*t)^2) t)^(-1), {t, Infinity, t}, GenerateConditions -> False] ~~> 1/(1 + b t) - 2 ArcTanh[1 + 2 b t] - Log[-b] + Log[b] - gotta love the last two terms. But seriously, the most one can expect from an indefinite Integrate is that the derivative of the result is equivalent to the integrand. – Michael E2 Jul 19 '13 at 22:29
Thanks for all the clarifications. I was just pieced off by the point that, if I would evaluate my result say, in the interval (2,10) I would get an imaginary part, while this would make no-sense for a definite integral. I was just wondering whether I could tell Mathematica some assumption so it would choose the desired sign in my case. Nevertheless, the solution below works perfecto for me :) – pablo Jul 20 '13 at 14:38
@Artes Thanks for the link. It might be useful also ;) – pablo Jul 20 '13 at 14:52

You can always force the indefinite integral to obey certain conditions by casting it as a definite integral with a variable boundary, e.g.:

Integrate[(((1 + b*t)^2) t)^(-1), {t, Infinity, τ},
Assumptions -> b > 0 && τ > 1] /. τ -> t

(* ==> 1/(1 + b t) - Log[1 + 1/(b t)] *)

-
This works awesome for me! Just what I was looking for. The problem is I had to evaluate in the intercal {t,0,Infinity}, but the divergence at 0 is cancelled from an additional part Log[0]. Now I can do the job with Limit[Evaluate[Integrate[(((1 + b*t)^2) t)^(-1), {t, Infinity, τ}, Assumptions -> b > 0 && τ > 1]]+Log[τ],τ->0] which yields the desired result which you can calculate by hand to be -1+Log[1/b] Now is easier, but I wanted to fix it since the function to be integrated will be more complicated later. Thanks a lot! – pablo Jul 20 '13 at 14:39

Formally there is no mistake, since an indefinite integral is defined up to a constant and the second term differs from Log[b t] on $\pi i$. And for a definite integral this difference wouldn't matter.

-