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

Optimal. Leaf size=25 \[ \frac {\sin (x)}{3 (1+\cos (x))^2}+\frac {\sin (x)}{3 (1+\cos (x))} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 25, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2729, 2727} \begin {gather*} \frac {\sin (x)}{3 (\cos (x)+1)}+\frac {\sin (x)}{3 (\cos (x)+1)^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

Sin[x]/(3*(1 + Cos[x])^2) + Sin[x]/(3*(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]

Rule 2729

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

Rubi steps

\begin {align*} \int \frac {1}{(1+\cos (x))^2} \, dx &=\frac {\sin (x)}{3 (1+\cos (x))^2}+\frac {1}{3} \int \frac {1}{1+\cos (x)} \, dx\\ &=\frac {\sin (x)}{3 (1+\cos (x))^2}+\frac {\sin (x)}{3 (1+\cos (x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 16, normalized size = 0.64 \begin {gather*} \frac {(2+\cos (x)) \sin (x)}{3 (1+\cos (x))^2} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Mathics [A]
time = 1.85, size = 14, normalized size = 0.56 \begin {gather*} \frac {\left (3+\text {Tan}\left [\frac {x}{2}\right ]^2\right ) \text {Tan}\left [\frac {x}{2}\right ]}{6} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

(3 + Tan[x / 2] ^ 2) Tan[x / 2] / 6

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 16, normalized size = 0.64

method result size
default \(\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{6}+\frac {\tan \left (\frac {x}{2}\right )}{2}\) \(16\)
norman \(\frac {\left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{6}+\frac {\tan \left (\frac {x}{2}\right )}{2}\) \(16\)
risch \(\frac {2 i \left (1+3 \,{\mathrm e}^{i x}\right )}{3 \left (1+{\mathrm e}^{i x}\right )^{3}}\) \(22\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 23, normalized size = 0.92 \begin {gather*} \frac {\sin \left (x\right )}{2 \, {\left (\cos \left (x\right ) + 1\right )}} + \frac {\sin \left (x\right )^{3}}{6 \, {\left (\cos \left (x\right ) + 1\right )}^{3}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/2*sin(x)/(cos(x) + 1) + 1/6*sin(x)^3/(cos(x) + 1)^3

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 20, normalized size = 0.80 \begin {gather*} \frac {{\left (\cos \left (x\right ) + 2\right )} \sin \left (x\right )}{3 \, {\left (\cos \left (x\right )^{2} + 2 \, \cos \left (x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 0.19, size = 14, normalized size = 0.56 \begin {gather*} \frac {\tan ^{3}{\left (\frac {x}{2} \right )}}{6} + \frac {\tan {\left (\frac {x}{2} \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

tan(x/2)**3/6 + tan(x/2)/2

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 21, normalized size = 0.84 \begin {gather*} \frac {2}{4} \left (\frac {1}{3} \tan ^{3}\left (\frac {x}{2}\right )+\tan \left (\frac {x}{2}\right )\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.16, size = 14, normalized size = 0.56 \begin {gather*} \frac {\mathrm {tan}\left (\frac {x}{2}\right )\,\left ({\mathrm {tan}\left (\frac {x}{2}\right )}^2+3\right )}{6} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(tan(x/2)*(tan(x/2)^2 + 3))/6

________________________________________________________________________________________