Ma · Mathematics

How to Integrate cos(1/x)

Published By the 9to5Science editorial team

At a glance

  1. 1. Substitute the reciprocal

    Set u = 1/x, so dx = -du/u².

  2. 2. Integrate by parts

    Rewrite the transformed integral using the derivative of cos(u)/u.

  3. 3. Use the sine integral

    Recognize the remaining integral as the special function Si(u).

  4. 4. Substitute back

    Replace u with 1/x and check the result by differentiation.

The integral ∫cos⁡(1/x) dx\int \cos(1/x)\,dx does not have an elementary antiderivative. It can be written neatly using the sine integral, a standard special function. The result is valid wherever x≠0x\ne 0; because the integrand is undefined at zero, the constant of integration may be chosen independently on the intervals (−∞,0)(-\infty,0) and (0,∞)(0,\infty).

The antiderivative

Define the sine integral by

Si⁡(z)=∫0zsin⁡tt dt.\operatorname{Si}(z)=\int_0^z \frac{\sin t}{t}\,dt.

At t=0t=0, the integrand is understood by its limiting value, which is 11. Then

∫cos⁡(1x) dx=xcos⁡(1x)+Si⁡(1x)+C,x≠0.\int \cos\left(\frac{1}{x}\right)\,dx = x\cos\left(\frac{1}{x}\right)+\operatorname{Si}\left(\frac{1}{x}\right)+C, \qquad x\ne 0.

The sine integral is not one of the elementary functions such as polynomials, exponentials, logarithms, or trigonometric functions. It is a named function used to represent integrals that cannot be expressed in those elementary terms.

Derivation by substitution

Use the substitution

u=1x,x=1u,dx=−1u2 du.u=\frac{1}{x},\qquad x=\frac{1}{u},\qquad dx=-\frac{1}{u^2}\,du.

This transforms the integral into

∫cos⁡(1x) dx=−∫cos⁡uu2 du.\int \cos\left(\frac{1}{x}\right)\,dx =-\int \frac{\cos u}{u^2}\,du.

The derivative of cos⁡u/u\cos u/u is

ddu(cos⁡uu)=−sin⁡uu−cos⁡uu2.\frac{d}{du}\left(\frac{\cos u}{u}\right) =-\frac{\sin u}{u}-\frac{\cos u}{u^2}.

Rearranging gives

−cos⁡uu2=ddu(cos⁡uu)+sin⁡uu.-\frac{\cos u}{u^2} =\frac{d}{du}\left(\frac{\cos u}{u}\right)+\frac{\sin u}{u}.

Therefore,

−∫cos⁡uu2 du=cos⁡uu+∫sin⁡uu du=cos⁡uu+Si⁡(u)+C.-\int \frac{\cos u}{u^2}\,du =\frac{\cos u}{u}+\int \frac{\sin u}{u}\,du =\frac{\cos u}{u}+\operatorname{Si}(u)+C.

Since u=1/xu=1/x, the term cos⁡u/u\cos u/u becomes xcos⁡(1/x)x\cos(1/x), giving the stated formula.

Check by differentiation

Differentiate the proposed antiderivative. By the chain rule,

ddx[xcos⁡(1x)]=cos⁡(1x)+sin⁡(1/x)x.\frac{d}{dx}\left[x\cos\left(\frac{1}{x}\right)\right] =\cos\left(\frac{1}{x}\right)+\frac{\sin(1/x)}{x}.

Also, Si⁡′(z)=sin⁡z/z\operatorname{Si}'(z)=\sin z/z, so

ddxSi⁡(1x)=sin⁡(1/x)1/x(−1x2)=−sin⁡(1/x)x.\frac{d}{dx}\operatorname{Si}\left(\frac{1}{x}\right) =\frac{\sin(1/x)}{1/x}\left(-\frac{1}{x^2}\right) =-\frac{\sin(1/x)}{x}.

The extra terms cancel, leaving cos⁡(1/x)\cos(1/x), as required.

Worked example: a definite integral

For instance, on the interval [1,2][1,2], the fundamental theorem of calculus gives

∫12cos⁡(1x) dx=[xcos⁡(1x)+Si⁡(1x)]12=2cos⁡(12)+Si⁡(12)−cos⁡(1)−Si⁡(1)≈0.761887.\begin{aligned} \int_1^2 \cos\left(\frac{1}{x}\right)\,dx &=\left[x\cos\left(\frac{1}{x}\right)+\operatorname{Si}\left(\frac{1}{x}\right)\right]_1^2\\ &=2\cos\left(\frac12\right)+\operatorname{Si}\left(\frac12\right)-\cos(1)-\operatorname{Si}(1)\\ &\approx 0.761887. \end{aligned}

The special-function values can be evaluated numerically, or approximated using the convergent series

Si⁡(z)=∑k=0∞(−1)kz2k+1(2k+1)(2k+1)!.\operatorname{Si}(z)=\sum_{k=0}^{\infty}\frac{(-1)^k z^{2k+1}}{(2k+1)(2k+1)!}.

For example, the first terms are z−z3/18+z5/600−z7/35280+⋯z-z^3/18+z^5/600-z^7/35280+\cdots. This series is useful for moderate values of zz; for large arguments, a numerical library may use methods better suited to oscillatory functions.

Common mistakes

  • Stopping at the substitution: The transformed integral −∫cos⁡u/u2 du-\int \cos u/u^2\,du still needs to be evaluated. Integration by parts exposes the sine integral.
  • Dropping the chain-rule factor: Differentiating Si⁡(1/x)\operatorname{Si}(1/x) produces −sin⁡(1/x)/x-\sin(1/x)/x, not just −sin⁡(1/x)-\sin(1/x).
  • Claiming an elementary antiderivative: The remaining integral ∫(sin⁡u)/u du\int (\sin u)/u\,du is represented by the non-elementary function Si⁡(u)\operatorname{Si}(u). A special-function answer is exact, not an approximation.
  • Ignoring the domain: The formula is an antiderivative on each interval that avoids zero. It does not make the original integrand defined at x=0x=0.

For a definite integral whose interval crosses zero, the integral must be treated as an improper integral, and convergence should be checked rather than applying the antiderivative across the singular point without comment.

References

  1. NIST Digital Library of Mathematical Functions, §6.2: Definitions and Interrelations (Sine and Cosine Integrals)

Spotted an error? Send a correction. Read how we write and check articles in our editorial policy.