# 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.

• 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.