3
$\begingroup$

Mathematica 10.4.1.0 produces

Integrate[
  Log[1 + 2 a*Cos[2 x] + a^2]*Sin[x]^2, {x, 0, Pi/2}, 
  Assumptions -> a > 1
]
ConditionalExpression[1/4 Pi (-1 + 2 Log[a]), a < 3] 

whereas the correct result is $$ \frac\pi 4\left(\ln a^2 -\frac 1 a\right) $$ according to Gradshtein & Ryzhik, formula 4.397.14.

How to correct this defect?

$\endgroup$
  • $\begingroup$ The conditional expression generic formula seems not to match a particular case, Integrate[Log[1 + 2 2*Cos[2 x] + 2^2]*Sin[x]^2, {x, 0, Pi/2}] (which matches GR). $\endgroup$ – b.gates.you.know.what Jul 21 '16 at 7:24
  • $\begingroup$ NIntegrate[] works fine here if it's of any help. l = Transpose[{Range[1, 3, 0.1], Table[ NIntegrate[ Log[1 + 2 a*Cos[2 x] + a^2]*Sin[x]^2, {x, 0, Pi/2}], {a, 1, 3, 0.1}]}]; ListPlot[l] $\endgroup$ – Feyre Jul 21 '16 at 7:33
7
$\begingroup$

Using the conditions in the book

ClearAll[a, x];
expr = Log[1 + 2 a*Cos[2 x] + a^2]*Sin[x]^2;
r = Integrate[expr, {x, 0, Pi/2}, Assumptions -> a^2 > 1]

Mathematica graphics

Book result

Mathematica graphics

You used $a>1$ but the book says to use $a^2>1$. These are not the same.


Update: I asked about this on another forum. Experts opinions says that result should be valid for $|a|>1$ and not just $a^2>1$. reference. So the result given should also apply for $a>1$.

$\endgroup$
  • $\begingroup$ @ Naser: Thank you. How about the case $a>1$ which implies $a^2>1$? $\endgroup$ – user64494 Jul 21 '16 at 8:13
  • $\begingroup$ @user64494 $a>1$ implies $a^2>1$, but $a^2>1$ does not imply $a>1$ and the result in the book is valid for $a^2>1$ which agrees with what M gives. Now for $a>1$ the result is what you show in your question. Which I assume is correct. $\endgroup$ – Nasser Jul 21 '16 at 8:19
  • $\begingroup$ This gives the conditional expression that a< -1, even though it is valid for a>1 too. $\endgroup$ – Feyre Jul 21 '16 at 8:22
  • $\begingroup$ @Feyre You might be right. I updated the answer with link. $\endgroup$ – Nasser Jul 21 '16 at 22:11
  • 1
    $\begingroup$ @MichaelE2 I am using 10.4.1, 64 bit, on windows 7 64 bits. Screen shot !Mathematica graphics if you are not on windows, then this means there is platform difference ! $\endgroup$ – Nasser Jul 22 '16 at 0:33

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.