Here is the question; I am trying to understand its solution:
Problem $9$: Evaluate the integral $$\int_0^{2\pi} \frac{\mathrm{d} \theta}{1+r \sin \theta}$$ for $0<r<1$. Carefully sketch your contour and provide explicit solutions for any integrals you claim tend to zero.
Here is a solution:
Solution Given To Me: Put $\newcommand{\dd}{\mathrm{d}} \newcommand{\para}[1]{\left( #1 \right)} \newcommand{\ds}{\displaystyle} \newcommand{\t}{\theta} \newcommand{\al}[1]{\begin{align*} #1 \end{align*}} z = e^{i \t}$ and then $$ \sin \theta = \frac{z - z^{-1}}{2i} $$ Thus we have $$\al{ \int_0^{2\pi} \frac{\dd \t}{1 + r \sin \t} &= \int_{|z|=1|} \frac{\dd z}{\ds iz \para{ 1 + r \frac{z-z^{-1}}{2i} } } \\ &= \int_{|z|=1|} \frac{2\, \dd z}{\ds 2 iz \para{ 1 + r \frac{z-z^{-1}}{2i} } } \\ &= \int_{|z|=1|} \frac{2\, \dd z}{2iz+rz^2 - r} \\ &= \int_{|z|=1|} \frac{2\, \dd z}{r(z-z_1)(z-z_2)} }$$ where $$\al{ z_1 &= \frac{-i + i \sqrt{1-r^2}}{r} \\ z_2 &= \frac{-i - i \sqrt{1-r^2}}{r} }$$ Then we have $|z_1| < 1$ and $|z_2|>1$. Then by the residue theorem we have $$ \int_{|z|=1|} \frac{2 \, \dd z}{r(z-z_1)(z-z_2)} = 2\pi i \cdot \operatorname*{Res}_{z=z_1} f(z) $$ where $$f(z) = \frac{2}{r(z-z_1)(z-z_2)}$$ Thus $$\al{ \int_{|z|=1|} \frac{2 \, \dd z}{r(z-z_1)(z-z_2)} &= 2\pi i \frac{2}{r(z_1-z_2)} \\ &= \frac{4\pi i}{\ds r \cdot \frac{2i \sqrt{1-r^2}}{r}} \\ &= \frac{2\pi}{\sqrt{1-r^2}} }$$
But I have the following questions on the solution given above:
(1) Why the residue at $z =z_2$ is not considered ?
(1') Why ususally in this kind of questions we start by substituting by $z = e^{i \theta}$?
(2) How do we get $2iz+rz^2-r$ in the denominator to become $r(z-z_1)(z-z_2)$?
(3) What was the importance of knowing that $|z_1| < 1$ and $|z_2| > 1$?
(4) How can I sketch the contour and provide explicit estimates to any integrals the I claim tend to zero? I believe that the above solution did not answer this part, right?
Could anyone help me answer those questions please? I am learning complex analysis by myself.
Questions $1$ and $3$: The residue at $z_2$ is not inside the contour $|z|=1$, so it doesn't matter; the residue theorem is only concerned with residues contained by the contour. $z_1$ has $|z_1|<1$, so we know it lies inside.
Question $1'$: Because circles are nice and easy to deal with. $e^{i \theta}$ for $\theta \in [0,2\pi)$ gives us a perfect circle. Strictly speaking, there is no reason we have to use a circle. When using the residue theorem, we often have to deal with things that involve lengths of curves as well (e.g. when setting up inequalities), so working with a circle - a well-known, nice, pleasant-mathematically shape - makes life easier.
Question $2$: (Edited: It was later noted that OP wanted an explanation as to the claim below.)
So, we want to see why
$$2iz + rz - r = r(z - z_1)(z- z_2)$$
for the given $z_1,z_2$; specifically, we want to know where the $r$ comes from.
The reason is simple. We get the $z_1,z_2$ from application of the quadratic formula; nothing has changed there. However, an overlooked detail is that, when you factorize a polynomial into linear factors, e.g. write a polynomial $p$ with roots $r_i$ as
$$p(z) = \prod_{i=1}^n (z-r_i)$$
this implicitly assumes we're dealing with a "monic" polynomial, one of leading coefficient $1$. In general, if $p$ has a leading coefficient of $a$, then we really have
$$p(z) = a\prod_{i=1}^n (z-r_i)$$
As a simple example, $3x^2 - 18x + 24 = 3(x-2)(x-4)$.
Here, our leading coefficient is $r$, hence the claimed result.
Question $4$: In general, $re^{i\theta}$ for $\theta \in [0,2\pi)$ will be a contour which is a circle, centered at the origin with radius $r$. It would be fruitful to become familiar with other parameterizations as well (e.g., straight lines) for use in complex analysis.
You're correct in that this question did not involve some sort of estimate. Ultimately the standard techniques from real analysis are nice. A particularly big one is to look at
$$\left| \int_\Gamma f(z) \, \mathrm{d} z \right|$$
if you need to bound something over some contour. This one is nice, because you have
$$0\le \left| \int_\Gamma f(z) \, \mathrm{d} z \right| \le\int_\Gamma \left| f(z) \right| \, \left| \mathrm{d} z \right|$$
Using whatever properties necessary, sometimes the rightmost integral can be a lot easier to evaluate. You might find that it goes to $0$, too, as a certain parameter related to the contour goes elsewhere (e.g. the radius of a semicircle goes to $\infty$) -- but because of the sandwiching behavior, that means the leftmost integral does to $0$ too.
An example would be finding
$$\int_{-\infty}^\infty \frac{1}{1+x^2} \, \mathrm{d}x$$
via complex analysis specifically, despite knowing from Calculus I that the antiderivative is $\arctan(x)$. You would: