Is it possible to integrate $\int \frac{\mathrm{d}x}{\sin^2 x+\sin x+1}$ without involving complex numbers? The integral is $$\int \frac{\mathrm{d}x}{\sin^2 x+\sin x+1}$$

Consider
$$\int \frac{\mathrm{d}x}{ax^2+bx+c}$$
There are a total of three cases, depending on the discriminant of $ax^2+bx+c$. Two of which are shown here (#1).
The third one, i.e. when $\Delta=0$, simply means evaluating $$\frac{1}{a}\int \frac{\mathrm{d}x}{\big(x+\frac{b}{2a}\big)^2} $$
For the first two cases, you can see different substitutions are used so as to prevent $i$ from appearing in the answer, hence resulting in an $\arctan$ function and a $\ln$ function respectively. The discrepancy arises when we change $+(4ac-b^2)$ to $-(b^2-4ac)$.

In general, is it possible to evaluate
$$\int \frac{\mathrm{d}x}{a\sin^2 x+b\sin x+c}$$ such that the result does not contain complex numbers when $\Delta_{\sin x}<0$?
The only approach I can think of when $\Delta_{\sin x}>0$ is by partial fraction decomposition, which differs from the method of substitution used above.

Let $\sin x =\frac{1-t^2}{1+t^2}$, or $t= \tan(\frac\pi4-\frac x2)$
\begin{align}
&\int \frac{1}{\sin^2 x+\sin x+1}\ dx
=\int\frac{2+2{t^2}}{3+t^4} \ dt\\
=&\ (1+\frac1{\sqrt3}) \int \frac{1+\frac{\sqrt3}{t^2}}{t^2+\frac3{t^2}}dt +(1-\frac1{\sqrt3}) \int \frac{1-\frac{\sqrt3}{t^2}}{t^2+\frac3{t^2}}dt\\
=&\  \frac{\sqrt3+1}{\sqrt{6\sqrt3}}\tan^{-1}\frac{t-\frac{\sqrt3}t}{\sqrt{2\sqrt3}}
-\frac{\sqrt3-1}{\sqrt{6\sqrt3}}\coth^{-1}\frac{t+\frac{\sqrt3}t}{\sqrt{2\sqrt3}}+C
\end{align}
