Why when we approximate an analytic function has poles outside the interval of the integration give poor accuracy? Why when an analytic function has poles which are outside the domain of integration but lie very close to it, its numerical integration by means of a quadrature rule can give very poor? Why the function should be also defined outside the interval of the integration?
 A: The question asked about poor performance of numerical integration of
analytic functions with poles near the interval of integration.
The Wikipedia article Runge's phenomenon gives a good example of this where a
rational function with poles is evaluated at equidistant points and
approximated with a polynomial. Integrating the polynomial is easy
but the polynomial to be integrated is a poor fit for the function
and hence yields a poor integration result. The article suggest some
alternative ways to approximate the function to give better fit.
The question also asked

Why the function should be also defined outside the interval of the integration?

is not clear to me. In general we are dealing with
Meromorphic functions. The Wikipedia article states

In the mathematical field of complex analysis, a meromorphic function on an open subset $D$ of the complex plane is a function that is holomorphic on all of $D$ except for a set of isolated points, which are poles of the function.

Notice the use of "open subset $D$ of the complex plane".
The behavior of the function is very closely related to
the topology of the complex plane. Its natural domain is
open subsets of the complex plane. Thus, while the interval
of integration is of primary importance, a real interval is
not an open domain in the complex plane. The behavior
of the function on open domains containing the interval has
an impact on the behavior in the interval itself and vice
versa. That is why poles outside the real interval can have
a substantial effect on fitting by polynomials. A much better
fit could be found if rational functions are allowed to better
account for poles.
