integration of rational function of sine and cosine

The integration task

R(sinx,cosx)𝑑x, (1)

where the integrand is a rational function of sinx and cosx, changes via the Weierstrass substitutionMathworldPlanetmath

tanx2=t (2)

to a form having an integrand that is a rational function of t.  Namely, since  x=2arctant,  we have

dx= 211+t2dt, (3)

and we can substitute

sinx=2t1+t2,cosx=1-t21+t2, (4)


R(sinx,cosx)𝑑x= 2R(2t1+t2,1-t21+t2)dt1+t2.

Proof of the formulae (4):  Using the double angle formulas of sine and cosine and then dividing the numerators and the denominators by  cos2x2  we obtain


Example.  The above formulae give from  dxsinx  the result


(which can also be expressed in the form -ln|cscx+cotx|+C; see the goniometric formulasPlanetmathPlanetmath).

Note 1.  The substitution (2) is sometimes called the ‘‘universal trigonometric substitution’’ (  In practice, it often gives rational functions that are too complicated.  In many cases, it is more profitable to use other substitutions:

  • In the case  R(sinx)cosxdx  the substitution  sinx=t  is simpler.

  • Similarly, in the case  R(cosx)sinxdx  the substitution  cosx=t  is simpler.

  • If the integrand depends only on tanx, the substitution  tanx=t  is simpler.

  • If the integrand is of the form  R(sin2x,cos2x),  one can use the substitution  tanx=t; then
    cos2x=11+tan2x=11+t2,   sin2x=1-cos2x=t21+t2,   dx=dt1+t2.

Example.  The integration of  dxcos4x𝑑x  is of the last case:


Example.  The integralDlmfPlanetmathI=dxcos3x𝑑x=sec3xdx  is a peculiar case in which one does not have to use the substitutions mentioned above, as integration by parts is a simpler method for evaluating this integral. Thus,




and consequently


Note 2.  There is also the ‘‘universal hyperbolic substitution’’ for integrating rational functions of hyperbolic sineMathworldPlanetmath and cosine:



  • 1 Л. Д. Кдрячев: Математичецкии  анализ.  Издательство  ‘‘ВүсшаяШкола’’. Москва (1970).
Title integration of rational function of sine and cosine
Canonical name IntegrationOfRationalFunctionOfSineAndCosine
Date of creation 2013-03-22 17:05:15
Last modified on 2013-03-22 17:05:15
Owner pahio (2872)
Last modified by pahio (2872)
Numerical id 29
Author pahio (2872)
Entry type Topic
Classification msc 26A36
Synonym universal trigonometric substitution
Related topic GoniometricFormulae
Related topic SubstitutionForIntegration
Related topic WeierstrassSubstitutionFormulas
Related topic EulersSubstitutionsForIntegration
Related topic ErrorsCanCancelEachOtherOut
Defines universal hyperboloc substitution