evaluating a complex integral where the integrand is analytic within the contour but not necessarily analytic on the contour A function $f : \mathbb{C} \to \mathbb{C}$ is analytic in the open disk $|z|<1$. I have an integral $I = \int\limits_{C} f(z) \frac{P(z)}{Q(z}$ where $C$ is $|z| = 1$ and $P(z)$ and $Q(z)$ are polynomials. I'd like to ask how i could go about evaluating such an integral.
EDIT :
$f$ is defined and continuous on the closed unit disk.
 A: Apply the residue theorem to circles $\gamma_{1-\epsilon}$ of radius $1-\epsilon$. If $Q$ has no zero on the unit circle then the integral $\int_{\gamma_{1 -\epsilon}}\ldots \ $ will converge to $\int_{\gamma_1}\ldots \ $ with $\epsilon \to 0+$. 
This means that
$$\int_{\gamma_1} f(z){P(z)\over Q(z)}dz=\lim_{\epsilon\to 0+} \int_{\gamma_{1-\epsilon}} f(z){P(z)\over Q(z)}dz=2\pi i\ \lim_{\epsilon\to 0+} \sum_{z\in D_{1-\epsilon}}{\rm res}\Bigl(f(z){P(z)\over Q(z)}\Bigr)\ ,$$
and the latter limit is, of course, equal to
$$\sum_{z\in D}{\rm res}\Bigl(f(z){P(z)\over Q(z)}\Bigr)\ ,$$
as expected.
A: The contour integral may be reduced to the integral around the singularities  of the integrand. The latter coincide with the singularities of $Q(z)$ in the denominator - in other words, zeros of $Q(z)$.
The result is $2\pi i$ times the sum of the residues. The residues are the coefficients of $1/(z-z_i)$ in the Laurent expansion of the integrand around the roots $z=z_i$ of $Q(z)$. If $Q(z)$ only has simple roots, the $i$th residue is just
$$\lim_{z\to z_i} f(z_i)P(z_i) (z-z_i)/Q(z_i)$$
