3.817 \(\int \frac{1}{2} (-\cot (x) \csc (x)+\csc ^2(x)) \, dx\)

Optimal. Leaf size=13 \[ \frac{\csc (x)}{2}-\frac{\cot (x)}{2} \]

[Out]

-Cot[x]/2 + Csc[x]/2

________________________________________________________________________________________

Rubi [A]  time = 0.0135493, antiderivative size = 13, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 4, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.267, Rules used = {12, 2606, 8, 3767} \[ \frac{\csc (x)}{2}-\frac{\cot (x)}{2} \]

Antiderivative was successfully verified.

[In]

Int[(-(Cot[x]*Csc[x]) + Csc[x]^2)/2,x]

[Out]

-Cot[x]/2 + Csc[x]/2

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rule 8

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

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]

Rubi steps

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

Mathematica [A]  time = 0.0041819, size = 10, normalized size = 0.77 \[ \frac{1}{2} \tan \left (\frac{x}{2}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(-(Cot[x]*Csc[x]) + Csc[x]^2)/2,x]

[Out]

Tan[x/2]/2

________________________________________________________________________________________

Maple [A]  time = 0.007, size = 10, normalized size = 0.8 \begin{align*} -{\frac{\cot \left ( x \right ) }{2}}+{\frac{\csc \left ( x \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-1/2*cot(x)*csc(x)+1/2*csc(x)^2,x)

[Out]

-1/2*cot(x)+1/2*csc(x)

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-1/2*cot(x)*csc(x)+1/2*csc(x)^2,x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.20441, size = 34, normalized size = 2.62 \begin{align*} \frac{\sin \left (x\right )}{2 \,{\left (\cos \left (x\right ) + 1\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-1/2*cot(x)*csc(x)+1/2*csc(x)^2,x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.070277, size = 14, normalized size = 1.08 \begin{align*} - \frac{\cos{\left (x \right )}}{2 \sin{\left (x \right )}} + \frac{1}{2 \sin{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-1/2*cot(x)*csc(x)+1/2*csc(x)**2,x)

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-1/2*cot(x)*csc(x)+1/2*csc(x)^2,x, algorithm="giac")

[Out]

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