Sign up ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I need to calculate the following singular integral:

NIntegrate[Log[1 + y^2]/Cos[Pi y], {y, 0, 1}]

However, it is failing to converge. I have tried to specify MaxRecursion, PrecisionGoal, and Exclusions but neither helped. How does one calculate singular integrals in Mathematica?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

As it stands the integral does not converge! To see that note that

Series[Log[1 + y^2]/Cos[Pi y], {y, 1/2, 0}]

returns $$-\frac{\log \left(\frac{5}{4}\right)}{\pi \left(y-\frac{1}{2}\right)}-\frac{4}{5 \pi }+O\left(y-\frac{1}{2}\right)$$

and a simple pole is not integrable.

What you maybe want to know is Cauchy's principle value of the integral (which is finite). For that evaluate

NIntegrate[Log[1 + y^2]/Cos[Pi y], {y, 0, 1/2, 1}, Method -> "PrincipalValue"]

which returns -0.281589.

share|improve this answer
Same with NIntegrate[Log[1 + y^2]/Cos[Pi y], {y, 0, 1}, Method -> "PrincipalValue", Exclusions -> {1/2}] – b.gatessucks Dec 13 '12 at 12:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.