3.5.77 \(\int \frac {1}{(\cos ^2(x)-\sin ^2(x))^3} \, dx\) [477]

3.5.77.1 Optimal result
3.5.77.2 Mathematica [A] (verified)
3.5.77.3 Rubi [A] (verified)
3.5.77.4 Maple [A] (verified)
3.5.77.5 Fricas [B] (verification not implemented)
3.5.77.6 Sympy [B] (verification not implemented)
3.5.77.7 Maxima [A] (verification not implemented)
3.5.77.8 Giac [A] (verification not implemented)
3.5.77.9 Mupad [B] (verification not implemented)

3.5.77.1 Optimal result

Integrand size = 13, antiderivative size = 32 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=\frac {1}{4} \text {arctanh}(2 \cos (x) \sin (x))+\frac {\sec ^2(x) \tan (x)}{2 \left (1-\tan ^2(x)\right )^2} \]

output
1/4*arctanh(2*cos(x)*sin(x))+1/2*sec(x)^2*tan(x)/(1-tan(x)^2)^2
 
3.5.77.2 Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.69 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=\frac {1}{4} \text {arctanh}(\sin (2 x))+\frac {1}{4} \sec (2 x) \tan (2 x) \]

input
Integrate[(Cos[x]^2 - Sin[x]^2)^(-3),x]
 
output
ArcTanh[Sin[2*x]]/4 + (Sec[2*x]*Tan[2*x])/4
 
3.5.77.3 Rubi [A] (verified)

Time = 0.19 (sec) , antiderivative size = 30, normalized size of antiderivative = 0.94, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.385, Rules used = {3042, 4889, 315, 27, 219}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

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

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{\left (\cos (x)^2-\sin (x)^2\right )^3}dx\)

\(\Big \downarrow \) 4889

\(\displaystyle \int \frac {\left (\tan ^2(x)+1\right )^2}{\left (1-\tan ^2(x)\right )^3}d\tan (x)\)

\(\Big \downarrow \) 315

\(\displaystyle \frac {\tan (x) \left (\tan ^2(x)+1\right )}{2 \left (1-\tan ^2(x)\right )^2}-\frac {1}{4} \int -\frac {2}{1-\tan ^2(x)}d\tan (x)\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{2} \int \frac {1}{1-\tan ^2(x)}d\tan (x)+\frac {\tan (x) \left (\tan ^2(x)+1\right )}{2 \left (1-\tan ^2(x)\right )^2}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {1}{2} \text {arctanh}(\tan (x))+\frac {\tan (x) \left (\tan ^2(x)+1\right )}{2 \left (1-\tan ^2(x)\right )^2}\)

input
Int[(Cos[x]^2 - Sin[x]^2)^(-3),x]
 
output
ArcTanh[Tan[x]]/2 + (Tan[x]*(1 + Tan[x]^2))/(2*(1 - Tan[x]^2)^2)
 

3.5.77.3.1 Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

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

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4889
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors 
[Tan[v], x]}, Simp[d/Coefficient[v, x, 1]   Subst[Int[SubstFor[1/(1 + d^2*x 
^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /;  !FalseQ[v] && FunctionOfQ[N 
onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] &&  !MatchQ[ 
u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I 
ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
 
3.5.77.4 Maple [A] (verified)

Time = 0.77 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.50

method result size
default \(-\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}\) \(48\)
risch \(-\frac {i \left ({\mathrm e}^{6 i x}-{\mathrm e}^{2 i x}\right )}{2 \left ({\mathrm e}^{4 i x}+1\right )^{2}}-\frac {\ln \left ({\mathrm e}^{2 i x}-i\right )}{4}+\frac {\ln \left (i+{\mathrm e}^{2 i x}\right )}{4}\) \(49\)
parallelrisch \(\frac {\left (1+\cos \left (4 x \right )\right ) \ln \left (\frac {-\cos \left (x \right )-\sin \left (x \right )}{\cos \left (x \right )+1}\right )+\left (-\cos \left (4 x \right )-1\right ) \ln \left (\frac {-\cos \left (x \right )+\sin \left (x \right )}{\cos \left (x \right )+1}\right )+2 \sin \left (2 x \right )}{4 \cos \left (4 x \right )+4}\) \(67\)
norman \(\frac {\tan \left (\frac {x}{2}\right )^{3}-\tan \left (\frac {x}{2}\right )^{5}-\tan \left (\frac {x}{2}\right )^{7}+\tan \left (\frac {x}{2}\right )}{\left (\tan \left (\frac {x}{2}\right )^{4}-6 \tan \left (\frac {x}{2}\right )^{2}+1\right )^{2}}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )^{2}-2 \tan \left (\frac {x}{2}\right )-1\right )}{4}-\frac {\ln \left (\tan \left (\frac {x}{2}\right )^{2}+2 \tan \left (\frac {x}{2}\right )-1\right )}{4}\) \(82\)

input
int(1/(cos(x)^2-sin(x)^2)^3,x,method=_RETURNVERBOSE)
 
output
-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/(ta 
n(x)-1)-1/4*ln(tan(x)-1)
 
3.5.77.5 Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (26) = 52\).

Time = 0.25 (sec) , antiderivative size = 74, normalized size of antiderivative = 2.31 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=\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 )}} \]

input
integrate(1/(cos(x)^2-sin(x)^2)^3,x, algorithm="fricas")
 
output
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)
 
3.5.77.6 Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 765 vs. \(2 (29) = 58\).

Time = 1.61 (sec) , antiderivative size = 765, normalized size of antiderivative = 23.91 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=\text {Too large to display} \]

input
integrate(1/(cos(x)**2-sin(x)**2)**3,x)
 
output
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 - 4 
8*tan(x/2)**2 + 4) + 38*log(tan(x/2)**2 - 2*tan(x/2) - 1)*tan(x/2)**4/(4*t 
an(x/2)**8 - 48*tan(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) - 12*l 
og(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*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) - 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 + 15 
2*tan(x/2)**4 - 48*tan(x/2)**2 + 4) + 4*tan(x/2)**3/(4*tan(x/2)**8 - 48*ta 
n(x/2)**6 + 152*tan(x/2)**4 - 48*tan(x/2)**2 + 4) + 4*tan(x/2)/(4*tan(x...
 
3.5.77.7 Maxima [A] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 38, normalized size of antiderivative = 1.19 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=\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 ) \]

input
integrate(1/(cos(x)^2-sin(x)^2)^3,x, algorithm="maxima")
 
output
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)
 
3.5.77.8 Giac [A] (verification not implemented)

Time = 0.28 (sec) , antiderivative size = 37, normalized size of antiderivative = 1.16 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=-\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 ) \]

input
integrate(1/(cos(x)^2-sin(x)^2)^3,x, algorithm="giac")
 
output
-1/4*sin(2*x)/(sin(2*x)^2 - 1) + 1/8*log(sin(2*x) + 1) - 1/8*log(-sin(2*x) 
 + 1)
 
3.5.77.9 Mupad [B] (verification not implemented)

Time = 27.57 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.00 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^3} \, dx=\frac {\mathrm {atanh}\left (\mathrm {tan}\left (x\right )\right )}{2}+\frac {\frac {{\mathrm {tan}\left (x\right )}^3}{2}+\frac {\mathrm {tan}\left (x\right )}{2}}{{\mathrm {tan}\left (x\right )}^4-2\,{\mathrm {tan}\left (x\right )}^2+1} \]

input
int(1/(cos(x)^2 - sin(x)^2)^3,x)
 
output
atanh(tan(x))/2 + (tan(x)/2 + tan(x)^3/2)/(tan(x)^4 - 2*tan(x)^2 + 1)