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

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

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 16, normalized size of antiderivative = 1.00, 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 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]

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]

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.02, 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])

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\cos (x)}{1-\cos (x)} \, dx \]

Verification is Not applicable to the result.

[In]

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

[Out]

Could not integrate

________________________________________________________________________________________

fricas [A]  time = 0.91, size = 14, normalized size = 0.88 \[ -\frac {x \sin \relax (x) + \cos \relax (x) + 1}{\sin \relax (x)} \]

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)

________________________________________________________________________________________

giac [A]  time = 1.01, size = 12, normalized size = 0.75 \[ -x - \frac {1}{\tan \left (\frac {1}{2} \, x\right )} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.04, size = 17, normalized size = 1.06




method result size



default \(-\frac {1}{\tan \left (\frac {x}{2}\right )}-2 \arctan \left (\tan \left (\frac {x}{2}\right )\right )\) \(17\)
risch \(-x -\frac {2 i}{{\mathrm e}^{i x}-1}\) \(17\)
norman \(\frac {-1-\left (\tan ^{2}\left (\frac {x}{2}\right )\right )-x \tan \left (\frac {x}{2}\right )-x \left (\tan ^{3}\left (\frac {x}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \tan \left (\frac {x}{2}\right )}\) \(44\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.96, size = 23, normalized size = 1.44 \[ -\frac {\cos \relax (x) + 1}{\sin \relax (x)} - 2 \, \arctan \left (\frac {\sin \relax (x)}{\cos \relax (x) + 1}\right ) \]

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

________________________________________________________________________________________

mupad [B]  time = 0.17, size = 10, normalized size = 0.62 \[ -x-\mathrm {cot}\left (\frac {x}{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

- x - cot(x/2)

________________________________________________________________________________________

sympy [A]  time = 0.49, size = 8, normalized size = 0.50 \[ - x - \frac {1}{\tan {\left (\frac {x}{2} \right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-x - 1/tan(x/2)

________________________________________________________________________________________