3.485 \(\int \frac{1}{(\sec ^2(x)+\tan ^2(x))^2} \, dx\)

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

[Out]

x - x/Sqrt[2] - ArcTan[(Cos[x]*Sin[x])/(1 + Sqrt[2] + Sin[x]^2)]/Sqrt[2] + Tan[x]/(1 + 2*Tan[x]^2)

________________________________________________________________________________________

Rubi [A]  time = 0.0452656, antiderivative size = 49, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.364, Rules used = {414, 12, 481, 203} \[ -\frac{x}{\sqrt{2}}+x+\frac{\tan (x)}{2 \tan ^2(x)+1}-\frac{\tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\sin ^2(x)+\sqrt{2}+1}\right )}{\sqrt{2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

x - x/Sqrt[2] - ArcTan[(Cos[x]*Sin[x])/(1 + Sqrt[2] + Sin[x]^2)]/Sqrt[2] + Tan[x]/(1 + 2*Tan[x]^2)

Rule 414

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

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 481

Int[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> -Dist[(a*e^n)/(b*c -
a*d), Int[(e*x)^(m - n)/(a + b*x^n), x], x] + Dist[(c*e^n)/(b*c - a*d), Int[(e*x)^(m - n)/(c + d*x^n), x], x]
/; FreeQ[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && IGtQ[n, 0] && LeQ[n, m, 2*n - 1]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

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

Mathematica [A]  time = 0.136855, size = 42, normalized size = 0.86 \[ \frac{-3 x-\sin (2 x)+x \cos (2 x)}{\cos (2 x)-3}-\frac{\tan ^{-1}\left (\sqrt{2} \tan (x)\right )}{\sqrt{2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

-(ArcTan[Sqrt[2]*Tan[x]]/Sqrt[2]) + (-3*x + x*Cos[2*x] - Sin[2*x])/(-3 + Cos[2*x])

________________________________________________________________________________________

Maple [A]  time = 0.057, size = 27, normalized size = 0.6 \begin{align*}{\frac{\tan \left ( x \right ) }{2} \left ( \left ( \tan \left ( x \right ) \right ) ^{2}+{\frac{1}{2}} \right ) ^{-1}}-{\frac{\sqrt{2}\arctan \left ( \tan \left ( x \right ) \sqrt{2} \right ) }{2}}+x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sec(x)^2+tan(x)^2)^2,x)

[Out]

1/2*tan(x)/(tan(x)^2+1/2)-1/2*2^(1/2)*arctan(tan(x)*2^(1/2))+x

________________________________________________________________________________________

Maxima [A]  time = 1.48363, size = 36, normalized size = 0.73 \begin{align*} -\frac{1}{2} \, \sqrt{2} \arctan \left (\sqrt{2} \tan \left (x\right )\right ) + x + \frac{\tan \left (x\right )}{2 \, \tan \left (x\right )^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*sqrt(2)*arctan(sqrt(2)*tan(x)) + x + tan(x)/(2*tan(x)^2 + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.82123, size = 207, normalized size = 4.22 \begin{align*} \frac{4 \, x \cos \left (x\right )^{2} +{\left (\sqrt{2} \cos \left (x\right )^{2} - 2 \, \sqrt{2}\right )} \arctan \left (\frac{3 \, \sqrt{2} \cos \left (x\right )^{2} - 2 \, \sqrt{2}}{4 \, \cos \left (x\right ) \sin \left (x\right )}\right ) - 4 \, \cos \left (x\right ) \sin \left (x\right ) - 8 \, x}{4 \,{\left (\cos \left (x\right )^{2} - 2\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/4*(4*x*cos(x)^2 + (sqrt(2)*cos(x)^2 - 2*sqrt(2))*arctan(1/4*(3*sqrt(2)*cos(x)^2 - 2*sqrt(2))/(cos(x)*sin(x))
) - 4*cos(x)*sin(x) - 8*x)/(cos(x)^2 - 2)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(sec(x)**2+tan(x)**2)**2,x)

[Out]

Integral((tan(x)**2 + sec(x)**2)**(-2), x)

________________________________________________________________________________________

Giac [A]  time = 1.12385, size = 36, normalized size = 0.73 \begin{align*} -\frac{1}{2} \, \sqrt{2} \arctan \left (\sqrt{2} \tan \left (x\right )\right ) + x + \frac{\tan \left (x\right )}{2 \, \tan \left (x\right )^{2} + 1} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*sqrt(2)*arctan(sqrt(2)*tan(x)) + x + tan(x)/(2*tan(x)^2 + 1)