#int (sinx)^2/(sinx+2cosx)*dx#
After using #u=tan(x/2)#, #cosu=(1-u^2)/(u^2+1)#, #sinu=(2u)/(u^2+1)# and #dx=(2du)/(u^2+1)# transforms, this integral became
#int [(2u)/(u^2+1)]^2/[2u/(u^2+1)+2*(1-u^2)/(u^2+1)]*(2du)/(u^2+1)#
=#int (-4u^2*du)/[(u^2+1)^2*(u^2-u-1)]#
After decomposing integrand into basic fractions,
#int (-4u^2*du)/[(u^2+1)^2*(u^2-u-1)]#
=#4/5*int (du)/(u^2+1)+4/5*int ((u-2)*du)/(u^2+1)^2-4/5*int (du)/(u^2-u-1)#
=#4/5*arctanu+2/5*int (2u*du)/(u^2+1)^2-8/5*int (du)/(u^2+1)^2#-#16/5*int (du)/(4u^2-4u-4)#
=#4/5*arctanu-2/5*(u^2+1)^(-1)+C1-8/5*int (du)/(u^2+1)^2#-#8/5*int (2du)/[(2u-1)^2-5]#
#I=int (du)/(u^2+1)^2#
After taking #u=tany# and #du=(secy)^2*dz# transormation, #I# became
#I=int ((secy)^2*dy)/(secy)^4#
=#int (cosy)^2*dy#
=#int 1/2*(1+cos2y)*dy#
=#1/2*y+1/4*sin2y#
After using #u=tany#, #y=arctanu# and #sin2y=2u/(u^2+1)# inverse transforms, I found
#I=int (du)/(u^2+1)^2=1/2*arctanu+1/2*u/(u^2+1)#
#J=int (2du)/[(2u-1)^2-5]#
After taking #2u-1=z# and #2du=dz# transforms, #J# became
#J=int dz/(z^2-5)#
=#int dz/[(z+sqrt5)*(z-sqrt5)]#
=#sqrt5/10*int dz/(z-sqrt5)-sqrt5/10*int dz/(z+sqrt5)#
=#sqrt5/10*Ln(z-sqrt5)-sqrt5/10*Ln(z+sqrt5)#
=#sqrt5/10*Ln[(z-sqrt5)/(z+sqrt5)]#
=#=sqrt5/10*Ln[(2u-1-sqrt5)/(2u-1+sqrt5)]#
Hence,
#int (-4u^2*du)/[(u^2+1)^2*(u^2-u-1)]#
=#4/5*arctanu-2/5*(u^2+1)^(-1)+C1#-#8/5*[1/2*arctanu+1/2*u/(u^2+1)]#
-#8/5*sqrt5/10*Ln[(2u-1-sqrt5)/(2u-1+sqrt5)]#
=#4/5*artanu-2/5*(u^2+1)^(-1)-4/5arctanu-4/5*u/(u^2+1)-(4sqrt5)/25*Ln[(2u-1-sqrt5)/(2u-1+sqrt5)]+C1#
=#-2/5*(u^2+1)^(-1)-4/5*u/(u^2+1)-(4sqrt5)/25*Ln[(2u-1-sqrt5)/(2u-1+sqrt5)]+C1#
Thus,
#int (sinx)^2/(sinx+2cosx)*dx#
=#-2/5*[(tan(x/2)^2+1]^(-1)-4/5*tan(x/2)/[(tan(x/2))^2+1)]-(4sqrt5)/25*Ln[(2tan(x/2)-1-sqrt5)/(2tan(x/2)-1+sqrt5)]+C1#
=#-2/5*(cos(x/2))^2-2/5*sinx-(4sqrt5)/25*Ln[(2tan(x/2)-1-sqrt5)/(2tan(x/2)-1+sqrt5)]+C1#
=#-1/5*cosx-2/5*sinx-(4sqrt5)/25*Ln[(2tan(x/2)-1-sqrt5)/(2tan(x/2)-1+sqrt5)]+C#
Note: #C=C1-1/5#