3.794 \(\int (1+\cos (x)) \csc ^2(x) \, dx\)

Optimal. Leaf size=9 \[ -\cot (x)-\csc (x) \]

[Out]

-Cot[x] - Csc[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0286004, antiderivative size = 9, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 9, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.333, Rules used = {2669, 3767, 8} \[ -\cot (x)-\csc (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-Cot[x] - Csc[x]

Rule 2669

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(b*(g*Cos[
e + f*x])^(p + 1))/(f*g*(p + 1)), x] + Dist[a, Int[(g*Cos[e + f*x])^p, x], x] /; FreeQ[{a, b, e, f, g, p}, x]
&& (IntegerQ[2*p] || NeQ[a^2 - b^2, 0])

Rule 3767

Int[csc[(c_.) + (d_.)*(x_)]^(n_), x_Symbol] :> -Dist[d^(-1), Subst[Int[ExpandIntegrand[(1 + x^2)^(n/2 - 1), x]
, x], x, Cot[c + d*x]], x] /; FreeQ[{c, d}, x] && IGtQ[n/2, 0]

Rule 8

Int[a_, x_Symbol] :> Simp[a*x, x] /; FreeQ[a, x]

Rubi steps

\begin{align*} \int (1+\cos (x)) \csc ^2(x) \, dx &=-\csc (x)+\int \csc ^2(x) \, dx\\ &=-\csc (x)-\operatorname{Subst}(\int 1 \, dx,x,\cot (x))\\ &=-\cot (x)-\csc (x)\\ \end{align*}

Mathematica [A]  time = 0.003734, size = 9, normalized size = 1. \[ -\cot (x)-\csc (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-Cot[x] - Csc[x]

________________________________________________________________________________________

Maple [A]  time = 0.017, size = 12, normalized size = 1.3 \begin{align*} - \left ( \sin \left ( x \right ) \right ) ^{-1}-\cot \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((1+cos(x))*csc(x)^2,x)

[Out]

-1/sin(x)-cot(x)

________________________________________________________________________________________

Maxima [A]  time = 0.968491, size = 18, normalized size = 2. \begin{align*} -\frac{1}{\sin \left (x\right )} - \frac{1}{\tan \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/sin(x) - 1/tan(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 3.76437, size = 8, normalized size = 0.89 \begin{align*} - \cot{\left (x \right )} - \frac{1}{\sin{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cot(x) - 1/sin(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/tan(1/2*x)