# List of integrals of trigonometric functions

The following is a list of integrals (antiderivative functions) of trigonometric functions. For antiderivatives involving both exponential and trigonometric functions, see List of integrals of exponential functions. For a complete list of antiderivative functions, see lists of integrals. See also trigonometric integral.

Generally, if the function $\sin(x)$ is any trigonometric function, and $\cos(x)$ is its derivative,

$\int a\cos nx\;\mathrm{d}x = \frac{a}{n}\sin nx+C$

In all formulas the constant a is assumed to be nonzero, and C denotes the constant of integration.

## Integrals involving only sine

$\int\sin ax\;\mathrm{d}x = -\frac{1}{a}\cos ax+C\,\!$

$\int\sin^2 {ax}\;\mathrm{d}x = \frac{x}{2} - \frac{1}{4a} \sin 2ax +C= \frac{x}{2} - \frac{1}{2a} \sin ax\cos ax +C\!$

$\int\sin^3 {ax}\;\mathrm{d}x = \frac{\cos 3ax}{12a} - \frac{3 \cos ax}{4a} +C\!$
$\int x\sin^2 {ax}\;\mathrm{d}x = \frac{x^2}{4} - \frac{x}{4a} \sin 2ax - \frac{1}{8a^2} \cos 2ax +C\!$

$\int x^2\sin^2 {ax}\;\mathrm{d}x = \frac{x^3}{6} - \left( \frac {x^2}{4a} - \frac{1}{8a^3} \right) \sin 2ax - \frac{x}{4a^2} \cos 2ax +C\!$

$\int\sin b_1x\sin b_2x\;\mathrm{d}x = \frac{\sin((b_2-b_1)x)}{2(b_2-b_1)}-\frac{\sin((b_1+b_2)x)}{2(b_1+b_2)}+C \qquad\mbox{(for }|b_1|\neq|b_2|\mbox{)}\,\!$

$\int\sin^n {ax}\;\mathrm{d}x = -\frac{\sin^{n-1} ax\cos ax}{na} + \frac{n-1}{n}\int\sin^{n-2} ax\;\mathrm{d}x \qquad\mbox{(for }n>2\mbox{)}\,\!$

$\int\frac{\mathrm{d}x}{\sin ax} = \frac{1}{a}\ln \left|\tan\frac{ax}{2}\right|+C$

$\int\frac{\mathrm{d}x}{\sin^n ax} = \frac{\cos ax}{a(1-n) \sin^{n-1} ax}+\frac{n-2}{n-1}\int\frac{\mathrm{d}x}{\sin^{n-2}ax} \qquad\mbox{(for }n>1\mbox{)}\,\!$

$\int x\sin ax\;\mathrm{d}x = \frac{\sin ax}{a^2}-\frac{x\cos ax}{a}+C\,\!$

$\int x^n\sin ax\;\mathrm{d}x = -\frac{x^n}{a}\cos ax+\frac{n}{a}\int x^{n-1}\cos ax\;\mathrm{d}x = \sum_{k=0}^{2k\leq n} (-1)^{k+1} \frac{x^{n-2k}}{a^{1+2k}}\frac{n!}{(n-2k)!} \cos ax +\sum_{k=0}^{2k+1\leq n}(-1)^k \frac{x^{n-1-2k}}{a^{2+2k}}\frac{n!}{(n-2k-1)!} \sin ax \qquad\mbox{(for }n>0\mbox{)}\,\!$

$\int_{\frac{-a}{2}}^{\frac{a}{2}} x^2\sin^2 {\frac{n\pi x}{a}}\;\mathrm{d}x = \frac{a^3(n^2\pi^2-6)}{24n^2\pi^2} \qquad\mbox{(for }n=2,4,6...\mbox{)}\,\!$

$\int\frac{\sin ax}{x} \mathrm{d}x = \sum_{n=0}^\infty (-1)^n\frac{(ax)^{2n+1}}{(2n+1)\cdot (2n+1)!} +C\,\!$

$\int\frac{\sin ax}{x^n} \mathrm{d}x = -\frac{\sin ax}{(n-1)x^{n-1}} + \frac{a}{n-1}\int\frac{\cos ax}{x^{n-1}} \mathrm{d}x\,\!$

$\int\frac{\mathrm{d}x}{1\pm\sin ax} = \frac{1}{a}\tan\left(\frac{ax}{2}\mp\frac{\pi}{4}\right)+C$

$\int\frac{x\;\mathrm{d}x}{1+\sin ax} = \frac{x}{a}\tan\left(\frac{ax}{2} - \frac{\pi}{4}\right)+\frac{2}{a^2}\ln\left|\cos\left(\frac{ax}{2}-\frac{\pi}{4}\right)\right|+C$

$\int\frac{x\;\mathrm{d}x}{1-\sin ax} = \frac{x}{a}\cot\left(\frac{\pi}{4} - \frac{ax}{2}\right)+\frac{2}{a^2}\ln\left|\sin\left(\frac{\pi}{4}-\frac{ax}{2}\right)\right|+C$

$\int\frac{\sin ax\;\mathrm{d}x}{1\pm\sin ax} = \pm x+\frac{1}{a}\tan\left(\frac{\pi}{4}\mp\frac{ax}{2}\right)+C$

## Integrands involving only cosine

$\int\cos ax\;\mathrm{d}x = \frac{1}{a}\sin ax+C\,\!$
$\int\cos^2 {ax}\;\mathrm{d}x = \frac{x}{2} + \frac{1}{4a} \sin 2ax +C = \frac{x}{2} + \frac{1}{2a} \sin ax\cos ax +C\!$
$\int\cos^n ax\;\mathrm{d}x = \frac{\cos^{n-1} ax\sin ax}{na} + \frac{n-1}{n}\int\cos^{n-2} ax\;\mathrm{d}x \qquad\mbox{(for }n>0\mbox{)}\,\!$
$\int x\cos ax\;\mathrm{d}x = \frac{\cos ax}{a^2} + \frac{x\sin ax}{a}+C\,\!$
$\int x^2\cos^2 {ax}\;\mathrm{d}x = \frac{x^3}{6} + \left( \frac {x^2}{4a} - \frac{1}{8a^3} \right) \sin 2ax + \frac{x}{4a^2} \cos 2ax +C\!$
$\int x^n\cos ax\;\mathrm{d}x = \frac{x^n\sin ax}{a} - \frac{n}{a}\int x^{n-1}\sin ax\;\mathrm{d}x\,= \sum_{k=0}^{2k+1\leq n} (-1)^{k} \frac{x^{n-2k-1}}{a^{2+2k}}\frac{n!}{(n-2k-1)!} \cos ax +\sum_{k=0}^{2k\leq n}(-1)^{k} \frac{x^{n-2k}}{a^{1+2k}}\frac{n!}{(n-2k)!} \sin ax \!$
$\int\frac{\cos ax}{x} \mathrm{d}x = \ln|ax|+\sum_{k=1}^\infty (-1)^k\frac{(ax)^{2k}}{2k\cdot(2k)!}+C\,\!$
$\int\frac{\cos ax}{x^n} \mathrm{d}x = -\frac{\cos ax}{(n-1)x^{n-1}}-\frac{a}{n-1}\int\frac{\sin ax}{x^{n-1}} \mathrm{d}x \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{\cos ax} = \frac{1}{a}\ln\left|\tan\left(\frac{ax}{2}+\frac{\pi}{4}\right)\right|+C$
$\int\frac{\mathrm{d}x}{\cos^n ax} = \frac{\sin ax}{a(n-1) \cos^{n-1} ax} + \frac{n-2}{n-1}\int\frac{\mathrm{d}x}{\cos^{n-2} ax} \qquad\mbox{(for }n>1\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{1+\cos ax} = \frac{1}{a}\tan\frac{ax}{2}+C\,\!$
$\int\frac{\mathrm{d}x}{1-\cos ax} = -\frac{1}{a}\cot\frac{ax}{2}+C$
$\int\frac{x\;\mathrm{d}x}{1+\cos ax} = \frac{x}{a}\tan\frac{ax}{2} + \frac{2}{a^2}\ln\left|\cos\frac{ax}{2}\right|+C$
$\int\frac{x\;\mathrm{d}x}{1-\cos ax} = -\frac{x}{a}\cot\frac{ax}{2}+\frac{2}{a^2}\ln\left|\sin\frac{ax}{2}\right|+C$
$\int\frac{\cos ax\;\mathrm{d}x}{1+\cos ax} = x - \frac{1}{a}\tan\frac{ax}{2}+C\,\!$
$\int\frac{\cos ax\;\mathrm{d}x}{1-\cos ax} = -x-\frac{1}{a}\cot\frac{ax}{2}+C\,\!$
$\int\cos a_1x\cos a_2x\;\mathrm{d}x = \frac{\sin(a_2-a_1)x}{2(a_2-a_1)}+\frac{\sin(a_2+a_1)x}{2(a_2+a_1)}+C \qquad\mbox{(for }|a_1|\neq|a_2|\mbox{)}\,\!$

## Integrands involving only tangent

$\int\tan ax\;\mathrm{d}x = -\frac{1}{a}\ln|\cos ax|+C = \frac{1}{a}\ln|\sec ax|+C\,\!$
$\int \tan^2{x} \, \mathrm{d}x = \tan{x} - x +C$
$\int\tan^n ax\;\mathrm{d}x = \frac{1}{a(n-1)}\tan^{n-1} ax-\int\tan^{n-2} ax\;\mathrm{d}x \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{q \tan ax + p} = \frac{1}{p^2 + q^2}(px + \frac{q}{a}\ln|q\sin ax + p\cos ax|)+C \qquad\mbox{(for }p^2 + q^2\neq 0\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{\tan ax + 1} = \frac{x}{2} + \frac{1}{2a}\ln|\sin ax + \cos ax|+C\,\!$
$\int\frac{\mathrm{d}x}{\tan ax - 1} = -\frac{x}{2} + \frac{1}{2a}\ln|\sin ax - \cos ax|+C\,\!$
$\int\frac{\tan ax\;\mathrm{d}x}{\tan ax + 1} = \frac{x}{2} - \frac{1}{2a}\ln|\sin ax + \cos ax|+C\,\!$
$\int\frac{\tan ax\;\mathrm{d}x}{\tan ax - 1} = \frac{x}{2} + \frac{1}{2a}\ln|\sin ax - \cos ax|+C\,\!$

## Integrands involving only secant

See Integral of the secant function.
$\int \sec{ax} \, \mathrm{d}x = \frac{1}{a}\ln{\left| \sec{ax} + \tan{ax}\right|}+C$
$\int \sec^2{x} \, \mathrm{d}x = \tan{x}+C$
$\int \sec^3 x \, dx = \frac{1}{2}\sec x \tan x + \frac{1}{2}\ln|\sec x + \tan x| + C.$

$\int \sec^n{ax} \, \mathrm{d}x = \frac{\sec^{n-2}{ax} \tan {ax}}{a(n-1)} \,+\, \frac{n-2}{n-1}\int \sec^{n-2}{ax} \, \mathrm{d}x \qquad \mbox{ (for }n \ne 1\mbox{)}\,\!$
$\int \frac{\mathrm{d}x}{\sec{x} + 1} = x - \tan{\frac{x}{2}}+C$

## Integrands involving only cosecant

$\int \csc{ax} \, \mathrm{d}x = -\frac{1}{a}\ln{\left| \csc{ax}+\cot{ax}\right|}+C$
$\int \csc^2{x} \, \mathrm{d}x = -\cot{x}+C$
$\int \csc^n{ax} \, \mathrm{d}x = -\frac{\csc^{n-1}{ax} \cos{ax}}{a(n-1)} \,+\, \frac{n-2}{n-1}\int \csc^{n-2}{ax} \, \mathrm{d}x \qquad \mbox{ (for }n \ne 1\mbox{)}\,\!$
$\int \frac{\mathrm{d}x}{\csc{x} + 1} = x - \frac{2\sin{\frac{x}{2}}}{\cos{\frac{x}{2}}+\sin{\frac{x}{2}}}+C$
$\int \frac{\mathrm{d}x}{\csc{x} - 1} = \frac{2\sin{\frac{x}{2}}}{\cos{\frac{x}{2}}-\sin{\frac{x}{2}}}-x+C$

## Integrands involving only cotangent

$\int\cot ax\;\mathrm{d}x = \frac{1}{a}\ln|\sin ax|+C\,\!$
$\int\cot^n ax\;\mathrm{d}x = -\frac{1}{a(n-1)}\cot^{n-1} ax - \int\cot^{n-2} ax\;\mathrm{d}x \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{1 + \cot ax} = \int\frac{\tan ax\;\mathrm{d}x}{\tan ax+1}\,\!$
$\int\frac{\mathrm{d}x}{1 - \cot ax} = \int\frac{\tan ax\;\mathrm{d}x}{\tan ax-1}\,\!$

## Integrands involving both sine and cosine

$\int\frac{\mathrm{d}x}{\cos ax\pm\sin ax} = \frac{1}{a\sqrt{2}}\ln\left|\tan\left(\frac{ax}{2}\pm\frac{\pi}{8}\right)\right|+C$
$\int\frac{\mathrm{d}x}{(\cos ax\pm\sin ax)^2} = \frac{1}{2a}\tan\left(ax\mp\frac{\pi}{4}\right)+C$
$\int\frac{\mathrm{d}x}{(\cos x + \sin x)^n} = \frac{1}{n-1}\left(\frac{\sin x - \cos x}{(\cos x + \sin x)^{n - 1}} - 2(n - 2)\int\frac{\mathrm{d}x}{(\cos x + \sin x)^{n-2}} \right)$
$\int\frac{\cos ax\;\mathrm{d}x}{\cos ax + \sin ax} = \frac{x}{2} + \frac{1}{2a}\ln\left|\sin ax + \cos ax\right|+C$
$\int\frac{\cos ax\;\mathrm{d}x}{\cos ax - \sin ax} = \frac{x}{2} - \frac{1}{2a}\ln\left|\sin ax - \cos ax\right|+C$
$\int\frac{\sin ax\;\mathrm{d}x}{\cos ax + \sin ax} = \frac{x}{2} - \frac{1}{2a}\ln\left|\sin ax + \cos ax\right|+C$
$\int\frac{\sin ax\;\mathrm{d}x}{\cos ax - \sin ax} = -\frac{x}{2} - \frac{1}{2a}\ln\left|\sin ax - \cos ax\right|+C$
$\int\frac{\cos ax\;\mathrm{d}x}{\sin ax(1+\cos ax)} = -\frac{1}{4a}\tan^2\frac{ax}{2}+\frac{1}{2a}\ln\left|\tan\frac{ax}{2}\right|+C$
$\int\frac{\cos ax\;\mathrm{d}x}{\sin ax(1-\cos ax)} = -\frac{1}{4a}\cot^2\frac{ax}{2}-\frac{1}{2a}\ln\left|\tan\frac{ax}{2}\right|+C$
$\int\frac{\sin ax\;\mathrm{d}x}{\cos ax(1+\sin ax)} = \frac{1}{4a}\cot^2\left(\frac{ax}{2}+\frac{\pi}{4}\right)+\frac{1}{2a}\ln\left|\tan\left(\frac{ax}{2}+\frac{\pi}{4}\right)\right|+C$
$\int\frac{\sin ax\;\mathrm{d}x}{\cos ax(1-\sin ax)} = \frac{1}{4a}\tan^2\left(\frac{ax}{2}+\frac{\pi}{4}\right)-\frac{1}{2a}\ln\left|\tan\left(\frac{ax}{2}+\frac{\pi}{4}\right)\right|+C$
$\int\sin ax\cos ax\;\mathrm{d}x = -\frac{1}{2a}\cos^2 ax +C\,\!$
$\int\sin a_1x\cos a_2x\;\mathrm{d}x = -\frac{\cos((a_1-a_2)x)}{2(a_1-a_2)} -\frac{\cos((a_1+a_2)x)}{2(a_1+a_2)} +C\qquad\mbox{(for }|a_1|\neq|a_2|\mbox{)}\,\!$
$\int\sin^n ax\cos ax\;\mathrm{d}x = \frac{1}{a(n+1)}\sin^{n+1} ax +C\qquad\mbox{(for }n\neq -1\mbox{)}\,\!$
$\int\sin ax\cos^n ax\;\mathrm{d}x = -\frac{1}{a(n+1)}\cos^{n+1} ax +C\qquad\mbox{(for }n\neq -1\mbox{)}\,\!$
$\int\sin^n ax\cos^m ax\;\mathrm{d}x = -\frac{\sin^{n-1} ax\cos^{m+1} ax}{a(n+m)}+\frac{n-1}{n+m}\int\sin^{n-2} ax\cos^m ax\;\mathrm{d}x \qquad\mbox{(for }m,n>0\mbox{)}\,\!$
also: $\int\sin^n ax\cos^m ax\;\mathrm{d}x = \frac{\sin^{n+1} ax\cos^{m-1} ax}{a(n+m)} + \frac{m-1}{n+m}\int\sin^n ax\cos^{m-2} ax\;\mathrm{d}x \qquad\mbox{(for }m,n>0\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{\sin ax\cos ax} = \frac{1}{a}\ln\left|\tan ax\right|+C$
$\int\frac{\mathrm{d}x}{\sin ax\cos^n ax} = \frac{1}{a(n-1)\cos^{n-1} ax}+\int\frac{\mathrm{d}x}{\sin ax\cos^{n-2} ax} \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\mathrm{d}x}{\sin^n ax\cos ax} = -\frac{1}{a(n-1)\sin^{n-1} ax}+\int\frac{\mathrm{d}x}{\sin^{n-2} ax\cos ax} \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\sin ax\;\mathrm{d}x}{\cos^n ax} = \frac{1}{a(n-1)\cos^{n-1} ax} +C\qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\sin^2 ax\;\mathrm{d}x}{\cos ax} = -\frac{1}{a}\sin ax+\frac{1}{a}\ln\left|\tan\left(\frac{\pi}{4}+\frac{ax}{2}\right)\right|+C$
$\int\frac{\sin^2 ax\;\mathrm{d}x}{\cos^n ax} = \frac{\sin ax}{a(n-1)\cos^{n-1}ax}-\frac{1}{n-1}\int\frac{\mathrm{d}x}{\cos^{n-2}ax} \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\sin^n ax\;\mathrm{d}x}{\cos ax} = -\frac{\sin^{n-1} ax}{a(n-1)} + \int\frac{\sin^{n-2} ax\;\mathrm{d}x}{\cos ax} \qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\sin^n ax\;\mathrm{d}x}{\cos^m ax} = \frac{\sin^{n+1} ax}{a(m-1)\cos^{m-1} ax}-\frac{n-m+2}{m-1}\int\frac{\sin^n ax\;\mathrm{d}x}{\cos^{m-2} ax} \qquad\mbox{(for }m\neq 1\mbox{)}\,\!$
also: $\int\frac{\sin^n ax\;\mathrm{d}x}{\cos^m ax} = -\frac{\sin^{n-1} ax}{a(n-m)\cos^{m-1} ax}+\frac{n-1}{n-m}\int\frac{\sin^{n-2} ax\;\mathrm{d}x}{\cos^m ax} \qquad\mbox{(for }m\neq n\mbox{)}\,\!$
also: $\int\frac{\sin^n ax\;\mathrm{d}x}{\cos^m ax} = \frac{\sin^{n-1} ax}{a(m-1)\cos^{m-1} ax}-\frac{n-1}{m-1}\int\frac{\sin^{n-2} ax\;\mathrm{d}x}{\cos^{m-2} ax} \qquad\mbox{(for }m\neq 1\mbox{)}\,\!$
$\int\frac{\cos ax\;\mathrm{d}x}{\sin^n ax} = -\frac{1}{a(n-1)\sin^{n-1} ax} +C\qquad\mbox{(for }n\neq 1\mbox{)}\,\!$
$\int\frac{\cos^2 ax\;\mathrm{d}x}{\sin ax} = \frac{1}{a}\left(\cos ax+\ln\left|\tan\frac{ax}{2}\right|\right) +C$
$\int\frac{\cos^2 ax\;\mathrm{d}x}{\sin^n ax} = -\frac{1}{n-1}\left(\frac{\cos ax}{a\sin^{n-1} ax)}+\int\frac{\mathrm{d}x}{\sin^{n-2} ax}\right) \qquad\mbox{(for }n\neq 1\mbox{)}$
$\int\frac{\cos^n ax\;\mathrm{d}x}{\sin^m ax} = -\frac{\cos^{n+1} ax}{a(m-1)\sin^{m-1} ax} - \frac{n-m+2}{m-1}\int\frac{\cos^n ax\;\mathrm{d}x}{\sin^{m-2} ax} \qquad\mbox{(for }m\neq 1\mbox{)}\,\!$
also: $\int\frac{\cos^n ax\;\mathrm{d}x}{\sin^m ax} = \frac{\cos^{n-1} ax}{a(n-m)\sin^{m-1} ax} + \frac{n-1}{n-m}\int\frac{\cos^{n-2} ax\;\mathrm{d}x}{\sin^m ax} \qquad\mbox{(for }m\neq n\mbox{)}\,\!$
also: $\int\frac{\cos^n ax\;\mathrm{d}x}{\sin^m ax} = -\frac{\cos^{n-1} ax}{a(m-1)\sin^{m-1} ax} - \frac{n-1}{m-1}\int\frac{\cos^{n-2} ax\;\mathrm{d}x}{\sin^{m-2} ax} \qquad\mbox{(for }m\neq 1\mbox{)}\,\!$

## Integrands involving both sine and tangent

$\int \sin ax \tan ax\;\mathrm{d}x = \frac{1}{a}(\ln|\sec ax + \tan ax| - \sin ax)+C\,\!$
$\int\frac{\tan^n ax\;\mathrm{d}x}{\sin^2 ax} = \frac{1}{a(n-1)}\tan^{n-1} (ax) +C\qquad\mbox{(for }n\neq 1\mbox{)}\,\!$

## Integrands involving both cosine and tangent

$\int\frac{\tan^n ax\;\mathrm{d}x}{\cos^2 ax} = \frac{1}{a(n+1)}\tan^{n+1} ax +C\qquad\mbox{(for }n\neq -1\mbox{)}\,\!$

## Integrals containing both sine and cotangent

$\int\frac{\cot^n ax\;\mathrm{d}x}{\sin^2 ax} = -\frac{1}{a(n+1)}\cot^{n+1} ax +C\qquad\mbox{(for }n\neq -1\mbox{)}\,\!$

## Integrands involving both cosine and cotangent

$\int\frac{\cot^n ax\;\mathrm{d}x}{\cos^2 ax} = \frac{1}{a(1-n)}\tan^{1-n} ax +C\qquad\mbox{(for }n\neq 1\mbox{)}\,\!$

## Integrands involving both secant and tangent

$\int\sec x \tan x \ dx= \sec x + C$

## Integrals with symmetric limits

$\int_{{-c}}^{{c}}\sin {x}\;\mathrm{d}x = 0 \!$
$\int_{{-c}}^{{c}}\cos {x}\;\mathrm{d}x = 2\int_{{0}}^{{c}}\cos {x}\;\mathrm{d}x = 2\int_{{-c}}^{{0}}\cos {x}\;\mathrm{d}x = 2\sin {c} \!$
$\int_{{-c}}^{{c}}\tan {x}\;\mathrm{d}x = 0 \!$
$\int_{-\frac{a}{2}}^{\frac{a}{2}} x^2\cos^2 {\frac{n\pi x}{a}}\;\mathrm{d}x = \frac{a^3(n^2\pi^2-6)}{24n^2\pi^2} \qquad\mbox{(for }n=1,3,5...\mbox{)}\,\!$