The problem has nothing to do with the integrator, rather with the way you have written the integrand:
>> a = 1; b = 1;
>> di= @(x)(sinh((b.*x)./a)./sinh((pi.*x)./a));
>> di(1000)
ans =
NaN
You're giving the integrator NaN values, so there's not much it, or any other code, can do with that. Try multiplying your integrand numerator and denominator by exp(-pi*x) and simplifying. I get
>> dj= @(x)(exp((b-pi)*x) - exp(-(b+pi)*x))./(1-exp(-2*pi*x))
dj =
@(x)(exp((b-pi)*x)-exp(-(b+pi)*x))./(1-exp(-2*pi*x))
>> dj(1000)
ans =
0
>> quadgk(dj,1,inf)
ans =
0.051035297097439
-- Mike
Best Answer