# Integration Of Trigonometric Functions

## Basic Examples

We saw in the wiki Derivative of Trigonometric Functions the derivatives of \(\sin x\) and \(\cos x:\)

\[\frac{\mathrm{d}}{\mathrm{d}x} \sin ax = a \cos ax, \quad \frac{\mathrm{d}}{\mathrm{d}x} \cos ax = - a \sin ax,\]

where \(a\) is an arbitrary constant.

Since indefinite integration is the anti-derivative, we can say that

\[ \int \cos ax \, \mathrm{d}x= \frac1a \sin ax + C, \quad \int \sin ax \, \mathrm{d}x= - \frac1a \cos ax + C,\]

where \(a\) is an arbitrary constant and \(C\) is the constant of integration.

## Intermediate Examples

We also have that

\[\begin{align} \frac{\mathrm{d}}{\mathrm{d}x} \tan ax &= a \sec^2 ax \\ \frac{\mathrm{d}}{\mathrm{d}x} \cot ax &= - a \csc^2 ax\\ \frac{\mathrm{d}}{\mathrm{d}x} \sec ax &= a \sec ax \tan ax\\ \frac{\mathrm{d}}{\mathrm{d}x} \csc ax &= - a \csc ax \cot ax, \end{align}\]

where \(a\) is an arbitrary constant.

\[\] In this case, the anti-derivative is still indefinite integration, and we can say that

\[\begin{align} \int \sec^2 ax \, \mathrm{d}x &= \frac1a \tan ax + C\\ \int \csc^2 ax \, \mathrm{d}x &= - \frac1a \cot ax + C\\ \int \sec ax \tan ax \, \mathrm{d}x &= \frac1a \sec ax + C\\ \int \csc ax \cot ax \, \mathrm{d}x &= - \frac1a \csc ax + C, \end{align}\]

where \(a\) is an arbitrary constant and \(C\) is the constant of integration.

\[\] The next set of indefinite integrals are the result of trigonometric identities and u-substitution:

\[\begin{align} \int \tan ax \, \mathrm{d}x &= \frac1a \ln |\sec ax| + C\\ \int \cot ax \, \mathrm{d}x &= \frac1a \ln|\sin ax| + C\\ \int \sec ax \, \mathrm{d}x &= \frac1a \ln|\sec ax + \tan ax| + C\\ \int \csc ax \, \mathrm{d}x &= \frac1a \ln|\csc ax - \cot ax| + C, \end{align}\]

where \(a\) is an arbitrary constant and \(C\) is the constant of integration.

## Typical Cases

Now, we'll investigate typical cases of trigonometric integrations.

**Case-1**: Suppose our integrate is of the form

\[\begin{array} &\int \cos mx \cos nx \, dx &\text{or} &\int \sin mx \sin nx \, dx &\text{or} &\int \sin mx \cos nx \, dx. \end{array}\]

In these cases, we can use trigonometric product to sum identities:

\[\cos A \cos B = \frac{1}{2}[\cos(A-B) + \cos(A+B)]\] and likewise for the other two.

Find the integral

\[\int \sin 3x \cos 2x \, dx.\]

Since \(\sin 3x \cos 2x = \frac12\left[\sin(3x+2x) + \sin(3x-2x) \right] =\frac12\left(\sin 5x + \sin x \right), \) the given expression is

\[\begin{align} \int \sin 3x \cos 2x \, dx&= \frac12\left(\int\sin 5x \, dx + \int\sin x \,dx \right)\\ &=-\frac12\left(\frac{\cos 5x}5 + \cos x \right) + C. \ _\square \end{align}\]

**Case-2**: Suppose our integrate is of the form

\[\int \sin^m(x) \cos^n(x)dx\], where \(m,n\) belong to integers.

In this case, we can solve it using U-substitution.

If \(m\) is odd, put \(\cos(x) = t\) and proceed.

If \(n\) is odd, put \(\sin(x) = t\) and proceed.

If both \(m\) and \(n\) are odd, put \(\sin(x)=t \text{ if } m \geq n\) and \(\cos(x)=t\) otherwise.

If both \(m\) and \(n\) are even, use power reducing formulae:

\[\sin^2(x) = \frac{1}{2}(1-\cos(2x)) \text{ and} \cos^2(x) = \frac{1}{2}(1+\cos(2x))\]

- If \(m+n\) is a negative integer, put \(\tan(x) = t\) and proceed.

Find the integral \[\int \sin^2(x) \cos^3(x) dx\]

So, \[\int \sin^2(x) \cos^3(x) dx\]

\[=\int \sin^2(x) \cos^2(x) \cos(x) dx\]

\[=\int\sin^2(x) (1-\sin^2(x)) \cos(x) dx\]

Substitute \(\sin(x) = t, \cos(x)dx = dt\)

\[=\int t^2 (1-t^2) dt\]

\[=\int t^2 dt - \int t^4 dt\]

\[= \frac{t^3}{3} - \frac{t^5}{5} + C\]

\[=\frac{\sin^3(x)}{3} - \frac{\sin^5(x)}{5} + C\]

**Case-3**: \[\int \dfrac{a\sin(x) + b\cos(x) + c}{p\sin(x) + q\cos(x) + r} dx\]

In this case, express NUM = \(\alpha (DEN) + \beta \frac{d}{dx}(DEN) + \gamma\) and then integrate as usual.

Note NUM means the Numerator of the integrand, and DEN means the Denominator of the integrand.

Find the integral \[\int \frac{3\sin(x) + 5\cos(x) + 3}{\sin(x) + 2\cos(x) + 1} dx\]

Express \(3\sin(x) + 5\cos(x) + 3 = \alpha(\sin(x) + 2\cos(x) + 1) + \beta(\cos(x) - 2\sin(x)) + \gamma\)

Thus comparing coefficients of \(\sin(x), \cos(x)\), we obtain:

\(\alpha - 2\beta = 3, \quad 2\alpha + \beta = 5, \quad \alpha + \gamma = 3\)

So, \(\alpha = \frac{13}5 , \beta = -\frac15, \gamma = \frac25\)

\[\int \frac{3\sin(x) + 5\cos(x) + 3}{\sin(x) + 2\cos(x) + 1} dx\]

\[=\alpha\int dx + \beta\int \frac{\cos(x) - 2\sin(x)}{\sin(x) + 2\cos(x) + 1} dx + \int \frac{\gamma}{\sin(x) + 2\cos(x) + 1}dx\]

\[=\alpha\int dx + \beta\int \frac{(\sin(x) + 2\cos(x) + 1)'}{\sin(x) + 2\cos(x) + 1} dx + \gamma\int \frac{1}{\sin(x) + 2\cos(x) + 1}dx\]

\[=\frac{13x}{5} - \frac15 \ln |\sin(x)+2\cos(x)+1| + \frac15(\ln(\sin(x/2) + \cos(x/2)) - 3\ln(3\cos(x/2) - \sin(x/2))) + C\]

where, the last integral was done by

Case-6mentioned below.

**Case-4**: \[\int \frac{a\tan(x) + b}{p\tan(x) + q} dx\]

In this case, change the integrate to the form

\[\int \dfrac{a\sin(x) + b\cos(x)}{p\sin(x) + q\cos(x)} dx\]

and proceed as in Case-3.

Find the integral \[\int \frac{\tan(x) + 2}{5\tan(x) -3} dx\]

**Case - 5**: \[\int \frac{1}{a\sin(x) \pm b\cos(x)} dx\]

In this case, Use \(a= r\cos(\alpha), b= r\sin(\alpha)\) to put the integrate in the form

\[\frac{1}{r} \int \frac{dx}{\sin(x \pm \alpha)}\]

and integrate it using the formula for \(\displaystyle \int \csc(x) dx\).

Find the integral \[\int \frac{1}{2\sin(x) - 5\cos(x)} dx\]

**Case - 6**: \[\int \frac{dx}{a\sin(x)+b\cos(x)+c}\]

In this case, convert the integral into the form

\[\int \frac{\sec^2(x/2)}{2a\tan(x/2) + (c-b)\tan^2(x/2) +(c+b)} dx\]

and then put \(\tan(x/2)=t\) and proceed.

Find the integral \[\int \frac{dx}{\sin(x)+2\cos(x)+1}\]

**Case - 7**: In general, if the integrate is of the form:

\[\int R (sinx, cosx)dx\]

where \(R\) is a rational function, then the universal substitution is to put \(\tan(x/2)=t\).

Now, three special-cases arise:

If \(R(-\sin(x), \cos(x)) = -R(\sin(x), \cos(x))\) then put \(\cos(x)=t\) and proceed.

If \(R(\sin(x), -\cos(x)) = -R(\sin(x), \cos(x))\) then put \(\sin(x)=t\) and proceed.

If \(R(-\sin(x), -\cos(x)) = -R(\sin(x), \cos(x))\) then put \(\tan(x)=t\) and proceed.

**Case - 8**: If the integrate is of the form:

\[\int \frac{\pm\sin(x)\pm \cos(x)}{f(\sin(2x))} dx\],

then substitute \(\displaystyle \int (\pm\sin(x)\pm \cos(x)) = t\) and proceed.

Find the integral \[\int \frac{\cos(x) -\sin(x)}{1 + \sin(2x)}dx\]

**Cite as:**Integration Of Trigonometric Functions.

*Brilliant.org*. Retrieved from https://brilliant.org/wiki/integration-of-trigonometric-functions/