\(\int \cos (x) \csc (2 x) \, dx\) [123]

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [B] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 7, antiderivative size = 7 \[ \int \cos (x) \csc (2 x) \, dx=-\frac {1}{2} \text {arctanh}(\cos (x)) \]

[Out]

-1/2*arctanh(cos(x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {4372, 3855} \[ \int \cos (x) \csc (2 x) \, dx=-\frac {1}{2} \text {arctanh}(\cos (x)) \]

[In]

Int[Cos[x]*Csc[2*x],x]

[Out]

-1/2*ArcTanh[Cos[x]]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4372

Int[(cos[(a_.) + (b_.)*(x_)]*(e_.))^(m_.)*sin[(c_.) + (d_.)*(x_)]^(p_.), x_Symbol] :> Dist[2^p/e^p, Int[(e*Cos
[a + b*x])^(m + p)*Sin[a + b*x]^p, x], x] /; FreeQ[{a, b, c, d, e, m}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2]
&& IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \frac {1}{2} \int \csc (x) \, dx \\ & = -\frac {1}{2} \text {arctanh}(\cos (x)) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(21\) vs. \(2(7)=14\).

Time = 0.01 (sec) , antiderivative size = 21, normalized size of antiderivative = 3.00 \[ \int \cos (x) \csc (2 x) \, dx=\frac {1}{2} \left (-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \]

[In]

Integrate[Cos[x]*Csc[2*x],x]

[Out]

(-Log[Cos[x/2]] + Log[Sin[x/2]])/2

Maple [A] (verified)

Time = 1.41 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.29

method result size
default \(-\frac {\ln \left (\cot \left (x \right )+\csc \left (x \right )\right )}{2}\) \(9\)
risch \(-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{2}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{2}\) \(22\)

[In]

int(cos(x)*csc(2*x),x,method=_RETURNVERBOSE)

[Out]

-1/2*ln(cot(x)+csc(x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 19 vs. \(2 (5) = 10\).

Time = 0.25 (sec) , antiderivative size = 19, normalized size of antiderivative = 2.71 \[ \int \cos (x) \csc (2 x) \, dx=-\frac {1}{4} \, \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \frac {1}{4} \, \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \]

[In]

integrate(cos(x)*csc(2*x),x, algorithm="fricas")

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (7) = 14\).

Time = 0.43 (sec) , antiderivative size = 15, normalized size of antiderivative = 2.14 \[ \int \cos (x) \csc (2 x) \, dx=\frac {\log {\left (\cos {\left (x \right )} - 1 \right )}}{4} - \frac {\log {\left (\cos {\left (x \right )} + 1 \right )}}{4} \]

[In]

integrate(cos(x)*csc(2*x),x)

[Out]

log(cos(x) - 1)/4 - log(cos(x) + 1)/4

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 35 vs. \(2 (5) = 10\).

Time = 0.22 (sec) , antiderivative size = 35, normalized size of antiderivative = 5.00 \[ \int \cos (x) \csc (2 x) \, dx=-\frac {1}{4} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right ) + \frac {1}{4} \, \log \left (\cos \left (x\right )^{2} + \sin \left (x\right )^{2} - 2 \, \cos \left (x\right ) + 1\right ) \]

[In]

integrate(cos(x)*csc(2*x),x, algorithm="maxima")

[Out]

-1/4*log(cos(x)^2 + sin(x)^2 + 2*cos(x) + 1) + 1/4*log(cos(x)^2 + sin(x)^2 - 2*cos(x) + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 17 vs. \(2 (5) = 10\).

Time = 0.26 (sec) , antiderivative size = 17, normalized size of antiderivative = 2.43 \[ \int \cos (x) \csc (2 x) \, dx=-\frac {1}{4} \, \log \left (\cos \left (x\right ) + 1\right ) + \frac {1}{4} \, \log \left (-\cos \left (x\right ) + 1\right ) \]

[In]

integrate(cos(x)*csc(2*x),x, algorithm="giac")

[Out]

-1/4*log(cos(x) + 1) + 1/4*log(-cos(x) + 1)

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.71 \[ \int \cos (x) \csc (2 x) \, dx=-\frac {\mathrm {atanh}\left (\cos \left (x\right )\right )}{2} \]

[In]

int(cos(x)/sin(2*x),x)

[Out]

-atanh(cos(x))/2