3.42 \(\int \frac{\cos (x)}{1-\cos (x)} \, dx\)

Optimal. Leaf size=16 \[ -x-\frac{\sin (x)}{1-\cos (x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0263574, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {2735, 2648} \[ -x-\frac{\sin (x)}{1-\cos (x)} \]

Antiderivative was successfully verified.

[In]

Int[Cos[x]/(1 - Cos[x]),x]

[Out]

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

Rule 2735

Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b*x)/d
, x] - Dist[(b*c - a*d)/d, Int[1/(c + d*Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d
, 0]

Rule 2648

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*} \int \frac{\cos (x)}{1-\cos (x)} \, dx &=-x+\int \frac{1}{1-\cos (x)} \, dx\\ &=-x-\frac{\sin (x)}{1-\cos (x)}\\ \end{align*}

Mathematica [A]  time = 0.0231004, size = 21, normalized size = 1.31 \[ \frac{2 x \sin ^2\left (\frac{x}{2}\right )+\sin (x)}{\cos (x)-1} \]

Antiderivative was successfully verified.

[In]

Integrate[Cos[x]/(1 - Cos[x]),x]

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.01, size = 13, normalized size = 0.8 \begin{align*} - \left ( \tan \left ({\frac{x}{2}} \right ) \right ) ^{-1}-x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.46981, size = 31, normalized size = 1.94 \begin{align*} -\frac{\cos \left (x\right ) + 1}{\sin \left (x\right )} - 2 \, \arctan \left (\frac{\sin \left (x\right )}{\cos \left (x\right ) + 1}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.80118, size = 45, normalized size = 2.81 \begin{align*} -\frac{x \sin \left (x\right ) + \cos \left (x\right ) + 1}{\sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.480344, size = 8, normalized size = 0.5 \begin{align*} - x - \frac{1}{\tan{\left (\frac{x}{2} \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x - 1/tan(x/2)

________________________________________________________________________________________

Giac [A]  time = 1.05088, size = 16, normalized size = 1. \begin{align*} -x - \frac{1}{\tan \left (\frac{1}{2} \, x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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