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.0107351, 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, Rules used = {2592, 321, 206} \[ \cos (x)-\tanh ^{-1}(\cos (x)) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 2592

Int[((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*tan[(e_.) + (f_.)*(x_)]^(n_.), x_Symbol] :> With[{ff = FreeFactors[S
in[e + f*x], x]}, Dist[ff/f, Subst[Int[(ff*x)^(m + n)/(a^2 - ff^2*x^2)^((n + 1)/2), x], x, (a*Sin[e + f*x])/ff
], x]] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n + 1)/2]

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rubi steps

\begin{align*} \int \cos (x) \cot (x) \, dx &=-\operatorname{Subst}\left (\int \frac{x^2}{1-x^2} \, dx,x,\cos (x)\right )\\ &=\cos (x)-\operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\cos (x)\right )\\ &=-\tanh ^{-1}(\cos (x))+\cos (x)\\ \end{align*}

Mathematica [B]  time = 0.0041813, 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.007, size = 12, normalized size = 1.5 \begin{align*} \cos \left ( x \right ) +\ln \left ( \csc \left ( x \right ) -\cot \left ( x \right ) \right ) \end{align*}

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 [B]  time = 0.923784, size = 23, normalized size = 2.88 \begin{align*} \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 ) \end{align*}

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 [B]  time = 2.15307, size = 88, normalized size = 11. \begin{align*} \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 ) \end{align*}

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 [B]  time = 0.093097, size = 19, normalized size = 2.38 \begin{align*} \frac{\log{\left (\cos{\left (x \right )} - 1 \right )}}{2} - \frac{\log{\left (\cos{\left (x \right )} + 1 \right )}}{2} + \cos{\left (x \right )} \end{align*}

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 [B]  time = 1.05468, size = 26, normalized size = 3.25 \begin{align*} \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 ) \end{align*}

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*log(cos(x) + 1) + 1/2*log(-cos(x) + 1)