3.774 \(\int \frac{\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx\)

Optimal. Leaf size=21 \[ -\frac{1}{3} \cot ^3(x)-\frac{\cot ^2(x)}{2}-\cot (x) \]

[Out]

-Cot[x] - Cot[x]^2/2 - Cot[x]^3/3

________________________________________________________________________________________

Rubi [A]  time = 0.0595257, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 1, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.056, Rules used = {14} \[ -\frac{1}{3} \cot ^3(x)-\frac{\cot ^2(x)}{2}-\cot (x) \]

Antiderivative was successfully verified.

[In]

Int[(Cot[x] + Csc[x]^2)/(1 - Cos[x]^2),x]

[Out]

-Cot[x] - Cot[x]^2/2 - Cot[x]^3/3

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rubi steps

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

Mathematica [A]  time = 0.0182162, size = 25, normalized size = 1.19 \[ -\frac{2 \cot (x)}{3}-\frac{\csc ^2(x)}{2}-\frac{1}{3} \cot (x) \csc ^2(x) \]

Antiderivative was successfully verified.

[In]

Integrate[(Cot[x] + Csc[x]^2)/(1 - Cos[x]^2),x]

[Out]

(-2*Cot[x])/3 - Csc[x]^2/2 - (Cot[x]*Csc[x]^2)/3

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 20, normalized size = 1. \begin{align*} - \left ( \tan \left ( x \right ) \right ) ^{-1}-{\frac{1}{3\, \left ( \tan \left ( x \right ) \right ) ^{3}}}-{\frac{1}{2\, \left ( \tan \left ( x \right ) \right ) ^{2}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cot(x)+csc(x)^2)/(1-cos(x)^2),x)

[Out]

-1/tan(x)-1/3/tan(x)^3-1/2/tan(x)^2

________________________________________________________________________________________

Maxima [A]  time = 0.956223, size = 24, normalized size = 1.14 \begin{align*} -\frac{6 \, \tan \left (x\right )^{2} + 3 \, \tan \left (x\right ) + 2}{6 \, \tan \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cot(x)+csc(x)^2)/(1-cos(x)^2),x, algorithm="maxima")

[Out]

-1/6*(6*tan(x)^2 + 3*tan(x) + 2)/tan(x)^3

________________________________________________________________________________________

Fricas [A]  time = 2.01622, size = 88, normalized size = 4.19 \begin{align*} -\frac{4 \, \cos \left (x\right )^{3} - 6 \, \cos \left (x\right ) - 3 \, \sin \left (x\right )}{6 \,{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cot(x)+csc(x)^2)/(1-cos(x)^2),x, algorithm="fricas")

[Out]

-1/6*(4*cos(x)^3 - 6*cos(x) - 3*sin(x))/((cos(x)^2 - 1)*sin(x))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} - \int \frac{\cot{\left (x \right )}}{\cos ^{2}{\left (x \right )} - 1}\, dx - \int \frac{\csc ^{2}{\left (x \right )}}{\cos ^{2}{\left (x \right )} - 1}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cot(x)+csc(x)**2)/(1-cos(x)**2),x)

[Out]

-Integral(cot(x)/(cos(x)**2 - 1), x) - Integral(csc(x)**2/(cos(x)**2 - 1), x)

________________________________________________________________________________________

Giac [A]  time = 1.10748, size = 24, normalized size = 1.14 \begin{align*} -\frac{6 \, \tan \left (x\right )^{2} + 3 \, \tan \left (x\right ) + 2}{6 \, \tan \left (x\right )^{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cot(x)+csc(x)^2)/(1-cos(x)^2),x, algorithm="giac")

[Out]

-1/6*(6*tan(x)^2 + 3*tan(x) + 2)/tan(x)^3