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  $\displaystyle I = \int \frac {1}{\sin ^2x + \sin x + 1}dx$
Let $$\sin x = -\frac {(2-\sqrt {3})t + (2 +\sqrt {3})}{t + 1}\implies \cos x\ dx = \frac {2\sqrt {3}}{(t + 1)^2}dt$$
Then $$I = 2\sqrt 3 \int \frac {t + 1}{\left((6 - 3\sqrt 3)t^2 + (6 + 3\sqrt 3)\right)\sqrt {(4\sqrt {3} - 6)t^2 - (4\sqrt {3} + 6)}}\ dx$$
Now consider $$I_1 = \int \frac {t}{\left((6 - 3\sqrt 3)t^2 + (6 + 3\sqrt 3)\right)\sqrt {(4\sqrt {3} - 6)t^2 - (4\sqrt {3} + 6)}}\ dx$$
and substitute $ \ (4\sqrt {3} - 6)t^2 - (4\sqrt {3} + 6) = z^2$ Reduce into well known equation.
and Consider $$ \ I_2 = \int \frac {1}{\left((6 - 3\sqrt 3)t^2 + (6 + 3\sqrt 3)\right)\sqrt {(4\sqrt {3} - 6)t^2 - (4\sqrt {3} + 6)}}\ dx$$
and first put $\displaystyle \ t = \frac 1p$ after this substitution put $ \ (4\sqrt {3} - 6) - (4\sqrt {3} + 6)p^2 = u^2$ 
and we are done without using Complex number...
