I'm trying to use Simpson's rule to integrate the following function in a program:
$$\int_{z_a}^{z_b}\frac{Cf(z)}{(C^2 - f(z)^2)^{3/2}}\,dz$$
where $C$ is a constant and $f(z)$ are interpolated values from a table based on $z$ and it can vary from $1400$ to $1600$ with $C > f(z)$.
I'm probably missing something obvious here. My understanding is that when using Simpson's rule the output should converge to at least the "vicinity" of the "true" answer depending on the number of segments.
But every time I increase the segments, the output value always increases and never converges. This graph shows the output ($y$ axis) using segments from $100$ to about $920,000$ ($x$ axis):
I've tested this program with other integrals and with less than $1000$ segments I always get the expected result, so I believe the algorithm is correct. It is from the book "Numerical Methods for Engineers"
Is this function not suitable to be evaluated using Simpson's method? Is there another method to numerically evaluated this specific integral?