How do I solve this, do I have to continue calculating with rational fractions? $$\int \frac{\sin^2(x)dx}{\sin(x)+2\cos(x)}$$
I tried to use different substitutions such as $t=\cos(x)$, $t=\sin(x)$, $t=\tan(x)$, and after expressing $\sin$ and $\cos$ through $\tan(\frac{x}{2})$, I've got $ \int -4 \frac{t^2dt}{(1+t^2)^2(t^2-t-1)}.$
Rational fractions didn’t work.

We have
$$(\sin x+2\cos x)(2\cos x-\sin x)=4-5\sin^2x=5\cos^2x-1$$
Therefore
$${\sin^2x\over \sin x+2\cos x} ={\sin^2x(2\cos x-\sin x)\over (\sin x+2\cos x)(2\cos x-\sin x)}\\ =
2{\sin^2x\over 4-5\sin^2x}\cos x-{1-\cos^2x\over 5\cos^2x -1}\sin x$$
Hence substituting $s=\sin x$ and $t=\cos x,$  respectively, gives
$$\int {\sin^2x\over \sin x+2\cos x}\,dx=2\int{s^2\over 4-5s^2}\,ds +\int{1-t^2\over 5t^2-1}\,dt \\
=-{2\over 5}s+{8\over 5}\int {1\over 4-5s^2}\,ds-{1\over 5}t+{4\over 5}\int{1\over 5t^2-1}\,dt $$
The remaining integrals can be evaluated by easy partial fraction decompositions. At the end we have to get back to $x=\arcsin s$ and $x=\arccos t,$ respectively.
