\(\int \cot (x) \, dx\) [79]

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

Optimal result

Integrand size = 2, antiderivative size = 3 \[ \int \cot (x) \, dx=\log (\sin (x)) \]

[Out]

ln(sin(x))

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3556} \[ \int \cot (x) \, dx=\log (\sin (x)) \]

[In]

Int[Cot[x],x]

[Out]

Log[Sin[x]]

Rule 3556

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

Rubi steps \begin{align*} \text {integral}& = \log (\sin (x)) \\ \end{align*}

Mathematica [B] (verified)

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

Time = 0.00 (sec) , antiderivative size = 7, normalized size of antiderivative = 2.33 \[ \int \cot (x) \, dx=\log (\cos (x))+\log (\tan (x)) \]

[In]

Integrate[Cot[x],x]

[Out]

Log[Cos[x]] + Log[Tan[x]]

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 4, normalized size of antiderivative = 1.33

method result size
lookup \(\ln \left (\sin \left (x \right )\right )\) \(4\)
default \(\ln \left (\sin \left (x \right )\right )\) \(4\)
derivativedivides \(-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}+\ln \left (\tan \left (x \right )\right )\) \(14\)
norman \(-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}+\ln \left (\tan \left (x \right )\right )\) \(14\)
risch \(-i x +\ln \left ({\mathrm e}^{2 i x}-1\right )\) \(14\)
parallelrisch \(-\frac {\ln \left (1+\tan ^{2}\left (x \right )\right )}{2}+\ln \left (\tan \left (x \right )\right )\) \(14\)

[In]

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

[Out]

ln(sin(x))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 16 vs. \(2 (3) = 6\).

Time = 0.25 (sec) , antiderivative size = 16, normalized size of antiderivative = 5.33 \[ \int \cot (x) \, dx=\frac {1}{2} \, \log \left (\frac {\tan \left (x\right )^{2}}{\tan \left (x\right )^{2} + 1}\right ) \]

[In]

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

[Out]

1/2*log(tan(x)^2/(tan(x)^2 + 1))

Sympy [A] (verification not implemented)

Time = 0.06 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \cot (x) \, dx=\log {\left (\sin {\left (x \right )} \right )} \]

[In]

integrate(1/tan(x),x)

[Out]

log(sin(x))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 3, normalized size of antiderivative = 1.00 \[ \int \cot (x) \, dx=\log \left (\sin \left (x\right )\right ) \]

[In]

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

[Out]

log(sin(x))

Giac [B] (verification not implemented)

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

Time = 0.28 (sec) , antiderivative size = 17, normalized size of antiderivative = 5.67 \[ \int \cot (x) \, dx=-\frac {1}{2} \, \log \left (\tan \left (x\right )^{2} + 1\right ) + \frac {1}{2} \, \log \left (\tan \left (x\right )^{2}\right ) \]

[In]

integrate(1/tan(x),x, algorithm="giac")

[Out]

-1/2*log(tan(x)^2 + 1) + 1/2*log(tan(x)^2)

Mupad [B] (verification not implemented)

Time = 0.19 (sec) , antiderivative size = 13, normalized size of antiderivative = 4.33 \[ \int \cot (x) \, dx=\ln \left (\mathrm {tan}\left (x\right )\right )-\frac {\ln \left ({\mathrm {tan}\left (x\right )}^2+1\right )}{2} \]

[In]

int(1/tan(x),x)

[Out]

log(tan(x)) - log(tan(x)^2 + 1)/2