3.2.4 \(\int \frac {\sin (x)}{x^2} \, dx\) [104]

Optimal. Leaf size=10 \[ \text {Ci}(x)-\frac {\sin (x)}{x} \]

[Out]

Ci(x)-sin(x)/x

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Int[Sin[x]/x^2,x]

[Out]

CosIntegral[x] - Sin[x]/x

Rule 3378

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[(c + d*x)^(m + 1)*(Sin[e + f*x]/(d*(m
 + 1))), x] - Dist[f/(d*(m + 1)), Int[(c + d*x)^(m + 1)*Cos[e + f*x], x], x] /; FreeQ[{c, d, e, f}, x] && LtQ[
m, -1]

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 {\sin (x)}{x^2} \, dx &=-\frac {\sin (x)}{x}+\int \frac {\cos (x)}{x} \, dx\\ &=\text {Ci}(x)-\frac {\sin (x)}{x}\\ \end {align*}

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/x^2,x]

[Out]

CosIntegral[x] - Sin[x]/x

________________________________________________________________________________________

Mathics [C] Result contains higher order function than in optimal. Order 9 vs. order 4 in optimal.
time = 2.66, size = 20, normalized size = 2.00 \begin {gather*} -\frac {\text {Sin}\left [x\right ]}{x}+\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[Sin[x]/x^2,x]')

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.04, size = 11, normalized size = 1.10

method result size
default \(\cosineIntegral \left (x \right )-\frac {\sin \left (x \right )}{x}\) \(11\)
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}-\frac {\sin \left (x \right )}{x}\) \(31\)
meijerg \(\frac {\sqrt {\pi }\, \left (\frac {4 \gamma -4+4 \ln \left (x \right )}{\sqrt {\pi }}+\frac {4}{\sqrt {\pi }}-\frac {4 \gamma }{\sqrt {\pi }}-\frac {4 \ln \left (2\right )}{\sqrt {\pi }}-\frac {4 \ln \left (\frac {x}{2}\right )}{\sqrt {\pi }}-\frac {4 \sin \left (x \right )}{\sqrt {\pi }\, x}+\frac {4 \cosineIntegral \left (x \right )}{\sqrt {\pi }}\right )}{4}\) \(65\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/x^2,x,method=_RETURNVERBOSE)

[Out]

Ci(x)-sin(x)/x

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/x^2,x, algorithm="maxima")

[Out]

1/2*gamma(-1, I*x) + 1/2*gamma(-1, -I*x)

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 20, normalized size = 2.00 \begin {gather*} \frac {x \operatorname {Ci}\left (-x\right ) + x \operatorname {Ci}\left (x\right ) - 2 \, \sin \left (x\right )}{2 \, x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/x^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/x**2,x)

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 11, normalized size = 1.10 \begin {gather*} \frac {x \mathrm {Ci}\left (x\right )-\sin x}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/x^2,x)

[Out]

(x*cos_integral(x) - sin(x))/x

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/x^2,x)

[Out]

cosint(x) - sin(x)/x

________________________________________________________________________________________