\(\int \frac {1}{2+3 \cos ^2(x)} \, dx\) [61]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 10, antiderivative size = 37 \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\frac {x}{\sqrt {10}}-\frac {\arctan \left (\frac {3 \cos (x) \sin (x)}{2+\sqrt {10}+3 \cos ^2(x)}\right )}{\sqrt {10}} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 48, normalized size of antiderivative = 1.30, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3260, 209} \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\frac {x}{\sqrt {10}}-\frac {\arctan \left (\frac {\left (\sqrt {\frac {5}{2}}-1\right ) \sin (x) \cos (x)}{\left (\sqrt {\frac {5}{2}}-1\right ) \cos ^2(x)+1}\right )}{\sqrt {10}} \]

[In]

Int[(2 + 3*Cos[x]^2)^(-1),x]

[Out]

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

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

Rule 3260

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]

Rubi steps \begin{align*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{2+5 x^2} \, dx,x,\cot (x)\right ) \\ & = \frac {x}{\sqrt {10}}-\frac {\arctan \left (\frac {\left (-1+\sqrt {\frac {5}{2}}\right ) \cos (x) \sin (x)}{1+\left (-1+\sqrt {\frac {5}{2}}\right ) \cos ^2(x)}\right )}{\sqrt {10}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.54 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.46 \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\frac {\arctan \left (\sqrt {\frac {2}{5}} \tan (x)\right )}{\sqrt {10}} \]

[In]

Integrate[(2 + 3*Cos[x]^2)^(-1),x]

[Out]

ArcTan[Sqrt[2/5]*Tan[x]]/Sqrt[10]

Maple [A] (verified)

Time = 0.16 (sec) , antiderivative size = 14, normalized size of antiderivative = 0.38

method result size
default \(\frac {\sqrt {10}\, \arctan \left (\frac {\tan \left (x \right ) \sqrt {10}}{5}\right )}{10}\) \(14\)
risch \(\frac {i \sqrt {10}\, \ln \left ({\mathrm e}^{2 i x}+\frac {2 \sqrt {10}}{3}+\frac {7}{3}\right )}{20}-\frac {i \sqrt {10}\, \ln \left ({\mathrm e}^{2 i x}-\frac {2 \sqrt {10}}{3}+\frac {7}{3}\right )}{20}\) \(40\)

[In]

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

[Out]

1/10*10^(1/2)*arctan(1/5*tan(x)*10^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.84 \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=-\frac {1}{20} \, \sqrt {10} \arctan \left (\frac {7 \, \sqrt {10} \cos \left (x\right )^{2} - 2 \, \sqrt {10}}{20 \, \cos \left (x\right ) \sin \left (x\right )}\right ) \]

[In]

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

[Out]

-1/20*sqrt(10)*arctan(1/20*(7*sqrt(10)*cos(x)^2 - 2*sqrt(10))/(cos(x)*sin(x)))

Sympy [F]

\[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\int \frac {1}{3 \cos ^{2}{\left (x \right )} + 2}\, dx \]

[In]

integrate(1/(2+3*cos(x)**2),x)

[Out]

Integral(1/(3*cos(x)**2 + 2), x)

Maxima [A] (verification not implemented)

none

Time = 0.31 (sec) , antiderivative size = 13, normalized size of antiderivative = 0.35 \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\frac {1}{10} \, \sqrt {10} \arctan \left (\frac {1}{5} \, \sqrt {10} \tan \left (x\right )\right ) \]

[In]

integrate(1/(2+3*cos(x)^2),x, algorithm="maxima")

[Out]

1/10*sqrt(10)*arctan(1/5*sqrt(10)*tan(x))

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.24 \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\frac {1}{10} \, \sqrt {10} {\left (x + \arctan \left (-\frac {\sqrt {10} \sin \left (2 \, x\right ) - 2 \, \sin \left (2 \, x\right )}{\sqrt {10} \cos \left (2 \, x\right ) + \sqrt {10} - 2 \, \cos \left (2 \, x\right ) + 2}\right )\right )} \]

[In]

integrate(1/(2+3*cos(x)^2),x, algorithm="giac")

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.29 (sec) , antiderivative size = 26, normalized size of antiderivative = 0.70 \[ \int \frac {1}{2+3 \cos ^2(x)} \, dx=\frac {\sqrt {10}\,\left (x-\mathrm {atan}\left (\mathrm {tan}\left (x\right )\right )\right )}{10}+\frac {\sqrt {10}\,\mathrm {atan}\left (\frac {\sqrt {10}\,\mathrm {tan}\left (x\right )}{5}\right )}{10} \]

[In]

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

[Out]

(10^(1/2)*(x - atan(tan(x))))/10 + (10^(1/2)*atan((10^(1/2)*tan(x))/5))/10