# Factoring Polynomial with Complex Coefficients - Cauchy's Theorem

I'm faced with another polynomial (with complex coefficients) that I seem to only know how to solve using wolfram alpha. Here is the original integral that I need to compute using algebra and Cauchy's Theorem.

$$\int_0^{\pi} \frac{d\theta}{1+sin^2\theta}$$

Doing it the standard way, I start off by making the following substitutions:

$$z=e^{i\theta}$$

$$d\theta=\frac{1}{iz}dz$$

$$1+sin^2(\theta)=1+sin^2(\theta+\pi), 0\leq \theta \leq \pi \implies |z|=1$$

Where $\gamma$ is the full unit circle (though doing a line integral around this curve would be twice the original integral from the problem, so we must divide by 2 after).

So we begin,

\begin{align*} \int_{\gamma}\frac{dz}{iz(1+(\frac{1}{2i}(z+\frac{1}{z})))} &= \int_{\gamma}\frac{dz}{iz-\frac{iz}{4}(z^2+\frac{1}{z^2}-2)}\\ &= \int_{\gamma}\frac{dz}{\frac{-i}{4}z^3+3iz-\frac{i}{4z}+2iz} \end{align*}

Now here is where my problem is. The goal is to factor that polynomial in the denominator so that you can use Cauchy's Theorem on it. However,I'm only able to factor this (seeming) monster using wolfram alpha, which is a problem.

Is there a nifty way to solve this that I skipped/overlooked? There are many more problems like this, and I really hate finding the roots only by using wolfram alpha.

$\int^{\pi}_0 \frac{1}{1+ \sin^2 \theta}$ d$\theta =\int^{\pi}_0\frac{1}{1+\frac{1}{2}-\frac{\cos 2\theta}{2}}$ d$\theta = \int^{\pi}_0\frac{1}{\frac{3}{2}-\frac{\cos 2\theta}{2}}$ d$\theta = \int^{\pi}_0\frac{2}{3- \cos 2 \theta}$ d$\theta$
Suggestion. Instead of doing what you did for $$f(\vartheta)=\frac{1}{1+\sin^2\vartheta},$$ try in on each of the two terms of what $f(\vartheta)$ is equal to: $$\frac{1}{1+\sin^2\vartheta}=\frac{i}{2}\left(\frac{1}{i+\sin\vartheta}+\frac{1}{i-\sin\vartheta}\right).$$