#int (sin2x*dx)/[p(cosx)^2+q(sinx)^2]#
=#int (2sinx*cosx*dx)/[p(cosx)^2+q(sinx)^2]#
=#int (2tanx*dx)/[q(tanx)^2+p]#
=#int (2tanx*[(tanx)^2+1]*dx)/([q(tanx)^2+p][(tanx)^2+1])#
After using #y=tanx# and #dy=[(tanx)^2+1]*dx# transforms, this integral became
#int (2y*dy)/[(y^2+1)*(qy^2+p)]#
After using #z=y^2# and #dz=2y*dy# transforms, it became
#int (dz)/[(z+1)*(qz+p)]#
Now, I decomposed integrand into basic fractions,
#1/[(z+1)*(qz+p)]=A/(z+1)+B/(qz+p)#
After expanding denominator,
#A*(qz+p)+B*(z+1)=1#
Setting #z=-1#, #A*(p-q)=1#, so #A=-1/(q-p)#
Setting #z=-p/q#, #B*(q-p)/q=1#, so #B=q/(q-p)#
Thus,
#int (dz)/[(z+1)*(qz+p)]#
=#q/(q-p)int (dp)/(qz+p)-1/(q-p)int (dp)/(z+1)#
=#1/(q-p)ln(qz+p)-1/(q-p)ln(z+1)+C#
=#1/(q-p)ln(qy^2+p)-1/(q-p)ln(y^2+1)+C#
=#1/(q-p)ln(q(tanx)^2+p)-1/(q-p)ln((tanx)^2+1)+C#
=#1/(q-p)ln(q(tanx)^2+p)-1/(q-p)ln((secx)^2)+C#
=#1/(q-p)ln(p(cosx)^2+q(sinx)^2)+C#