Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Can Mathematica NIntegrate a Log-type singularity?

2 views
Skip to first unread message

Aaron Fude

unread,
Oct 9, 2008, 6:36:43 AM10/9/08
to
Hi,

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.

Jean-Marc Gulliet

unread,
Oct 10, 2008, 4:35:18 AM10/10/08
to

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

Peter Pein

unread,
Oct 10, 2008, 4:36:54 AM10/10/08
to
This must be another version of Mathematica than
"6.0 for Linux x86 (64-bit) (March 13, 2008)"

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:

David W.Cantrell

unread,
Oct 10, 2008, 4:38:08 AM10/10/08
to
Aaron Fude <aaro...@gmail.com> wrote:
> Hi,
>
> 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.

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

0 new messages