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

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

Optimal result

Integrand size = 15, antiderivative size = 13 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=-\frac {\cot (x)}{2}+\frac {\csc (x)}{2} \]

[Out]

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

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.267, Rules used = {12, 2686, 8, 3852} \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=\frac {\csc (x)}{2}-\frac {\cot (x)}{2} \]

[In]

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

[Out]

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

Rule 8

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

Rule 12

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

Rule 2686

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 3852

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*} \text {integral}& = \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} \text {Subst}(\int 1 \, dx,x,\cot (x))\right )+\frac {1}{2} \text {Subst}(\int 1 \, dx,x,\csc (x)) \\ & = -\frac {\cot (x)}{2}+\frac {\csc (x)}{2} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.77 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=\frac {1}{2} \tan \left (\frac {x}{2}\right ) \]

[In]

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

[Out]

Tan[x/2]/2

Maple [A] (verified)

Time = 1.23 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.77

method result size
default \(\frac {\csc \left (x \right )}{2}-\frac {\cot \left (x \right )}{2}\) \(10\)
parts \(\frac {\csc \left (x \right )}{2}-\frac {\cot \left (x \right )}{2}\) \(10\)
risch \(\frac {i}{{\mathrm e}^{i x}+1}\) \(13\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 10, normalized size of antiderivative = 0.77 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=\frac {\sin \left (x\right )}{2 \, {\left (\cos \left (x\right ) + 1\right )}} \]

[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] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 14, normalized size of antiderivative = 1.08 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=- \frac {\cos {\left (x \right )}}{2 \sin {\left (x \right )}} + \frac {1}{2 \sin {\left (x \right )}} \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.20 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=\frac {1}{2 \, \sin \left (x\right )} - \frac {1}{2 \, \tan \left (x\right )} \]

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

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 13, normalized size of antiderivative = 1.00 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=\frac {1}{2 \, \sin \left (x\right )} - \frac {1}{2 \, \tan \left (x\right )} \]

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

Mupad [B] (verification not implemented)

Time = 25.76 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.46 \[ \int \frac {1}{2} \left (-\cot (x) \csc (x)+\csc ^2(x)\right ) \, dx=\frac {\mathrm {tan}\left (\frac {x}{2}\right )}{2} \]

[In]

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

[Out]

tan(x/2)/2