3.18 \(\int \frac{1}{4-\cos ^2(x)} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0168743, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {3181, 203} \[ \frac{x}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{\sin (x) \cos (x)}{\sin ^2(x)+2 \sqrt{3}+3}\right )}{2 \sqrt{3}} \]

Antiderivative was successfully verified.

[In]

Int[(4 - Cos[x]^2)^(-1),x]

[Out]

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

Rule 3181

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(-1), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist
[ff/f, Subst[Int[1/(a + (a + b)*ff^2*x^2), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x]

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}{4-\cos ^2(x)} \, dx &=-\operatorname{Subst}\left (\int \frac{1}{4+3 x^2} \, dx,x,\cot (x)\right )\\ &=\frac{x}{2 \sqrt{3}}+\frac{\tan ^{-1}\left (\frac{\cos (x) \sin (x)}{3+2 \sqrt{3}+\sin ^2(x)}\right )}{2 \sqrt{3}}\\ \end{align*}

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

Antiderivative was successfully verified.

[In]

Integrate[(4 - Cos[x]^2)^(-1),x]

[Out]

ArcTan[(2*Tan[x])/Sqrt[3]]/(2*Sqrt[3])

________________________________________________________________________________________

Maple [A]  time = 0.013, size = 14, normalized size = 0.3 \begin{align*}{\frac{\sqrt{3}}{6}\arctan \left ({\frac{2\,\sqrt{3}\tan \left ( x \right ) }{3}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(4-cos(x)^2),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.41861, size = 18, normalized size = 0.44 \begin{align*} \frac{1}{6} \, \sqrt{3} \arctan \left (\frac{2}{3} \, \sqrt{3} \tan \left (x\right )\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4-cos(x)^2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.37184, size = 104, normalized size = 2.54 \begin{align*} -\frac{1}{12} \, \sqrt{3} \arctan \left (\frac{7 \, \sqrt{3} \cos \left (x\right )^{2} - 4 \, \sqrt{3}}{12 \, \cos \left (x\right ) \sin \left (x\right )}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4-cos(x)^2),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.757533, size = 61, normalized size = 1.49 \begin{align*} \frac{\sqrt{3} \left (\operatorname{atan}{\left (\frac{\sqrt{3} \tan{\left (\frac{x}{2} \right )}}{3} \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{6} + \frac{\sqrt{3} \left (\operatorname{atan}{\left (\sqrt{3} \tan{\left (\frac{x}{2} \right )} \right )} + \pi \left \lfloor{\frac{\frac{x}{2} - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{6} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4-cos(x)**2),x)

[Out]

sqrt(3)*(atan(sqrt(3)*tan(x/2)/3) + pi*floor((x/2 - pi/2)/pi))/6 + sqrt(3)*(atan(sqrt(3)*tan(x/2)) + pi*floor(
(x/2 - pi/2)/pi))/6

________________________________________________________________________________________

Giac [A]  time = 1.04561, size = 62, normalized size = 1.51 \begin{align*} \frac{1}{6} \, \sqrt{3}{\left (x + \arctan \left (-\frac{\sqrt{3} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt{3} \cos \left (2 \, x\right ) + \sqrt{3} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(4-cos(x)^2),x, algorithm="giac")

[Out]

1/6*sqrt(3)*(x + arctan(-(sqrt(3)*sin(2*x) - 2*sin(2*x))/(sqrt(3)*cos(2*x) + sqrt(3) - 2*cos(2*x) + 2)))