3.104 \(\int \cos (x) \cot (x) \, dx\)

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

[Out]

-ArcTanh[Cos[x]] + Cos[x]

_______________________________________________________________________________________

Rubi [A]  time = 0.0217969, antiderivative size = 8, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 5, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.6 \[ \cos (x)-\tanh ^{-1}(\cos (x)) \]

Antiderivative was successfully verified.

[In]  Int[Cos[x]*Cot[x],x]

[Out]

-ArcTanh[Cos[x]] + Cos[x]

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 2.79744, size = 7, normalized size = 0.88 \[ \cos{\left (x \right )} - \operatorname{atanh}{\left (\cos{\left (x \right )} \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(cos(x)**2/sin(x),x)

[Out]

cos(x) - atanh(cos(x))

_______________________________________________________________________________________

Mathematica [B]  time = 0.00678012, size = 19, normalized size = 2.38 \[ \cos (x)+\log \left (\sin \left (\frac{x}{2}\right )\right )-\log \left (\cos \left (\frac{x}{2}\right )\right ) \]

Antiderivative was successfully verified.

[In]  Integrate[Cos[x]*Cot[x],x]

[Out]

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

_______________________________________________________________________________________

Maple [A]  time = 0.013, size = 12, normalized size = 1.5 \[ \cos \left ( x \right ) +\ln \left ( \csc \left ( x \right ) -\cot \left ( x \right ) \right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(cos(x)^2/sin(x),x)

[Out]

cos(x)+ln(csc(x)-cot(x))

_______________________________________________________________________________________

Maxima [A]  time = 1.34157, size = 23, normalized size = 2.88 \[ \cos \left (x\right ) - \frac{1}{2} \, \log \left (\cos \left (x\right ) + 1\right ) + \frac{1}{2} \, \log \left (\cos \left (x\right ) - 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)^2/sin(x),x, algorithm="maxima")

[Out]

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

_______________________________________________________________________________________

Fricas [A]  time = 0.271954, size = 28, normalized size = 3.5 \[ \cos \left (x\right ) - \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 ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)^2/sin(x),x, algorithm="fricas")

[Out]

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

_______________________________________________________________________________________

Sympy [A]  time = 0.097092, size = 19, normalized size = 2.38 \[ \frac{\log{\left (\cos{\left (x \right )} - 1 \right )}}{2} - \frac{\log{\left (\cos{\left (x \right )} + 1 \right )}}{2} + \cos{\left (x \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)**2/sin(x),x)

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.206512, size = 26, normalized size = 3.25 \[ \cos \left (x\right ) - \frac{1}{2} \,{\rm ln}\left (\cos \left (x\right ) + 1\right ) + \frac{1}{2} \,{\rm ln}\left (-\cos \left (x\right ) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(cos(x)^2/sin(x),x, algorithm="giac")

[Out]

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