If you prefer accuracy over speed you could also start with any n, solve the integral using the Simpson Approximation, double n, solve the Integral again, and continue in this fashion until your consecutive approximations are less than some tolerance.