I define function
g[x_] := NIntegrate[Tanh[x y]/(y^2 + 1), {y, 0, \[Infinity]}]
g[1] = 1.04826. But g[x]/.{x->1} gives error: NIntegrate::inumr: The integrand Tanh[x y]/(1+y^2) has evaluated to non-numerical values for all sampling points in the region with boundaries {{\[Infinity],0.}}. I use this function in another numerical integration and obtain the same error. How to avoid this problem?
guses numeric techniques, its arguments should be restricted to numeric values:g[x_?NumericQ] := NIntegrate[Tanh[x y]/(y^2 + 1), {y, 0, Infinity}]– Bob Hanlon Sep 22 '16 at 23:47