3.3.97 \(\int (1+\cos (x)) \csc (x) \, dx\) [297]

Optimal. Leaf size=7 \[ \log (1-\cos (x)) \]

[Out]

ln(1-cos(x))

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2746, 31} \begin {gather*} \log (1-\cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(1 + Cos[x])*Csc[x],x]

[Out]

Log[1 - Cos[x]]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 2746

Int[cos[(e_.) + (f_.)*(x_)]^(p_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.), x_Symbol] :> Dist[1/(b^p*f), S
ubst[Int[(a + x)^(m + (p - 1)/2)*(a - x)^((p - 1)/2), x], x, b*Sin[e + f*x]], x] /; FreeQ[{a, b, e, f, m}, x]
&& IntegerQ[(p - 1)/2] && EqQ[a^2 - b^2, 0] && (GeQ[p, -1] ||  !IntegerQ[m + 1/2])

Rubi steps

\begin {align*} \int (1+\cos (x)) \csc (x) \, dx &=-\text {Subst}\left (\int \frac {1}{1-x} \, dx,x,\cos (x)\right )\\ &=\log (1-\cos (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(20\) vs. \(2(7)=14\).
time = 0.01, size = 20, normalized size = 2.86 \begin {gather*} -\log \left (\cos \left (\frac {x}{2}\right )\right )+\log \left (\sin \left (\frac {x}{2}\right )\right )+\log (\sin (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(1 + Cos[x])*Csc[x],x]

[Out]

-Log[Cos[x/2]] + Log[Sin[x/2]] + Log[Sin[x]]

________________________________________________________________________________________

Mathics [B] Leaf count is larger than twice the leaf count of optimal. \(21\) vs. \(2(7)=14\).
time = 1.94, size = 19, normalized size = 2.71 \begin {gather*} -\text {Log}\left [\frac {2}{1+\text {Cos}\left [x\right ]}\right ]+2 \text {Log}\left [\text {Tan}\left [\frac {x}{2}\right ]\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[(1 + Cos[x])*Csc[x],x]')

[Out]

-Log[2 / (1 + Cos[x])] + 2 Log[Tan[x / 2]]

________________________________________________________________________________________

Maple [A]
time = 0.03, size = 6, normalized size = 0.86

method result size
derivativedivides \(\ln \left (\cos \left (x \right )-1\right )\) \(6\)
default \(\ln \left (\cos \left (x \right )-1\right )\) \(6\)
risch \(-i x +2 \ln \left ({\mathrm e}^{i x}-1\right )\) \(16\)
norman \(2 \ln \left (\tan \left (\frac {x}{2}\right )\right )-\ln \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )\) \(20\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

ln(cos(x)-1)

________________________________________________________________________________________

Maxima [A]
time = 0.28, size = 5, normalized size = 0.71 \begin {gather*} \log \left (\cos \left (x\right ) - 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(cos(x) - 1)

________________________________________________________________________________________

Fricas [A]
time = 0.36, size = 7, normalized size = 1.00 \begin {gather*} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(-1/2*cos(x) + 1/2)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 12 vs. \(2 (5) = 10\)
time = 1.06, size = 12, normalized size = 1.71 \begin {gather*} - \log {\left (\cot {\left (x \right )} + \csc {\left (x \right )} \right )} + \log {\left (\sin {\left (x \right )} \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+cos(x))*csc(x),x)

[Out]

-log(cot(x) + csc(x)) + log(sin(x))

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 6, normalized size = 0.86 \begin {gather*} \ln \left (-\cos x+1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((1+cos(x))*csc(x),x)

[Out]

log(-cos(x) + 1)

________________________________________________________________________________________

Mupad [B]
time = 0.05, size = 5, normalized size = 0.71 \begin {gather*} \ln \left (\cos \left (x\right )-1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

log(cos(x) - 1)

________________________________________________________________________________________