I am trying to integrate the function 1/((1+x)(x^0.5)) between 0 and infinity in C using the trapezium rule. I understand that this is an improper integral and that the trapezium method isnt ideal but its what Ive been told to use. Rather than try to calculate straight between 0 and infinity I have tried to separate the integral into different limits and sum them up. For some reason the first iteration of the while loop (limits, 0 and 1) works and produces the correct answer (pi/2), but later ones do not.
Can someone please tell me where my code is