3.4.81 \(\int \frac {1}{(\cos (x)+2 \sec (x))^2} \, dx\) [381]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 55, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.222, Rules used = {205, 209} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {\sin (x) \cos (x)}{\cos ^2(x)+\sqrt {6}+2}\right )}{6 \sqrt {6}}+\frac {x}{6 \sqrt {6}}+\frac {\tan (x)}{6 \left (2 \tan ^2(x)+3\right )} \end {gather*}

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]) + Tan[x]/(6*(3 + 2*Tan[x]^2))

Rule 205

Int[((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(-x)*((a + b*x^n)^(p + 1)/(a*n*(p + 1))), x] + Dist[(n*(p
 + 1) + 1)/(a*n*(p + 1)), Int[(a + b*x^n)^(p + 1), x], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[p, -1] && (
IntegerQ[2*p] || (n == 2 && IntegerQ[4*p]) || (n == 2 && IntegerQ[3*p]) || Denominator[p + 1/n] < Denominator[
p])

Rule 209

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

Rubi steps

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

________________________________________________________________________________________

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

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*Sin[2*x]))/(144*(1 + 2*Sec[x]^2)
^2)

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 29, normalized size = 0.53

method result size
default \(\frac {\tan \left (x \right )}{18+12 \left (\tan ^{2}\left (x \right )\right )}+\frac {\sqrt {6}\, \arctan \left (\frac {\tan \left (x \right ) \sqrt {6}}{3}\right )}{36}\) \(29\)
risch \(\frac {i \left (5 \,{\mathrm e}^{2 i x}+1\right )}{3 \,{\mathrm e}^{4 i x}+30 \,{\mathrm e}^{2 i x}+3}+\frac {i \sqrt {6}\, \ln \left ({\mathrm e}^{2 i x}+2 \sqrt {6}+5\right )}{72}-\frac {i \sqrt {6}\, \ln \left ({\mathrm e}^{2 i x}-2 \sqrt {6}+5\right )}{72}\) \(68\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(x)+2*sec(x))^2,x,method=_RETURNVERBOSE)

[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.53, size = 28, normalized size = 0.51 \begin {gather*} \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 )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(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 = 1.47, size = 58, normalized size = 1.05 \begin {gather*} -\frac {{\left (\sqrt {6} \cos \left (x\right )^{2} + 2 \, \sqrt {6}\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 \, \cos \left (x\right ) \sin \left (x\right )}{72 \, {\left (\cos \left (x\right )^{2} + 2\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

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 [A]
time = 0.71, size = 61, normalized size = 1.11 \begin {gather*} \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 )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(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) + sqrt(6) - 2*cos(2*x) + 2))) + 1/
6*tan(x)/(2*tan(x)^2 + 3)

________________________________________________________________________________________

Mupad [B]
time = 0.39, size = 77, normalized size = 1.40 \begin {gather*} \frac {\sqrt {6}\,\left (2\,\mathrm {atan}\left (\frac {\sqrt {6}\,{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{4}+\frac {5\,\sqrt {6}\,\mathrm {tan}\left (\frac {x}{2}\right )}{12}\right )+2\,\mathrm {atan}\left (\frac {\sqrt {6}\,\mathrm {tan}\left (\frac {x}{2}\right )}{4}\right )\right )}{72}+\frac {\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{9}-\frac {{\mathrm {tan}\left (\frac {x}{2}\right )}^3}{9}}{{\mathrm {tan}\left (\frac {x}{2}\right )}^4+\frac {2\,{\mathrm {tan}\left (\frac {x}{2}\right )}^2}{3}+1} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(6^(1/2)*(2*atan((5*6^(1/2)*tan(x/2))/12 + (6^(1/2)*tan(x/2)^3)/4) + 2*atan((6^(1/2)*tan(x/2))/4)))/72 + (tan(
x/2)/9 - tan(x/2)^3/9)/((2*tan(x/2)^2)/3 + tan(x/2)^4 + 1)

________________________________________________________________________________________