3.698 \(\int \frac{\sec ^2(x)}{-\tan ^2(x)+\tan ^3(x)} \, dx\)

Optimal. Leaf size=10 \[ \cot (x)+\log (1-\cot (x)) \]

[Out]

Cot[x] + Log[1 - Cot[x]]

________________________________________________________________________________________

Rubi [A]  time = 0.052689, antiderivative size = 15, normalized size of antiderivative = 1.5, number of steps used = 3, number of rules used = 2, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.111, Rules used = {4342, 44} \[ \cot (x)+\log (1-\tan (x))-\log (\tan (x)) \]

Antiderivative was successfully verified.

[In]

Int[Sec[x]^2/(-Tan[x]^2 + Tan[x]^3),x]

[Out]

Cot[x] + Log[1 - Tan[x]] - Log[Tan[x]]

Rule 4342

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFactors[Tan[c*(a + b*x)], x]}, Dist[d/
(b*c), Subst[Int[SubstFor[1, Tan[c*(a + b*x)]/d, u, x], x], x, Tan[c*(a + b*x)]/d], x] /; FunctionOfQ[Tan[c*(a
 + b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Sec] || EqQ[F, sec])

Rule 44

Int[((a_) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*
x)^n, x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0] && ILtQ[m, 0] && IntegerQ[n] &&  !(IGtQ[n, 0] && L
tQ[m + n + 2, 0])

Rubi steps

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

Mathematica [A]  time = 0.0372257, size = 16, normalized size = 1.6 \[ \cot (x)-\log (\sin (x))+\log (\cos (x)-\sin (x)) \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[x]^2/(-Tan[x]^2 + Tan[x]^3),x]

[Out]

Cot[x] + Log[Cos[x] - Sin[x]] - Log[Sin[x]]

________________________________________________________________________________________

Maple [A]  time = 0.058, size = 16, normalized size = 1.6 \begin{align*} \left ( \tan \left ( x \right ) \right ) ^{-1}-\ln \left ( \tan \left ( x \right ) \right ) +\ln \left ( \tan \left ( x \right ) -1 \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(x)^2/(-tan(x)^2+tan(x)^3),x)

[Out]

1/tan(x)-ln(tan(x))+ln(tan(x)-1)

________________________________________________________________________________________

Maxima [A]  time = 0.963174, size = 20, normalized size = 2. \begin{align*} \frac{1}{\tan \left (x\right )} + \log \left (\tan \left (x\right ) - 1\right ) - \log \left (\tan \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(-tan(x)^2+tan(x)^3),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [B]  time = 2.17118, size = 126, normalized size = 12.6 \begin{align*} -\frac{\log \left (-\frac{1}{4} \, \cos \left (x\right )^{2} + \frac{1}{4}\right ) \sin \left (x\right ) - \log \left (-2 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \sin \left (x\right ) - 2 \, \cos \left (x\right )}{2 \, \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(-tan(x)^2+tan(x)^3),x, algorithm="fricas")

[Out]

-1/2*(log(-1/4*cos(x)^2 + 1/4)*sin(x) - log(-2*cos(x)*sin(x) + 1)*sin(x) - 2*cos(x))/sin(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)**2/(-tan(x)**2+tan(x)**3),x)

[Out]

Integral(sec(x)**2/((tan(x) - 1)*tan(x)**2), x)

________________________________________________________________________________________

Giac [A]  time = 1.11066, size = 23, normalized size = 2.3 \begin{align*} \frac{1}{\tan \left (x\right )} + \log \left ({\left | \tan \left (x\right ) - 1 \right |}\right ) - \log \left ({\left | \tan \left (x\right ) \right |}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(x)^2/(-tan(x)^2+tan(x)^3),x, algorithm="giac")

[Out]

1/tan(x) + log(abs(tan(x) - 1)) - log(abs(tan(x)))