3.818 \(\int (-\csc ^2(x)+\sin (2 x)) \, dx\)

Optimal. Leaf size=11 \[ \cot (x)-\frac{1}{2} \cos (2 x) \]

[Out]

-Cos[2*x]/2 + Cot[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0082446, antiderivative size = 11, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.273, Rules used = {3767, 8, 2638} \[ \cot (x)-\frac{1}{2} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

Int[-Csc[x]^2 + Sin[2*x],x]

[Out]

-Cos[2*x]/2 + Cot[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]

Rule 8

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

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

Mathematica [A]  time = 0.0063004, size = 11, normalized size = 1. \[ \cot (x)-\frac{1}{2} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

Integrate[-Csc[x]^2 + Sin[2*x],x]

[Out]

-Cos[2*x]/2 + Cot[x]

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-csc(x)^2+sin(2*x),x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.967175, size = 15, normalized size = 1.36 \begin{align*} \frac{1}{\tan \left (x\right )} - \frac{1}{2} \, \cos \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-csc(x)^2+sin(2*x),x, algorithm="maxima")

[Out]

1/tan(x) - 1/2*cos(2*x)

________________________________________________________________________________________

Fricas [B]  time = 2.28629, size = 68, normalized size = 6.18 \begin{align*} -\frac{{\left (2 \, \cos \left (x\right )^{2} - 1\right )} \sin \left (x\right ) - 2 \, \cos \left (x\right )}{2 \, \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-csc(x)^2+sin(2*x),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.065527, size = 12, normalized size = 1.09 \begin{align*} - \frac{\cos{\left (2 x \right )}}{2} + \frac{\cos{\left (x \right )}}{\sin{\left (x \right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-csc(x)**2+sin(2*x),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.09132, size = 15, normalized size = 1.36 \begin{align*} \frac{1}{\tan \left (x\right )} - \frac{1}{2} \, \cos \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(-csc(x)^2+sin(2*x),x, algorithm="giac")

[Out]

1/tan(x) - 1/2*cos(2*x)