This seems like a simple problem, but my trig manipulations are leading to a dead end.
Compute: $$\int\frac{\sin^2(x)}{1 - \tan(x)} dx$$
Working thus far:
Replace $$\tan(x) = \frac{\sin(x)}{\cos(x)}$$
Multiply fraction by $\dfrac{\cos(x)}{\cos(x)}$ and then by $\dfrac{\cos(x)+\sin(x)}{\cos(x)+\sin(x)}$ to get:
\begin{align*} \int\frac{\sin^2(x)\cos(x)(\cos(x) + \sin(x))}{\cos^2(x) - \sin^2(x)} dx &= \int\frac{\sin^2(x)\cos^2(x) + \sin^3(x)\cos(x)}{\cos(2x)} dx \\ &= \int\frac{\sin^2(2x)}{4\cos(2x)} dx + \int\frac{\sin^3(x)\cos(x)}{\cos(2x)} dx. \end{align*}
From there I'm not sure to proceed (in particular on the first integral). The second integral should be doable if I use $\cos(2x) = 1 - 2\sin^2(x)$ and use $ u = \sin(x)$.
Let $t=\tan x$ then $dt=(1+t^2)dx$ and recall that $$\sin^2 x=1-\cos^2x=1-\frac1{1+\tan^2x}=\frac{t^2}{1+t^2}$$ hence the integral becomes $$\int\frac{t^2}{(1+t^2)^2(1-t)}dt$$ can you take it from here?