# NIntegrate doesn't work

I have a function, Dx[s] (defined in a module) which I can plot:

Plot[Dx[s], {s, 0, GetLatticeLength[]}]


However if I try to integrate it, I get nothing:

NIntegrate[Dx[s], {s, 2, 3}]

NIntegrate[Dx[s], {s, 2, 3}]


Note that the function has quite complicated form with many If-statements, hence can't be easily represented symbolically (e.g. Dx[a]). Still, for any numerical value I tried it gives a definite answer. Also, it seems from the plot that there are no wild singularities etc.

Why doesn't NIntegrate work? Shouldn't it be just numerical evaluation of the integrand? I mean, the plot works, why shouldn't NIntegrate work as well?

-
Try to change the definition (or redefine it as) to Dx[a_?NumericQ]:= ... –  belisarius Oct 25 '13 at 11:41
Dear Belisarius, thanks, it worked! –  Slava Oct 25 '13 at 11:59