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

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

Optimal result

Integrand size = 13, antiderivative size = 13 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=\frac {\tan (x)}{1-\tan ^2(x)} \]

[Out]

tan(x)/(1-tan(x)^2)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.077, Rules used = {391} \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=\frac {\tan (x)}{1-\tan ^2(x)} \]

[In]

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

[Out]

Tan[x]/(1 - Tan[x]^2)

Rule 391

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

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1+x^2}{\left (1-x^2\right )^2} \, dx,x,\tan (x)\right ) \\ & = \frac {\tan (x)}{1-\tan ^2(x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.62 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=\frac {1}{2} \tan (2 x) \]

[In]

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

[Out]

Tan[2*x]/2

Maple [C] (verified)

Result contains complex when optimal does not.

Time = 0.52 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00

method result size
risch \(\frac {i}{{\mathrm e}^{4 i x}+1}\) \(13\)
parallelrisch \(\frac {\sin \left (2 x \right )}{2 \cos \left (2 x \right )}\) \(13\)
default \(-\frac {1}{2 \left (\tan \left (x \right )-1\right )}-\frac {1}{2 \left (1+\tan \left (x \right )\right )}\) \(18\)
norman \(\frac {-2 \tan \left (\frac {x}{2}\right )^{3}+2 \tan \left (\frac {x}{2}\right )}{\tan \left (\frac {x}{2}\right )^{4}-6 \tan \left (\frac {x}{2}\right )^{2}+1}\) \(35\)

[In]

int(1/(cos(x)^2-sin(x)^2)^2,x,method=_RETURNVERBOSE)

[Out]

I/(exp(4*I*x)+1)

Fricas [A] (verification not implemented)

none

Time = 0.23 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.15 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=\frac {\cos \left (x\right ) \sin \left (x\right )}{2 \, \cos \left (x\right )^{2} - 1} \]

[In]

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

[Out]

cos(x)*sin(x)/(2*cos(x)^2 - 1)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 48 vs. \(2 (8) = 16\).

Time = 0.63 (sec) , antiderivative size = 48, normalized size of antiderivative = 3.69 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=- \frac {2 \tan ^{3}{\left (\frac {x}{2} \right )}}{\tan ^{4}{\left (\frac {x}{2} \right )} - 6 \tan ^{2}{\left (\frac {x}{2} \right )} + 1} + \frac {2 \tan {\left (\frac {x}{2} \right )}}{\tan ^{4}{\left (\frac {x}{2} \right )} - 6 \tan ^{2}{\left (\frac {x}{2} \right )} + 1} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.92 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=-\frac {\tan \left (x\right )}{\tan \left (x\right )^{2} - 1} \]

[In]

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

[Out]

-tan(x)/(tan(x)^2 - 1)

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.46 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=\frac {1}{2} \, \tan \left (2 \, x\right ) \]

[In]

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

[Out]

1/2*tan(2*x)

Mupad [B] (verification not implemented)

Time = 27.18 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.46 \[ \int \frac {1}{\left (\cos ^2(x)-\sin ^2(x)\right )^2} \, dx=\frac {\mathrm {tan}\left (2\,x\right )}{2} \]

[In]

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

[Out]

tan(2*x)/2