David Young
David Young

Reputation: 119

GSL integration accuracy

I am integrating the function f(x) = a(n-1)/(1+ax)^n from x = 0 to x = infinity, where 1 < n < 2. For large a, the gradient near x = 0 becomes large and gsl_integration starts to lose accuracy (even using adaptive integration). Is there any way I can maintain the same accuracy as a increases? Would splitting the integral up to two parts with one near x = 0 help?

Upvotes: 1

Views: 145

Answers (1)

Simon Gibbons
Simon Gibbons

Reputation: 7194

The integral with those limits should be independent of the value of a.

If you make the substitution u = ax you will find that

enter image description here

So there will be no need to worry about the loss of accuracy for very large a.

Upvotes: 2

Related Questions