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

   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 [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 6, antiderivative size = 9 \[ \int \frac {1}{1+\cos (x)} \, dx=\frac {\sin (x)}{1+\cos (x)} \]

[Out]

sin(x)/(1+cos(x))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 9, 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.167, Rules used = {2727} \[ \int \frac {1}{1+\cos (x)} \, dx=\frac {\sin (x)}{\cos (x)+1} \]

[In]

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

[Out]

Sin[x]/(1 + Cos[x])

Rule 2727

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

Rubi steps \begin{align*} \text {integral}& = \frac {\sin (x)}{1+\cos (x)} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.67 \[ \int \frac {1}{1+\cos (x)} \, dx=\tan \left (\frac {x}{2}\right ) \]

[In]

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

[Out]

Tan[x/2]

Maple [A] (verified)

Time = 0.06 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.56

method result size
default \(\tan \left (\frac {x}{2}\right )\) \(5\)
norman \(\tan \left (\frac {x}{2}\right )\) \(5\)
parallelrisch \(\tan \left (\frac {x}{2}\right )\) \(5\)
risch \(\frac {2 i}{{\mathrm e}^{i x}+1}\) \(13\)

[In]

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

[Out]

tan(1/2*x)

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.00 \[ \int \frac {1}{1+\cos (x)} \, dx=\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} \]

[In]

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

[Out]

sin(x)/(cos(x) + 1)

Sympy [A] (verification not implemented)

Time = 0.09 (sec) , antiderivative size = 3, normalized size of antiderivative = 0.33 \[ \int \frac {1}{1+\cos (x)} \, dx=\tan {\left (\frac {x}{2} \right )} \]

[In]

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

[Out]

tan(x/2)

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 9, normalized size of antiderivative = 1.00 \[ \int \frac {1}{1+\cos (x)} \, dx=\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1} \]

[In]

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

[Out]

sin(x)/(cos(x) + 1)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 30 vs. \(2 (9) = 18\).

Time = 0.29 (sec) , antiderivative size = 30, normalized size of antiderivative = 3.33 \[ \int \frac {1}{1+\cos (x)} \, dx=-\frac {2 \, \tan \left (\frac {1}{2} \, x\right )}{{\left (x^{2} + 1\right )} {\left (\frac {x^{2} - 1}{x^{2} + 1} - 1\right )}} \]

[In]

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

[Out]

-2*tan(1/2*x)/((x^2 + 1)*((x^2 - 1)/(x^2 + 1) - 1))

Mupad [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 4, normalized size of antiderivative = 0.44 \[ \int \frac {1}{1+\cos (x)} \, dx=\mathrm {tan}\left (\frac {x}{2}\right ) \]

[In]

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

[Out]

tan(x/2)