For integration of polynomials, the number of qradrature points can be determined easily according to the $(2N-1)$ rule. While in most cases, it's not necessary to use Gaussian quadrature for simple polynomials since they can be calculated analytically, what we encounter in reality are generally complex integrands, such as rational functions.
In this case, how can we determin an appropriate number of quadrature points so that we can get a somewhat acceptible solution, and at the same time will not lead to a waste of computational efforts?