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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 36, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 2, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.182, Rules used = {1093, 203} \[ \sqrt {2} x-x+\sqrt {2} \tan ^{-1}\left (\frac {\sin (x) \cos (x)}{\sin ^2(x)+\sqrt {2}+1}\right ) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

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])

Rule 1093

Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/(b/
2 - q/2 + c*x^2), x], x] - Dist[c/q, Int[1/(b/2 + q/2 + c*x^2), x], x]] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*
a*c, 0] && PosQ[b^2 - 4*a*c]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.05, size = 19, normalized size = 0.53 \[ \sqrt {2} \tan ^{-1}\left (\sqrt {2} \tan (x)\right )-x \]

Antiderivative was successfully verified.

[In]

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

[Out]

-x + Sqrt[2]*ArcTan[Sqrt[2]*Tan[x]]

________________________________________________________________________________________

fricas [A]  time = 1.08, size = 35, normalized size = 0.97 \[ -\frac {1}{2} \, \sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \cos \relax (x)^{2} - 2 \, \sqrt {2}}{4 \, \cos \relax (x) \sin \relax (x)}\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 0.12, size = 15, normalized size = 0.42 \[ \sqrt {2} \arctan \left (\sqrt {2} \tan \relax (x)\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*arctan(sqrt(2)*tan(x)) - x

________________________________________________________________________________________

maple [A]  time = 0.12, size = 16, normalized size = 0.44 \[ \sqrt {2}\, \arctan \left (\sqrt {2}\, \tan \relax (x )\right )-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.41, size = 15, normalized size = 0.42 \[ \sqrt {2} \arctan \left (\sqrt {2} \tan \relax (x)\right ) - x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

sqrt(2)*arctan(sqrt(2)*tan(x)) - x

________________________________________________________________________________________

mupad [B]  time = 2.65, size = 15, normalized size = 0.42 \[ \sqrt {2}\,\mathrm {atan}\left (\sqrt {2}\,\mathrm {tan}\relax (x)\right )-x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {1}{\tan ^{2}{\relax (x )} + \sec ^{2}{\relax (x )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________