Integrated $\int_0^{2\pi}\frac{ae^{i\theta}+b}{ce^{i\theta}+d}e^{in\theta}d\theta$ symbolically but interested in derivation I came across the following integral which seems pretty interesting when I evaluated it with Woflram Alpha:
$$
I = \int_0^{2 \pi} \frac{a e^{i\theta} + b}{c e^{i\theta} + d} e^{i n \theta} d\theta
$$
I found the following:
\begin{equation}
I =
\begin{cases}
\displaystyle
\frac{2\pi b}{d} &\quad n = 0, \\
0 & \quad n \neq 0.
\end{cases}
\end{equation}
Does anyone know of a method to arrive at this result?

It is enough to exploit the orthogonality relation
$$ \int_{0}^{2\pi}e^{-mi\theta}e^{ni\theta}\,d\theta = 2\pi\,\delta(m,n) $$
and expand $\frac{ae^{i\theta}+b}{c e^{i\theta}+d}$ as a geometric series in $e^{i\theta}$ or $e^{-i\theta}$, according to $|c|>|d|$ or $|d|>|c|$.
If $|c|=|d|$ we have a singular integral since $e^{i\pi}+1=0$.
