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

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

Optimal result

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

[Out]

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

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {2736} \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=\frac {2 x}{\sqrt {3}}-\frac {4 \arctan \left (\frac {\sin (x)}{\cos (x)+\sqrt {3}+2}\right )}{\sqrt {3}} \]

[In]

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

[Out]

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

Rule 2736

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{q = Rt[a^2 - b^2, 2]}, Simp[x/q, x] + Simp
[(2/(d*q))*ArcTan[b*(Cos[c + d*x]/(a + q + b*Sin[c + d*x]))], x]] /; FreeQ[{a, b, c, d}, x] && GtQ[a^2 - b^2,
0] && PosQ[a]

Rubi steps \begin{align*} \text {integral}& = \frac {2 x}{\sqrt {3}}-\frac {4 \arctan \left (\frac {\sin (x)}{2+\sqrt {3}+\cos (x)}\right )}{\sqrt {3}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 20, normalized size of antiderivative = 0.65 \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=\frac {4 \arctan \left (\frac {\tan \left (\frac {x}{2}\right )}{\sqrt {3}}\right )}{\sqrt {3}} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.09 (sec) , antiderivative size = 16, normalized size of antiderivative = 0.52

method result size
default \(\frac {4 \sqrt {3}\, \arctan \left (\frac {\tan \left (\frac {x}{2}\right ) \sqrt {3}}{3}\right )}{3}\) \(16\)
risch \(\frac {2 i \sqrt {3}\, \ln \left ({\mathrm e}^{i x}+\sqrt {3}+2\right )}{3}-\frac {2 i \sqrt {3}\, \ln \left ({\mathrm e}^{i x}-\sqrt {3}+2\right )}{3}\) \(38\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.74 \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=-\frac {2}{3} \, \sqrt {3} \arctan \left (\frac {2 \, \sqrt {3} \cos \left (x\right ) + \sqrt {3}}{3 \, \sin \left (x\right )}\right ) \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.03 \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=\frac {4 \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 )}{3} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 19, normalized size of antiderivative = 0.61 \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=\frac {4}{3} \, \sqrt {3} \arctan \left (\frac {\sqrt {3} \sin \left (x\right )}{3 \, {\left (\cos \left (x\right ) + 1\right )}}\right ) \]

[In]

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

[Out]

4/3*sqrt(3)*arctan(1/3*sqrt(3)*sin(x)/(cos(x) + 1))

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 40, normalized size of antiderivative = 1.29 \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=\frac {2}{3} \, \sqrt {3} {\left (x + 2 \, \arctan \left (-\frac {\sqrt {3} \sin \left (x\right ) - \sin \left (x\right )}{\sqrt {3} \cos \left (x\right ) + \sqrt {3} - \cos \left (x\right ) + 1}\right )\right )} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.03 \[ \int \frac {1}{1+\frac {\cos (x)}{2}} \, dx=\frac {4\,\sqrt {3}\,\left (\frac {x}{2}-\mathrm {atan}\left (\mathrm {tan}\left (\frac {x}{2}\right )\right )\right )}{3}+\frac {4\,\sqrt {3}\,\mathrm {atan}\left (\frac {\sqrt {3}\,\mathrm {tan}\left (\frac {x}{2}\right )}{3}\right )}{3} \]

[In]

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

[Out]

(4*3^(1/2)*(x/2 - atan(tan(x/2))))/3 + (4*3^(1/2)*atan((3^(1/2)*tan(x/2))/3))/3