Let R(cosx,sinx)R(\cos x,\sin x) be an expression that arises from cosx\cos x, sinx\sin x and real constants by addition, multiplication and division. Then
reduces to the integral of a rational function by the substitution t=tanx2,t=\tan\frac{x}{2}, hence can be integrated by the method of partial fractions.