3.1.82 \(\int \csc (x) \, dx\) [82]

Optimal. Leaf size=5 \[ -\tanh ^{-1}(\cos (x)) \]

[Out]

-arctanh(cos(x))

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 5, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3855} \begin {gather*} -\tanh ^{-1}(\cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x],x]

[Out]

-ArcTanh[Cos[x]]

Rule 3855

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

Rubi steps

\begin {align*} \int \csc (x) \, dx &=-\tanh ^{-1}(\cos (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(17\) vs. \(2(5)=10\).
time = 0.00, size = 17, normalized size = 3.40 \begin {gather*} -\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x],x]

[Out]

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

________________________________________________________________________________________

Mathics [B] Leaf count is larger than twice the leaf count of optimal. \(19\) vs. \(2(5)=10\).
time = 1.83, size = 15, normalized size = 3.00 \begin {gather*} -\frac {\text {Log}\left [1+\text {Cos}\left [x\right ]\right ]}{2}+\frac {\text {Log}\left [-1+\text {Cos}\left [x\right ]\right ]}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[1/Sin[x],x]')

[Out]

-Log[1 + Cos[x]] / 2 + Log[-1 + Cos[x]] / 2

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 9, normalized size = 1.80

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/sin(x),x,method=_RETURNVERBOSE)

[Out]

ln(csc(x)-cot(x))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (5) = 10\).
time = 0.27, size = 15, normalized size = 3.00 \begin {gather*} -\frac {1}{2} \, \log \left (\cos \left (x\right ) + 1\right ) + \frac {1}{2} \, \log \left (\cos \left (x\right ) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 19 vs. \(2 (5) = 10\).
time = 0.34, size = 19, normalized size = 3.80 \begin {gather*} -\frac {1}{2} \, \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) + \frac {1}{2} \, \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 15 vs. \(2 (5) = 10\)
time = 0.05, size = 15, normalized size = 3.00 \begin {gather*} \frac {\log {\left (\cos {\left (x \right )} - 1 \right )}}{2} - \frac {\log {\left (\cos {\left (x \right )} + 1 \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x),x)

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 11, normalized size = 2.20 \begin {gather*} \frac {2}{2} \ln \left |\tan \left (\frac {x}{2}\right )\right | \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/sin(x),x)

[Out]

log(abs(tan(1/2*x)))

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 5, normalized size = 1.00 \begin {gather*} \ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/sin(x),x)

[Out]

log(tan(x/2))

________________________________________________________________________________________