I would like to evaluate the following:
NIntegrate[alpha^2 Log[2 Cos[alpha/2]]^2, { alpha, -Pi, Pi}]
How do I help Mathematica deal with the LogSquared type singularity at
either end of the interval. If I try it straight, Mathematica
complains and gives a wrong answer.
Please note, that Mathematica has absolutely no problem Integrating or
NIntegrating the function
Log[Cos[alpha/2]]^2
from -Pi to Pi, each time giving the correct answer, but the multiple
of alpha^2, throws it off.
Many thanks in advance,
Aaron.
PS: By the way, I'm pretty sure that that integral must be some
rational number times Pi^5.
Hi Aaron,
I might have misunderstood what the problem is, but it seems that
Mathematica 6.0.3 has no trouble at all integrating the expression with
alpha squared. As you can see below, the solution returned is, indeed, a
rational multiple of Pi to the fifth. So, this begs the question: What
platform/version are you using and what result did you get?
In[1]:= NIntegrate[alpha^2 Log[2 Cos[alpha/2]]^2, {alpha, -Pi, Pi}]
%/Pi^5
% // Rationalize
$Version
Out[1]= 37.4024
Out[2]= 0.122222
Out[3]= 11/90
Out[4]= "6.0 for Mac OS X x86 (64-bit) (May 21, 2008)"
Regards,
-- Jean-Marc
I get:
In[1]:= NIntegrate[alpha^2*Log[2*Cos[alpha/2]]^2, {alpha, -Pi, Pi}]
Out[1]= 37.40240591819764
In[2]:= NIntegrate[alpha^2*Log[2*Cos[alpha/2]]^2, {alpha, -Pi, Pi},
WorkingPrecision -> 30] == Pi^5*(11/90)
Out[2]= True
Aaron Fude schrieb:
When I try it straight, Mathematica 6 does not complain and gives an answer
which I suspect is correct.
> Please note, that Mathematica has absolutely no problem Integrating or
> NIntegrating the function
>
> Log[Cos[alpha/2]]^2
>
> from -Pi to Pi, each time giving the correct answer, but the multiple
> of alpha^2, throws it off.
>
> Many thanks in advance,
>
> Aaron.
>
> PS: By the way, I'm pretty sure that that integral must be some
> rational number times Pi^5.
It seems to be 11/90 * Pi^5.
David