# Help : I can't manage to plot this integral function? [closed]

I try to make the plot of an integral function in the trial version of Mathematica. I write the following code:

r[x_, y_, s_] := (Sqrt[4/(1 - x) + y*x - 4/(1 - s) - y*s]);
Ip[x_, y_] := NIntegrate[1/(r[x, y, s]), {s, 0, y}];
Plot3D[Ip[x, y], {x, 0, 1}, {y, -3, 4}];


But it appears this kind of error:

NIntegrate::inumr: The integrand 1/r[0.0000715,-2.9995,s] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,-2.9995}}

and similar ones.

So I would like to plot this integral function with x,y parameters in order to have a graph made by {Ip[x,y], x, y}, but I can't manage it. Could someone help me?

• It should be Ip[x_?NumericQ, y_?NumericQ] := NIntegrate[1/(r[x, y, s]), {s, 0, y}]; – mattiav27 Oct 18 '18 at 7:00

"NIntegrate::inumr: The integrand 1/r[0.0000715,-2.9995,s] has evaluated to non-numerical values for all sampling points in the region with boundaries {{0,-2.9995}}"

You are getting this error because you have not written the code in a proper format.

See this:

r[x_, y_, s_] := (Sqrt[4/(1 - x) + y*x - 4/(1 - s) - y*s]);
Ip[x_, y_] := NIntegrate[1/(r[x, y, s]), {s, 0, y}];
Plot3D[Ip[x, y], {x, 0, 1}, {y, -3, 4}] Your function is singular at some values. you will see some warnings about the singularity while evaluating the numerical integration.

• I can't find a difference to OP's coding? – Ulrich Neumann Oct 18 '18 at 7:19
• @UlrichNeumann, Now You are seeing the updated version of OP's coding. – 2.0 Oct 18 '18 at 8:54
• @ SachinKumar Thanks – Ulrich Neumann Oct 18 '18 at 9:13