3.477 \(\int \frac{1}{(\cos ^2(x)-\sin ^2(x))^3} \, dx\)

Optimal. Leaf size=32 \[ \frac{\tan (x) \sec ^2(x)}{2 \left (1-\tan ^2(x)\right )^2}+\frac{1}{4} \tanh ^{-1}(2 \sin (x) \cos (x)) \]

[Out]

ArcTanh[2*Cos[x]*Sin[x]]/4 + (Sec[x]^2*Tan[x])/(2*(1 - Tan[x]^2)^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0273345, antiderivative size = 32, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.231, Rules used = {413, 21, 206} \[ \frac{\tan (x) \sec ^2(x)}{2 \left (1-\tan ^2(x)\right )^2}+\frac{1}{4} \tanh ^{-1}(2 \sin (x) \cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[(Cos[x]^2 - Sin[x]^2)^(-3),x]

[Out]

ArcTanh[2*Cos[x]*Sin[x]]/4 + (Sec[x]^2*Tan[x])/(2*(1 - Tan[x]^2)^2)

Rule 413

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

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*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 \frac{1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx &=\operatorname{Subst}\left (\int \frac{\left (1+x^2\right )^2}{\left (1-x^2\right )^3} \, dx,x,\tan (x)\right )\\ &=\frac{\sec ^2(x) \tan (x)}{2 \left (1-\tan ^2(x)\right )^2}-\frac{1}{4} \operatorname{Subst}\left (\int \frac{-2+2 x^2}{\left (1-x^2\right )^2} \, dx,x,\tan (x)\right )\\ &=\frac{\sec ^2(x) \tan (x)}{2 \left (1-\tan ^2(x)\right )^2}+\frac{1}{2} \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\tan (x)\right )\\ &=\frac{1}{4} \tanh ^{-1}(2 \cos (x) \sin (x))+\frac{\sec ^2(x) \tan (x)}{2 \left (1-\tan ^2(x)\right )^2}\\ \end{align*}

Mathematica [A]  time = 0.0066755, size = 22, normalized size = 0.69 \[ \frac{1}{4} \tanh ^{-1}(\sin (2 x))+\frac{1}{4} \tan (2 x) \sec (2 x) \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[x]^2 - Sin[x]^2)^(-3),x]

[Out]

ArcTanh[Sin[2*x]]/4 + (Sec[2*x]*Tan[2*x])/4

________________________________________________________________________________________

Maple [A]  time = 0.037, size = 48, normalized size = 1.5 \begin{align*} -{\frac{1}{4\, \left ( 1+\tan \left ( x \right ) \right ) ^{2}}}+{\frac{1}{4+4\,\tan \left ( x \right ) }}+{\frac{\ln \left ( 1+\tan \left ( x \right ) \right ) }{4}}+{\frac{1}{4\, \left ( \tan \left ( x \right ) -1 \right ) ^{2}}}+{\frac{1}{4\,\tan \left ( x \right ) -4}}-{\frac{\ln \left ( \tan \left ( x \right ) -1 \right ) }{4}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/4/(1+tan(x))^2+1/4/(1+tan(x))+1/4*ln(1+tan(x))+1/4/(tan(x)-1)^2+1/4/(tan(x)-1)-1/4*ln(tan(x)-1)

________________________________________________________________________________________

Maxima [A]  time = 1.00548, size = 51, normalized size = 1.59 \begin{align*} \frac{\tan \left (x\right )^{3} + \tan \left (x\right )}{2 \,{\left (\tan \left (x\right )^{4} - 2 \, \tan \left (x\right )^{2} + 1\right )}} + \frac{1}{4} \, \log \left (\tan \left (x\right ) + 1\right ) - \frac{1}{4} \, \log \left (\tan \left (x\right ) - 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(x)^2-sin(x)^2)^3,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(x)^2-sin(x)^2)^3,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 9.11282, size = 765, normalized size = 23.91 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(x)**2-sin(x)**2)**3,x)

[Out]

log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**8/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)*
*2 + 4) - 12*log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**6/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 -
 48*tan(x/2)**2 + 4) + 38*log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**4/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*
tan(x/2)**4 - 48*tan(x/2)**2 + 4) - 12*log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**2/(4*tan(x/2)**8 - 48*tan(x
/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) + log(tan(x/2)**2 - 2*tan(x/2) - 1)/(4*tan(x/2)**8 - 48*tan(x/2
)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) - log(tan(x/2)**2 + 2*tan(x/2) - 1)*tan(x/2)**8/(4*tan(x/2)**8 -
48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) + 12*log(tan(x/2)**2 + 2*tan(x/2) - 1)*tan(x/2)**6/(4*t
an(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) - 38*log(tan(x/2)**2 + 2*tan(x/2) - 1)*tan
(x/2)**4/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) + 12*log(tan(x/2)**2 + 2*tan(
x/2) - 1)*tan(x/2)**2/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) - log(tan(x/2)**
2 + 2*tan(x/2) - 1)/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) - 4*tan(x/2)**7/(4
*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) - 4*tan(x/2)**5/(4*tan(x/2)**8 - 48*tan(
x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) + 4*tan(x/2)**3/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)
**4 - 48*tan(x/2)**2 + 4) + 4*tan(x/2)/(4*tan(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4)

________________________________________________________________________________________

Giac [A]  time = 1.15252, size = 50, normalized size = 1.56 \begin{align*} -\frac{\sin \left (2 \, x\right )}{4 \,{\left (\sin \left (2 \, x\right )^{2} - 1\right )}} + \frac{1}{8} \, \log \left (\sin \left (2 \, x\right ) + 1\right ) - \frac{1}{8} \, \log \left (-\sin \left (2 \, x\right ) + 1\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(cos(x)^2-sin(x)^2)^3,x, algorithm="giac")

[Out]

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