info prev up next book cdrom email home

Cosine Integral


\begin{figure}\begin{center}\BoxedEPSF{CosIntReIm.epsf scaled 700}\end{center}\end{figure}

There are (at least) three types of ``cosine integrals,'' denoted $\mathop{\rm ci}\nolimits (x)$, $\mathop{\rm Ci}\nolimits (x)$, and $\mathop{\rm Cin}\nolimits (x)$:

$\displaystyle \mathop{\rm ci}\nolimits (x)$ $\textstyle \equiv$ $\displaystyle - \int_x^\infty {\cos t\,dt\over t}$ (1)
  $\textstyle =$ $\displaystyle {\textstyle{1\over 2}}[\mathop{\rm ei}\nolimits (ix)+\mathop{\rm ei}\nolimits (-ix)]$ (2)
  $\textstyle =$ $\displaystyle -{\textstyle{1\over 2}}[\hbox{E}_1(ix)+\hbox{E}_1(-ix)],$ (3)
$\displaystyle \mathop{\rm Ci}\nolimits (x)$ $\textstyle \equiv$ $\displaystyle \gamma+\ln z+\int_0^z{\cos t-1\over t}\,dt$ (4)
$\displaystyle \mathop{\rm Cin}\nolimits (x)$ $\textstyle \equiv$ $\displaystyle \int_0^z {(1-\cos t)\,dt\over t}$ (5)
  $\textstyle =$ $\displaystyle -\mathop{\rm Ci}\nolimits (x)+\ln x+\gamma.$ (6)

Here, $\mathop{\rm ei}\nolimits (x)$ is the Exponential Integral, E${}_n(x)$ is the En-Function, and $\gamma$ is the Euler-Mascheroni Constant. $\mathop{\rm ci}\nolimits (x)$ is the function returned by the Mathematica ${}^{\scriptstyle\circledRsymbol}$ (Wolfram Research, Champaign, IL) command CosIntegral[x] and displayed above.

To compute the integral of an Even power times a cosine,

I\equiv \int x^{2n}\cos(mx)\,dx,
\end{displaymath} (7)

use Integration by Parts. Let
u=x^{2n}\qquad dv=\cos(mx)\,dx
\end{displaymath} (8)

du=2nx^{2n-1}\,dx \qquad v={1\over m} \sin(mx),
\end{displaymath} (9)

I={1\over m} x^{2n}\sin(mx)-{2n\over m}\int x^{2n-1}\sin(mx)\,dx.
\end{displaymath} (10)

Using Integration by Parts again,
u=x^{2n-1}\qquad dv=\sin(mx)\,dx
\end{displaymath} (11)

du=(2n-1)x^{2n-2}\,dx \qquad v=-{1\over m} \cos(mx),
\end{displaymath} (12)

$\int x^{2n}\,\cos(mx)\,dx$
$ ={1\over m} x^{2n}\sin(mx)-{2n\over m}\left[{-{1\over m} x^{2n-1}\cos(mx)}\right.$
$ \left.{ +{2n-1\over m}\int x^{2n-2}\cos(mx)\,dx}\right]$
$= {1\over m}x^{2n}\sin(mx)+{2n\over m^2} x^{2n-1}\cos(mx)$
$ -{(2n)(2n-1)\over m^2} \int x^{2n-2}\cos(mx)\,dx$
$= {1\over m}x^{2n}\sin(mx)+{2n\over m^2} x^{2n-1}\cos(mx)$
$ +\ldots+{(2n)!\over m^{2n}} \int x^0\cos(mx)\,dx$
$= {1\over m}x^{2n}\sin(mx)+{2n\over m^2} x^{2n-1}\cos(mx)$
$ +\ldots+{(2n)!\over m^{2n+1}} \sin(mx)$
$=\sin(mx)\sum_{k=0}^n (-1)^{k+1} {(2n)!\over (2n-2k)! m^{2k+1}} x^{2n-2k}$
$ +\cos(mx)\sum_{k=1}^n (-1)^{k+1} {(2n)!\over (2k-2n-1)!m^{2k}} x^{2n-2k+1}.$

Letting $k'\equiv n-k$,

$\int x^{2n}\,\cos(mx)\,dx=\sin(mx)\sum_{k=0}^n (-1)^{n-k+1} {(2n)!\over (2k)!m^{2n-2k+1}} x^{2k}$
$+ \cos(mx) \sum_{k=0}^{n-1} (-1)^{n-k+1} {(2n)!\over (2k-1)!m^{2n-2k}} x^{2k+1}$
$= (-1)^{n+1}(2n)!\left[{\sin(mx)\sum_{k=0}^n {(-1)^k\over (2k)!m^{2n-2k+1}} x^{2k}}\right.$
$ +\left.{\cos(mx)\sum_{k=1}^n {(-1)^{k+1}\over (2k-3)!m^{2n-2k+2}} x^{2k-1}}\right].\quad$ (14)

To find a closed form for an integral power of a cosine function,

I\equiv \int \cos^m x\,dx,
\end{displaymath} (15)

perform an Integration by Parts so that
u=\cos^{m-1} x \qquad dv=\cos x\,dx
\end{displaymath} (16)

du=-(m-1)\cos^{m-2}x\sin x\,dx \qquad v=\sin x.
\end{displaymath} (17)


$ I = \sin x\cos^{m-1} x+(m-1)\int \cos^{m-2}x\sin^2 x\,dx$
$ = \sin x\cos^{m-1} x+(m-1)\left[{\int \cos^{m-2}x\,dx-\int \cos^mx\,dx}\right]$
$ =\sin x\cos^{m-1} x+(m-1)\left[{\int \cos^{m-2}x\,dx-I}\right],\quad$ (18)

I[1+(m-1)] = \sin x\cos^{m-1} x+(m-1)\int \cos^{m-2}x\,dx
\end{displaymath} (19)

I = \int \cos^m x\,dx = {\sin x\cos ^{m-1}x\over m}+{m-1\over m}\int \cos^{m-2} x\,dx.
\end{displaymath} (20)

Now, if $m$ is Even so $m\equiv 2n$, then

$\int\cos^{2n}x\,dx = {\sin x\cos^{2n-1}x\over 2n}+{2n-1\over 2n}\int \cos^{2n-2}x\,dx$
$={\sin x\cos^{2n-1}x\over 2n} +{2n-1\over n}\left[{{\sin x\cos^{2n-3}x\over 2n-2} + {2n-3\over 2n-2} \int \cos^{2n-4}x\,dx}\right]$
$=\sin x\left[{{1\over 2n} \cos^{2n-1}x+{2n-1\over (2n)(2n-2)} \cos^{2n-3}x}\right]+ {(2n-1)(2n-3)\over (2n)(2n-2)} \int \cos^{2n-4} x\,dx$
$= \sin x\left[{{1\over 2n} \cos^{2n-1}x+{2n-1\over (2n)(2n-2)} \cos^{2n-3}x +\ldots}\right]+ {(2n-1)(2n-3)\cdots 1\over (2n)(2n-2)\cdots 2} \int \cos^0 x\,dx$
$= \sin x\sum_{k=1}^n {(2n-2k)!!\over (2n)!!} {(2n-1)!!\over (2n-2k+1)!!}\cos^{2n-2k+1}x+{(2n-1)!!\over (2n)!!} x.$ (21)
Now let $k'\equiv n-k+1$, so $n-k=k'-1$,

$\int\cos^{2n}x\,dx = \sin x\sum_{k=1}^n {(2k-2)!!\over (2n)!!} {(2n-1)!!\over (2k-1)!!}\cos^{2k-1}x+{(2n-1)!!\over (2n)!!} x$
$ = {(2n-1)!!\over (2n)!!}\left[{\sin x\sum_{k=0}^{n-1} {(2k)!!\over (2k+1)!!}\cos^{2k+1}x+ x}\right].\quad$ (22)

Now if $m$ is Odd so $m\equiv 2n+1$, then

$\int\cos^{2n+1}x\,dx = {\sin x\cos^{2n}x\over 2n+1}+{2n\over 2n+1}\int \cos^{2n-1}x\,dx$
$= {\sin x\cos^{2n}x\over 2n+1}+{2n\over 2n+1}\left[{{\sin x\cos ^{2n-2}x\over 2n-1} + {2n-2\over 2n-1} \int \cos^{2n-3}x\,dx}\right]$
$= \sin x\left[{{1\over 2n+1} \cos^{2n}x+{2n\over (2n+1)(2n-1)} \cos^{2n-2}x}\right]+ {(2n)(2n-2)\over (2n+1)(2n-1)} \int \cos^{2n-3} x\,dx$
$= \sin x\left[{{1\over 2n+1} \cos^{2n}x+{2n\over (2n+1)(2n-1)} \cos^{2n-2}x + \ldots}\right]+{(2n)(2n-2)\cdots 2\over (2n+1)(2n-1)\cdots 3} \int \cos x\,dx$
$= \sin x\sum_{k=0}^{n} {(2n-2k-1)!!\over (2n+1)!!} {(2n)!!\over (2n-2k)!!} \cos^{2n-2k}x.$ (23)

Now let $k'\equiv n-k$,

\int\cos^{2n}x\,dx ={(2n)!!\over (2n+1)!!} \sin x\sum_{k=0}^{n} {(2k-1)!!\over(2k)!!} \cos^{2k}x.
\end{displaymath} (24)

The general result is then

\int \cos^m x\,dx=\cases{
{(2n-1)!!\over (2n)!!}\left[{\sin...
...)!!\over (2k)!!} \cos^{2k}x\cr
\qquad {\rm for\ } m=2n+1.\cr}
\end{displaymath} (25)

The infinite integral of a cosine times a Gaussian can also be done in closed form,

\int_{-\infty}^\infty e^{-ax^2}\cos(kx)\,dx = \sqrt{\pi\over a}\,e^{-k^2/4a}.
\end{displaymath} (26)

See also Chi, Damped Exponential Cosine Integral, Nielsen's Spiral, Shi, Sici Spiral, Sine Integral


Abramowitz, M. and Stegun, C. A. (Eds.). ``Sine and Cosine Integrals.'' §5.2 in Handbook of Mathematical Functions with Formulas, Graphs, and Mathematical Tables, 9th printing. New York: Dover, pp. 231-233, 1972.

Arfken, G. Mathematical Methods for Physicists, 3rd ed. Orlando, FL: Academic Press, pp. 342-343, 1985.

Press, W. H.; Flannery, B. P.; Teukolsky, S. A.; and Vetterling, W. T. ``Fresnel Integrals, Cosine and Sine Integrals.'' §6.79 in Numerical Recipes in FORTRAN: The Art of Scientific Computing, 2nd ed. Cambridge, England: Cambridge University Press, pp. 248-252, 1992.

Spanier, J. and Oldham, K. B. ``The Cosine and Sine Integrals.'' Ch. 38 in An Atlas of Functions. Washington, DC: Hemisphere, pp. 361-372, 1987.

info prev up next book cdrom email home

© 1996-9 Eric W. Weisstein