3.381 \(\int \frac{1}{(\cos (x)+2 \sec (x))^2} \, dx\)

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

[Out]

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

_______________________________________________________________________________________

Rubi [A]  time = 0.064034, antiderivative size = 55, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.222 \[ \frac{x}{6 \sqrt{6}}+\frac{\tan (x)}{6 \left (2 \tan ^2(x)+3\right )}-\frac{\tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\cos ^2(x)+\sqrt{6}+2}\right )}{6 \sqrt{6}} \]

Antiderivative was successfully verified.

[In]  Int[(Cos[x] + 2*Sec[x])^(-2),x]

[Out]

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

_______________________________________________________________________________________

Rubi in Sympy [A]  time = 21.4266, size = 29, normalized size = 0.53 \[ \frac{\sqrt{6} \operatorname{atan}{\left (\frac{\sqrt{6} \tan{\left (x \right )}}{3} \right )}}{36} + \frac{\tan{\left (x \right )}}{6 \left (2 \tan ^{2}{\left (x \right )} + 3\right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate(1/(cos(x)+2*sec(x))**2,x)

[Out]

sqrt(6)*atan(sqrt(6)*tan(x)/3)/36 + tan(x)/(6*(2*tan(x)**2 + 3))

_______________________________________________________________________________________

Mathematica [A]  time = 0.120515, size = 54, normalized size = 0.98 \[ \frac{(\cos (2 x)+5) \sec ^4(x) \left (6 \sin (2 x)+\sqrt{6} (\cos (2 x)+5) \tan ^{-1}\left (\sqrt{\frac{2}{3}} \tan (x)\right )\right )}{144 \left (2 \sec ^2(x)+1\right )^2} \]

Antiderivative was successfully verified.

[In]  Integrate[(Cos[x] + 2*Sec[x])^(-2),x]

[Out]

((5 + Cos[2*x])*Sec[x]^4*(Sqrt[6]*ArcTan[Sqrt[2/3]*Tan[x]]*(5 + Cos[2*x]) + 6*Si
n[2*x]))/(144*(1 + 2*Sec[x]^2)^2)

_______________________________________________________________________________________

Maple [A]  time = 0.05, size = 29, normalized size = 0.5 \[{\frac{\tan \left ( x \right ) }{18+12\, \left ( \tan \left ( x \right ) \right ) ^{2}}}+{\frac{\sqrt{6}}{36}\arctan \left ({\frac{\tan \left ( x \right ) \sqrt{6}}{3}} \right ) } \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int(1/(cos(x)+2*sec(x))^2,x)

[Out]

1/6*tan(x)/(3+2*tan(x)^2)+1/36*6^(1/2)*arctan(1/3*tan(x)*6^(1/2))

_______________________________________________________________________________________

Maxima [A]  time = 1.54043, size = 38, normalized size = 0.69 \[ \frac{1}{36} \, \sqrt{6} \arctan \left (\frac{1}{3} \, \sqrt{6} \tan \left (x\right )\right ) + \frac{\tan \left (x\right )}{6 \,{\left (2 \, \tan \left (x\right )^{2} + 3\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((cos(x) + 2*sec(x))^(-2),x, algorithm="maxima")

[Out]

1/36*sqrt(6)*arctan(1/3*sqrt(6)*tan(x)) + 1/6*tan(x)/(2*tan(x)^2 + 3)

_______________________________________________________________________________________

Fricas [A]  time = 0.220624, size = 84, normalized size = 1.53 \[ \frac{2 \, \sqrt{6} \cos \left (x\right ) \sin \left (x\right ) -{\left (\cos \left (x\right )^{2} + 2\right )} \arctan \left (\frac{5 \, \sqrt{6} \cos \left (x\right )^{2} - 2 \, \sqrt{6}}{12 \, \cos \left (x\right ) \sin \left (x\right )}\right )}{12 \,{\left (\sqrt{6} \cos \left (x\right )^{2} + 2 \, \sqrt{6}\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((cos(x) + 2*sec(x))^(-2),x, algorithm="fricas")

[Out]

1/12*(2*sqrt(6)*cos(x)*sin(x) - (cos(x)^2 + 2)*arctan(1/12*(5*sqrt(6)*cos(x)^2 -
 2*sqrt(6))/(cos(x)*sin(x))))/(sqrt(6)*cos(x)^2 + 2*sqrt(6))

_______________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate(1/(cos(x)+2*sec(x))**2,x)

[Out]

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

_______________________________________________________________________________________

GIAC/XCAS [A]  time = 0.215598, size = 82, normalized size = 1.49 \[ \frac{1}{36} \, \sqrt{6}{\left (x + \arctan \left (-\frac{\sqrt{6} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt{6} \cos \left (2 \, x\right ) + \sqrt{6} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )} + \frac{\tan \left (x\right )}{6 \,{\left (2 \, \tan \left (x\right )^{2} + 3\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((cos(x) + 2*sec(x))^(-2),x, algorithm="giac")

[Out]

1/36*sqrt(6)*(x + arctan(-(sqrt(6)*sin(2*x) - 2*sin(2*x))/(sqrt(6)*cos(2*x) + sq
rt(6) - 2*cos(2*x) + 2))) + 1/6*tan(x)/(2*tan(x)^2 + 3)