3.380 \(\int \frac{1}{(2 \sec (x)+\sin (x))^2} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0456749, antiderivative size = 67, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {614, 618, 204} \[ \frac{8 x}{15 \sqrt{15}}+\frac{4 \tan (x)+1}{15 \left (2 \tan ^2(x)+\tan (x)+2\right )}-\frac{8 \tan ^{-1}\left (\frac{1-2 \cos ^2(x)}{2 \sin (x) \cos (x)+\sqrt{15}+4}\right )}{15 \sqrt{15}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 614

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((b + 2*c*x)*(a + b*x + c*x^2)^(p + 1))/((p +
1)*(b^2 - 4*a*c)), x] - Dist[(2*c*(2*p + 3))/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1), x], x] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1] && NeQ[p, -3/2] && IntegerQ[4*p]

Rule 618

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

Rule 204

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

Rubi steps

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

Mathematica [A]  time = 0.114695, size = 58, normalized size = 0.87 \[ \frac{(\sin (2 x)+4) \sec ^2(x) \left (15 (\cos (2 x)-15)+8 \sqrt{15} (\sin (2 x)+4) \tan ^{-1}\left (\frac{4 \tan (x)+1}{\sqrt{15}}\right )\right )}{900 (\sin (x)+2 \sec (x))^2} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(Sec[x]^2*(4 + Sin[2*x])*(15*(-15 + Cos[2*x]) + 8*Sqrt[15]*ArcTan[(1 + 4*Tan[x])/Sqrt[15]]*(4 + Sin[2*x])))/(9
00*(2*Sec[x] + Sin[x])^2)

________________________________________________________________________________________

Maple [A]  time = 0.063, size = 39, normalized size = 0.6 \begin{align*}{\frac{1+4\,\tan \left ( x \right ) }{30+15\,\tan \left ( x \right ) +30\, \left ( \tan \left ( x \right ) \right ) ^{2}}}+{\frac{8\,\sqrt{15}}{225}\arctan \left ({\frac{ \left ( 1+4\,\tan \left ( x \right ) \right ) \sqrt{15}}{15}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(2*sec(x)+sin(x))^2,x)

[Out]

1/15*(1+4*tan(x))/(2+tan(x)+2*tan(x)^2)+8/225*15^(1/2)*arctan(1/15*(1+4*tan(x))*15^(1/2))

________________________________________________________________________________________

Maxima [A]  time = 1.42277, size = 51, normalized size = 0.76 \begin{align*} \frac{8}{225} \, \sqrt{15} \arctan \left (\frac{1}{15} \, \sqrt{15}{\left (4 \, \tan \left (x\right ) + 1\right )}\right ) + \frac{4 \, \tan \left (x\right ) + 1}{15 \,{\left (2 \, \tan \left (x\right )^{2} + \tan \left (x\right ) + 2\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

8/225*sqrt(15)*arctan(1/15*sqrt(15)*(4*tan(x) + 1)) + 1/15*(4*tan(x) + 1)/(2*tan(x)^2 + tan(x) + 2)

________________________________________________________________________________________

Fricas [A]  time = 2.22084, size = 212, normalized size = 3.16 \begin{align*} \frac{4 \,{\left (\sqrt{15} \cos \left (x\right ) \sin \left (x\right ) + 2 \, \sqrt{15}\right )} \arctan \left (\frac{8 \, \sqrt{15} \cos \left (x\right ) \sin \left (x\right ) + \sqrt{15}}{15 \,{\left (2 \, \cos \left (x\right )^{2} - 1\right )}}\right ) + 15 \, \cos \left (x\right )^{2} - 120}{225 \,{\left (\cos \left (x\right ) \sin \left (x\right ) + 2\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.10296, size = 105, normalized size = 1.57 \begin{align*} \frac{8}{225} \, \sqrt{15}{\left (x + \arctan \left (-\frac{\sqrt{15} \sin \left (2 \, x\right ) - \cos \left (2 \, x\right ) - 4 \, \sin \left (2 \, x\right ) - 1}{\sqrt{15} \cos \left (2 \, x\right ) + \sqrt{15} - 4 \, \cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 4}\right )\right )} + \frac{4 \, \tan \left (x\right ) + 1}{15 \,{\left (2 \, \tan \left (x\right )^{2} + \tan \left (x\right ) + 2\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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