What is the Cosine Integral Ci(x)?
The cosine integral, written \(\operatorname{Ci}(x)\), is a special function that appears throughout physics, signal processing, and electromagnetics, especially in antenna theory and the analysis of oscillatory integrals. It is defined for a positive real argument \(x\) as the integral of \((\cos t - 1)/t\) from 0 to \(x\), plus the natural logarithm of \(x\) and the Euler-Mascheroni constant gamma (approximately 0.5772156649). This calculator evaluates \(\operatorname{Ci}(x)\) to full double precision for any real input.
How to use this calculator
Enter the value of \(x\) in the input field and submit. The result is the dimensionless value of \(\operatorname{Ci}(x)\). The domain of the real-valued principal definition is \(x\) greater than 0. At \(x = 0\) the function diverges to negative infinity (a logarithmic singularity), so the calculator reports it as undefined. For negative inputs, the calculator returns \(\operatorname{Ci}(|x|)\), since the real part of \(\operatorname{Ci}(-x)\) equals \(\operatorname{Ci}(x)\); the imaginary component of plus or minus \(i\pi\) is omitted.
The formula explained
The defining relation is $$\operatorname{Ci}(x) = \gamma + \ln|x| + \int_{0}^{x} \frac{\cos t - 1}{t}\, dt$$ Expanding the integrand as a Taylor series and integrating term by term yields the convergent series $$\operatorname{Ci}(x) = \gamma + \ln|x| + \sum_{k=1}^{\infty} \frac{(-1)^{k}\,|x|^{2k}}{2k\,(2k)!}$$ For small to moderate \(x\) (here, \(|x|\) up to 6) this series converges quickly and accurately. For larger \(x\), the calculator switches to the asymptotic representation \(\operatorname{Ci}(x) = f(x)\sin(x) - g(x)\cos(x)\), which avoids the catastrophic cancellation that plagues the series at large arguments. As \(x\) grows, \(\operatorname{Ci}(x)\) decays toward zero while oscillating like \(\sin(x)/x\).
Worked example
For \(x = 1\): \(\ln(1) = 0\), and the series gives $$-0.25 + 0.0104166667 - 0.0002314815 + 0.0000031002 - \ldots \approx -0.2398117421$$ Adding \(\gamma = 0.5772156649\) gives \(\operatorname{Ci}(1) = 0.3374039229\), which matches the known reference value of the cosine integral at 1.
Reference Values of Ci(x)
The cosine integral is defined for real \(x>0\) by \(\operatorname{Ci}(x)=\gamma+\ln x+\int_0^x \frac{\cos t-1}{t}\,dt\). It equals \(-\int_x^{\infty}\frac{\cos t}{t}\,dt\). Reference values (rounded to 10 decimal places):
| x | Ci(x) |
|---|---|
| 0.5 | -0.1777840788 |
| 1 | 0.3374039229 |
| 2 | 0.4229808287 |
| 3 | 0.1196297860 |
| 5 | -0.1900297496 |
| 10 | -0.0454564330 |
Key landmarks
- First zero: \(\operatorname{Ci}(x)=0\) at \(x\approx 0.6165\). Ci is negative for \(0<x<0.6165\) and positive just beyond it.
- Stationary points: since \(\operatorname{Ci}'(x)=\cos x / x\), extrema occur where \(\cos x=0\), i.e. at odd multiples of \(\pi/2\).
- First maximum: at \(x=\pi/2\approx 1.5708\), where Ci is about 0.4720. Next is a minimum at \(3\pi/2\), then a maximum at \(5\pi/2\), and so on.
Constants Used in the Calculation
- Euler–Mascheroni constant: \(\gamma \approx 0.5772156649015329\).
- Switchover threshold: the calculator uses the power series for \(|x|<6\) and an asymptotic expansion for \(|x|\ge 6\).
- Negative arguments: for \(x<0\) the principal value is \(\operatorname{Ci}(x)=\operatorname{Ci}(|x|)+i\pi\). The imaginary offset \(i\pi\) is omitted here, so only the real part, \(\operatorname{Ci}(|x|)\), is reported.
- Units: all quantities are dimensionless.
Series and asymptotic forms
Power series (small \(|x|\)):
$$\operatorname{Ci}(x)=\gamma+\ln|x|+\sum_{k=1}^{\infty}\frac{(-1)^k x^{2k}}{2k\,(2k)!}$$
Asymptotic form (large \(x\)): \(\operatorname{Ci}(x)=f(x)\sin x-g(x)\cos x\), where \(f(x)\sim 1/x\) and \(g(x)\sim 1/x^2\) have known asymptotic series in inverse powers of \(x\).
Interpreting Ci(x) Results
- Small x: Ci(x) behaves like \(\gamma+\ln x\), so it diverges to \(-\infty\) as \(x\to 0^+\). It is negative until its first zero at \(x\approx 0.6165\).
- Oscillation: after the first zero Ci(x) rises to a maximum, then oscillates, changing sign repeatedly with decreasing amplitude.
- Extrema: because \(\operatorname{Ci}'(x)=\cos(x)/x\), the extrema lie at \(x=(n+\tfrac12)\pi\), where \(\cos x=0\). Maxima occur at \(\pi/2, 5\pi/2,\dots\) and minima at \(3\pi/2, 7\pi/2,\dots\)
- Large x: \(\operatorname{Ci}(x)\approx \sin(x)/x\), so the values decay toward 0 like \(1/x\). For example, Ci(10) ≈ -0.0455, while \(\sin(10)/10\approx -0.0544\). The next term in the expansion, \(-\cos x/x^2\), accounts for the difference.
- Relation to Si(x): Ci and the sine integral \(\operatorname{Si}(x)=\int_0^x \frac{\sin t}{t}\,dt\) are companion functions. Both appear in the auxiliary functions \(f\) and \(g\), and in the combination \(\operatorname{Ci}(x)+i\,\operatorname{Si}(x)\), which is related to the exponential integral \(E_1(-ix)\).
- Negative inputs: the result shown is the real part, \(\operatorname{Ci}(|x|)\). The full complex value would add \(i\pi\).
FAQ
Why is Ci(0) undefined? Because \(\ln(x)\) tends to negative infinity as \(x\) approaches 0, the function has a logarithmic singularity there.
What about negative x? Ci is complex for negative arguments. This real calculator returns \(\operatorname{Ci}(|x|)\), the real part, and drops the imaginary term.
How accurate are the results? Results are accurate to roughly machine double precision (about 15 significant digits) across the typical input range.