3.2.3 \(\int \frac {\cos (x)}{x} \, dx\) [103]

Optimal. Leaf size=2 \[ \text {Ci}(x) \]

[Out]

Ci(x)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 2, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.167, Rules used = {3383} \begin {gather*} \text {Ci}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Cos[x]/x,x]

[Out]

CosIntegral[x]

Rule 3383

Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[CosIntegral[e - Pi/2 + f*x]/d, x] /; FreeQ
[{c, d, e, f}, x] && EqQ[d*(e - Pi/2) - c*f, 0]

Rubi steps

\begin {align*} \int \frac {\cos (x)}{x} \, dx &=\text {Ci}(x)\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 2, normalized size = 1.00 \begin {gather*} \text {Ci}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/x,x]

[Out]

CosIntegral[x]

________________________________________________________________________________________

Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 4 in optimal.
time = 2.23, size = 13, normalized size = 6.50 \begin {gather*} \text {Ci}\left [x\right ]-\text {Log}\left [x\right ]+\frac {\text {Log}\left [x^2\right ]}{2} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Cos[x]/x,x]')

[Out]

Ci[x] - Log[x] + Log[x ^ 2] / 2

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 3, normalized size = 1.50

method result size
default \(\cosineIntegral \left (x \right )\) \(3\)
risch \(\cosineIntegral \left (x \right )-\frac {i \pi \,\mathrm {csgn}\left (i x \right ) \mathrm {csgn}\left (x \right )}{2}+\frac {i \pi \,\mathrm {csgn}\left (i x \right )}{2}\) \(24\)
meijerg \(\frac {\sqrt {\pi }\, \left (\frac {2 \gamma +2 \ln \left (x \right )}{\sqrt {\pi }}-\frac {2 \gamma }{\sqrt {\pi }}-\frac {2 \ln \left (2\right )}{\sqrt {\pi }}-\frac {2 \ln \left (\frac {x}{2}\right )}{\sqrt {\pi }}+\frac {2 \cosineIntegral \left (x \right )}{\sqrt {\pi }}\right )}{2}\) \(48\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/x,x,method=_RETURNVERBOSE)

[Out]

Ci(x)

________________________________________________________________________________________

Maxima [C] Result contains complex when optimal does not.
time = 0.29, size = 13, normalized size = 6.50 \begin {gather*} \frac {1}{2} \, {\rm Ei}\left (i \, x\right ) + \frac {1}{2} \, {\rm Ei}\left (-i \, x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/x,x, algorithm="maxima")

[Out]

1/2*Ei(I*x) + 1/2*Ei(-I*x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 11 vs. \(2 (2) = 4\).
time = 0.42, size = 11, normalized size = 5.50 \begin {gather*} \frac {1}{2} \, \operatorname {Ci}\left (-x\right ) + \frac {1}{2} \, \operatorname {Ci}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/x,x, algorithm="fricas")

[Out]

1/2*cos_integral(-x) + 1/2*cos_integral(x)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 12 vs. \(2 (2) = 4\)
time = 0.46, size = 12, normalized size = 6.00 \begin {gather*} - \log {\left (x \right )} + \frac {\log {\left (x^{2} \right )}}{2} + \operatorname {Ci}{\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/x,x)

[Out]

-log(x) + log(x**2)/2 + Ci(x)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 2, normalized size = 1.00 \begin {gather*} \mathrm {Ci}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(cos(x)/x,x)

[Out]

cos_integral(x)

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.50 \begin {gather*} \mathrm {cosint}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(cos(x)/x,x)

[Out]

cosint(x)

________________________________________________________________________________________