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

   Optimal result
   Rubi [A] (verified)
   Mathematica [B] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 7, antiderivative size = 7 \[ \int (1+\cos (x)) \csc (x) \, dx=\log (1-\cos (x)) \]

[Out]

ln(1-cos(x))

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.286, Rules used = {2746, 31} \[ \int (1+\cos (x)) \csc (x) \, dx=\log (1-\cos (x)) \]

[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*} \text {integral}& = -\text {Subst}\left (\int \frac {1}{1-x} \, dx,x,\cos (x)\right ) \\ & = \log (1-\cos (x)) \\ \end{align*}

Mathematica [B] (verified)

Leaf count is larger than twice the leaf count of optimal. \(23\) vs. \(2(7)=14\).

Time = 0.00 (sec) , antiderivative size = 23, normalized size of antiderivative = 3.29 \[ \int (1+\cos (x)) \csc (x) \, dx=-\log \left (\cos \left (\frac {x}{2}\right )\right )+\log (\cos (x))+\log \left (\sin \left (\frac {x}{2}\right )\right )+\log (\tan (x)) \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.44 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.86

method result size
default \(\ln \left (\sin \left (x \right )\right )+\ln \left (\csc \left (x \right )-\cot \left (x \right )\right )\) \(13\)
parts \(-\ln \left (\csc \left (x \right )\right )-\ln \left (\cot \left (x \right )+\csc \left (x \right )\right )\) \(15\)
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 \left (\frac {x}{2}\right )^{2}\right )\) \(20\)
parallelrisch \(2 \ln \left (\csc \left (x \right )-\cot \left (x \right )\right )-\ln \left (\frac {2}{\cos \left (x \right )+1}\right )\) \(23\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int (1+\cos (x)) \csc (x) \, dx=\log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) \]

[In]

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

[Out]

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

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 12 vs. \(2 (5) = 10\).

Time = 0.74 (sec) , antiderivative size = 12, normalized size of antiderivative = 1.71 \[ \int (1+\cos (x)) \csc (x) \, dx=- \log {\left (\cot {\left (x \right )} + \csc {\left (x \right )} \right )} + \log {\left (\sin {\left (x \right )} \right )} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.71 \[ \int (1+\cos (x)) \csc (x) \, dx=\log \left (\cos \left (x\right ) - 1\right ) \]

[In]

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

[Out]

log(cos(x) - 1)

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 7, normalized size of antiderivative = 1.00 \[ \int (1+\cos (x)) \csc (x) \, dx=\log \left (-\cos \left (x\right ) + 1\right ) \]

[In]

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

[Out]

log(-cos(x) + 1)

Mupad [B] (verification not implemented)

Time = 25.73 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.71 \[ \int (1+\cos (x)) \csc (x) \, dx=\ln \left (\cos \left (x\right )-1\right ) \]

[In]

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

[Out]

log(cos(x) - 1)