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

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

Optimal result

Integrand size = 18, antiderivative size = 21 \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\cot (x)-\frac {\cot ^2(x)}{2}-\frac {\cot ^3(x)}{3} \]

[Out]

-cot(x)-1/2*cot(x)^2-1/3*cot(x)^3

Rubi [A] (verified)

Time = 0.07 (sec) , antiderivative size = 21, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.056, Rules used = {14} \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\frac {1}{3} \cot ^3(x)-\frac {\cot ^2(x)}{2}-\cot (x) \]

[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*} \text {integral}& = \text {Subst}\left (\int \frac {1+x+x^2}{x^4} \, dx,x,\tan (x)\right ) \\ & = \text {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] (verified)

Time = 0.02 (sec) , antiderivative size = 25, normalized size of antiderivative = 1.19 \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\frac {2 \cot (x)}{3}-\frac {\csc ^2(x)}{2}-\frac {1}{3} \cot (x) \csc ^2(x) \]

[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] (verified)

Time = 0.81 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86

method result size
derivativedivides \(-\cot \left (x \right )-\frac {\cot \left (x \right )^{2}}{2}-\frac {\cot \left (x \right )^{3}}{3}\) \(18\)
default \(-\cot \left (x \right )-\frac {\cot \left (x \right )^{2}}{2}-\frac {\cot \left (x \right )^{3}}{3}\) \(18\)
risch \(\frac {2 \,{\mathrm e}^{4 i x}+4 i {\mathrm e}^{2 i x}-2 \,{\mathrm e}^{2 i x}-\frac {4 i}{3}}{\left ({\mathrm e}^{2 i x}-1\right )^{3}}\) \(37\)

[In]

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

[Out]

-cot(x)-1/2*cot(x)^2-1/3*cot(x)^3

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 29, normalized size of antiderivative = 1.38 \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\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 )} \]

[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]

\[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=- \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 \]

[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)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86 \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\frac {6 \, \tan \left (x\right )^{2} + 3 \, \tan \left (x\right ) + 2}{6 \, \tan \left (x\right )^{3}} \]

[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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.86 \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\frac {6 \, \tan \left (x\right )^{2} + 3 \, \tan \left (x\right ) + 2}{6 \, \tan \left (x\right )^{3}} \]

[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

Mupad [B] (verification not implemented)

Time = 26.58 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.76 \[ \int \frac {\cot (x)+\csc ^2(x)}{1-\cos ^2(x)} \, dx=-\frac {\mathrm {cot}\left (x\right )\,\left (2\,{\mathrm {cot}\left (x\right )}^2+3\,\mathrm {cot}\left (x\right )+6\right )}{6} \]

[In]

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

[Out]

-(cot(x)*(3*cot(x) + 2*cot(x)^2 + 6))/6