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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

-Cot[x] - Log[Tan[x]] + Log[1 + 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}{x^2 (1+x)} \, dx,x,\tan (x)\right )\\ &=\operatorname{Subst}\left (\int \left (\frac{1}{x^2}-\frac{1}{x}+\frac{1}{1+x}\right ) \, dx,x,\tan (x)\right )\\ &=-\cot (x)-\log (\tan (x))+\log (1+\tan (x))\\ \end{align*}

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.055, size = 18, normalized size = 1.8 \begin{align*} - \left ( \tan \left ( x \right ) \right ) ^{-1}-\ln \left ( \tan \left ( x \right ) \right ) +\ln \left ( 1+\tan \left ( x \right ) \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(1+tan(x))

________________________________________________________________________________________

Maxima [A]  time = 0.960251, size = 23, normalized size = 2.3 \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.17885, size = 124, normalized size = 12.4 \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.1344, size = 26, normalized size = 2.6 \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)))