# Principal Value in NIntegrate. Integrand with multiple poles

I want to evaluate the numerical integral:

I1[y_] := NIntegrate[PolyGamma[(3*((0.61^2) - x (1 - x)*(y)^2))/(4*0.001) + 1], {x, 0, 1}]


The plot of the function defined by the integral above is:

The result is highly oscillatory for y>2*0.61. This happens because the PolyGamma function has poles if the argument is a negative integer or zero. My idea is to use Principal Value and exclude the points which the argument is negative and integer.

I reckon that the best approach is:

I2[y_] := NIntegrate[PolyGamma[(3*((0.61^2) - x (1 - x)*(y)^2))/(4*0.001) + 1], {x, 0, 1}, Method ->PrincipalValue, Exclusions -> {(3*((0.61^2) - x (1 - x)*(y)^2))/(4*0.001) + 1 == n}]


But I don’t know how to define "n" as a negative integer. I have two questions:

1. How can I define n as a negative integer and use it to exclude the problematic points?

2. There is another way to compute the principal value of this integral?

Mathematica Asked by Victor Alencar on December 28, 2020

1 Answers

## One Answer

Another way. Using primary definition of PolyGamma function as a series:

Integrate[(z/(k (k + z)) - 1/z - EulerGamma) /.
z -> Rationalize[(3*((0.61^2) - x (1 - x)*(y)^2))/(4*0.001) + 1,
0], {x, 0, 1}, Assumptions -> y >= 0]

(*-EulerGamma + 1/k - (
4 ArcTan[(50 Sqrt[3] y)/Sqrt[11203 + 40 k - 7500 y^2]])/(
5 Sqrt[3] y Sqrt[11203 + 40 k - 7500 y^2]) - (
4 ArcTan[(50 y)/Sqrt[11203/3 - 2500 y^2]])/(
5 y Sqrt[33609 - 22500 y^2])*)


and we have:

F[y_, M_] := -EulerGamma +
Sum[1/k - (4 ArcTan[(50 Sqrt[3] y)/Sqrt[11203 + 40 k - 7500 y^2]])/(5 Sqrt[3] y
Sqrt[11203 + 40 k - 7500 y^2]), {k, 1, M}]
- (4 ArcTan[(50 y)/Sqrt[11203/3 - 2500 y^2]])/(5 y Sqrt[33609 - 22500 y^2])

Plot[F[y, 2000] // Re, {y, 0, 2}, PlotRange -> {Automatic, {2, 6}}]


Plot[F[y, 5000] // Re, {y, 0, 2},
PlotRange -> {{1.225, 1.5}, {2, 6}}](*In range 1.225 < x < 1.5*)


Answered by Mariusz Iwaniuk on December 28, 2020

## Related Questions

### How to manually create options that can be entered as a sequence or list?

1  Asked on January 31, 2021

### Raising the normal distribution curve to a specified height on the $y$-axis

1  Asked on January 30, 2021 by markokram

### Adams-Bashforth method implementation code review

1  Asked on January 30, 2021 by john-hall

### Having difficulty with what seems like a standard integral

0  Asked on January 30, 2021 by anon248

### Can the error function be expressed in terms of other special functions?

2  Asked on January 30, 2021

### How to make Mathematica treat y/x as a one variable?

1  Asked on January 30, 2021 by jakubl

### Embed a rose flower image in 3D space with axes labeled in UTF8

1  Asked on January 29, 2021 by chikitin

### Any built-in function to generate successive sublists from a list?

9  Asked on January 29, 2021 by nasser

### NDSolve solution plugged back into ODE quickly diverges

1  Asked on January 29, 2021

### Calculate the Lyapunov exponent for a driven damped spherical pendulum?

1  Asked on January 29, 2021

### NDSolve – interpolation or machine precision problem

0  Asked on January 28, 2021

### Tutorial example NetTrain fails miserably with a GPU

0  Asked on January 28, 2021 by kirma

### How to Copy/Paste From Mathematica into Excel

5  Asked on January 28, 2021

### How to change behavior of Echo or turn it off without removing it from code?

0  Asked on January 28, 2021

### Integration that involves inverse of a big symbolic matrix

0  Asked on January 28, 2021

### Mathematica GPU occupancy is too high when the current page has high quality images

1  Asked on January 28, 2021 by shrocat

### Sublist pattern matching

4  Asked on January 28, 2021 by literal

### List Contour plot

1  Asked on January 28, 2021 by sangami-ganesan-santhi

### Error Training FeedForward Neural Network With Various Type of Variables

1  Asked on January 27, 2021 by user34018

### Selecting parts of 2d array based on x value

1  Asked on January 27, 2021

### Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.