3.105 \(\int \frac{\sin ^2(x)}{x} \, dx\)

Optimal. Leaf size=15 \[ \frac{\log (x)}{2}-\frac{1}{2} \text{CosIntegral}(2 x) \]

[Out]

-CosIntegral[2*x]/2 + Log[x]/2

________________________________________________________________________________________

Rubi [A]  time = 0.0382972, antiderivative size = 15, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 8, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {3312, 3302} \[ \frac{\log (x)}{2}-\frac{1}{2} \text{CosIntegral}(2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-CosIntegral[2*x]/2 + Log[x]/2

Rule 3312

Int[((c_.) + (d_.)*(x_))^(m_)*sin[(e_.) + (f_.)*(x_)]^(n_), x_Symbol] :> Int[ExpandTrigReduce[(c + d*x)^m, Sin
[e + f*x]^n, x], x] /; FreeQ[{c, d, e, f, m}, x] && IGtQ[n, 1] && ( !RationalQ[m] || (GeQ[m, -1] && LtQ[m, 1])
)

Rule 3302

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

Mathematica [A]  time = 0.0115446, size = 15, normalized size = 1. \[ \frac{\log (x)}{2}-\frac{1}{2} \text{CosIntegral}(2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-CosIntegral[2*x]/2 + Log[x]/2

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 12, normalized size = 0.8 \begin{align*} -{\frac{{\it Ci} \left ( 2\,x \right ) }{2}}+{\frac{\ln \left ( x \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*Ci(2*x)+1/2*ln(x)

________________________________________________________________________________________

Maxima [C]  time = 1.06165, size = 23, normalized size = 1.53 \begin{align*} -\frac{1}{4} \,{\rm Ei}\left (2 i \, x\right ) - \frac{1}{4} \,{\rm Ei}\left (-2 i \, x\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.86062, size = 84, normalized size = 5.6 \begin{align*} -\frac{1}{4} \, \operatorname{Ci}\left (2 \, x\right ) - \frac{1}{4} \, \operatorname{Ci}\left (-2 \, x\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 1.0865, size = 10, normalized size = 0.67 \begin{align*} \frac{\log{\left (x \right )}}{2} - \frac{\operatorname{Ci}{\left (2 x \right )}}{2} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.08195, size = 15, normalized size = 1. \begin{align*} -\frac{1}{2} \, \operatorname{Ci}\left (2 \, x\right ) + \frac{1}{2} \, \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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