<s>[INST] Evaluating an integral2 Evaluate the following integral 
$$\int\frac{dx}{\tan^2x +\csc x}$$
I tried the sub $$u=\tan{\frac{x}{2}}$$ to be
$$\int\frac{2u(1-u^2)^2}{(1+u^2)(u^6-u^4+3u^2+1)}du$$ 
Then i used the partial fractions to get
$$\int\frac{-2u}{1+u^2}+\frac{x^5-x^3+2x}{x^6-x^4+3x^2+1}$$
The first integrand is easy but the second i could not solve it ?
 [/INST] Try rewriting
$$\begin{align} 
\frac{x^5 - x^3 + 2x}{x^6 - x^4 + 3x^2 + 1} &= \frac16 \frac{(6x^5 - 4x^3 + 6x) + (-2x^3 + 6x)}{x^6 - x^4 + 3x^2 + 1} \\ 
&= \frac16 \ \frac{6x^5 - 4x^3 + 6x}{x^6 - x^4 + 3x^2 + 1} - \frac16 \frac{(x^2-3)2x}{x^6 - x^4 + 3x^2 + 1} 
\end{align} $$
The second term can be reduced to a cubic
$$ \int \frac{t-3}{t^3 - t^2 + 3t + 1}dt $$
The denominator doesn't have rational roots, but can be factored as
$$ t^3 - t^2 + 3t + 1 = (t+0.2956)\big((t-0.6478)^2+1.7214^2\big) $$
The roots are given by Wolfram here (with exact forms). You can then use partial fractions again
</s>