# Divergence With NIntegrate [closed]

I have a question about NIntegrate. I want to evaluate numerically the following integral

$$\int^{1}_{0}\frac{y(1-y)}{|1-M^2y(1-y)|}\,dy$$

where M is a constant. I know that this integral converges, but I want to evaluate it numerically because I need to use it in a plot. However, when I try to use NIntegrate, Mathematica gives me an error saying that

"NIntegrate::slwcon: Numerical integration converging too slowly; suspect one of the following: singularity, value of the integration is 0, highly oscillatory integrand, or WorkingPrecision too small."

"NIntegrate::ncvb: NIntegrate failed to converge to prescribed accuracy after 9 recursive bisections in y near {y} = {0.400375}. NIntegrate obtained 10.5643 +0. I and 0.7919336440001783 for the integral and error estimates."

Can anybody explain to me what I am doing wrong?

Thank you.

## closed as off-topic by Michael E2, J. M. will be back soon♦Mar 31 '18 at 4:50

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question cannot be answered without additional information. Questions on problems in code must describe the specific problem and include valid code to reproduce it. Any data used for programming examples should be embedded in the question or code to generate the (fake) data must be included." – J. M. will be back soon
If this question can be reworded to fit the rules in the help center, please edit the question.

• Please, provide the code you have used. This should include the value of M so we can reproduce your errors... – José Antonio Díaz Navas Feb 28 '18 at 21:36
• Analizing the singularities in your integrand, -2<M<2 to guarantee that your integral converges for $y\in (0,1)$..., beyond this range you should take care of them... – José Antonio Díaz Navas Feb 28 '18 at 21:51

Integrate[(y(1-y))/Abs[1-M^2 y(1-y)], {y, 0, 1}, Assumptions->-2<M<2]

If your M` had a magnitude larger than 2, then the integral diverges.