# How to compute my integral

I'm trying to compute the following integral

integrand = (-2 (Log - Log[1/t + t])^2)/(-1 + t^2)


Numerically integrating it gives the expected result

1/2*NIntegrate[integrand, {t, 0, 1}]
=> 1.0518
N[7/8*Zeta]
=> 1.0518


However when I try to integrate it symbolically I get

1/2*Integrate[integrand, {t, 0, 1}]
=> 1/16 (\[Pi] (I \[Pi] + Log) (\[Pi] + I Log) + 14 Zeta)
N[%]
=> -0.658472 + 3.06993 I


It is interesting that Mathematica returns the correct result 14/16 Zeta as part of its solution, but in addition it returns some strange imaginary terms, which I couldn't get rid of. What can I do so that Mathematica will compute this integral correctly?

Update: My version of Mathematica:

11.0.1 for Mac OS X x86 (64-bit) (September 21, 2016)

• On 11.1.0, I get the same result from both ways. Btw, the result has a negative sign. – Anjan Kumar Mar 22 '17 at 23:14
• Sorry, I missed the sign in the integrand. It fixed it now. – asmaier Mar 22 '17 at 23:46
• With 11.0.1 for Mac OS X x86 (64-bit) (September 21, 2016) using either 1/2*Integrate[integrand, {t, 0, 1}, PrincipalValue -> True] or 1/2*Integrate[integrand, {t, 0, 1}, Assumptions -> 0 < t < 1] they evaluate to -((7*Zeta)/8). Note your "correction" is not the negative of the original integrand – Bob Hanlon Mar 23 '17 at 0:01
• This seems to have shown up in 11.0.1, since version 11 gives the result (7 Zeta)/8 directly. Can you try Integrate[Log[(2 t)/(1 + t^2)]^2/(1 - t^2), {t, 0, 1}]? – J. M. will be back soon Mar 23 '17 at 1:17
• @J.M. I tried your suggested integral and the result was 7/8*Zeta . – asmaier Mar 23 '17 at 23:20

Specify a real-ish path:

1/2*Integrate[integrand, {t, 0, 1}, Assumptions -> 0 < t < 1]
(*  -((7 Zeta)/8)  *)


Or:

res = 1/2*Integrate[integrand, {t, 0, 1/2, 1}];  (* verrry looong expressssion *)
N[res, 16]
(* -1.0517997902646450 + 0.*10^-17 I *)

• res//Simplify evaluates to -((7*Zeta)/8) as expected – Bob Hanlon Mar 23 '17 at 0:41
• @BobHanlon Thanks, I didn't try that. It still takes a long time to evaluate, so I wasn't that keen to follow up on it. -- But, wow, it simplifies really fast! – Michael E2 Mar 23 '17 at 0:48
\$Version

(*  "11.1.0 for Mac OS X x86 (64-bit) (March 16, 2017)"  *)

integrand = (2 (Log - Log[1/t + t])^2)/(-1 + t^2);

intN = 1/2*NIntegrate[integrand, {t, 0, 1}]

(*  -1.0518  *)


This is the negative of the result that you show. However, a Plot shows that the integral should be negative.

Plot[integrand, {t, 0, 1}] Finding the Cauchy principal value

int = 1/2*Integrate[integrand, {t, 0, 1},
PrincipalValue -> True]

(*  -((7 Zeta)/8)  *)

int == intN

(*  True  *)