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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 11, normalized size of antiderivative = 1.00, 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 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]

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 \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.01, size = 11, normalized size = 1.00 \[ \cot (x)-\frac {1}{2} \cos (2 x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

fricas [B]  time = 0.59, size = 22, normalized size = 2.00 \[ -\frac {{\left (2 \, \cos \relax (x)^{2} - 1\right )} \sin \relax (x) - 2 \, \cos \relax (x)}{2 \, \sin \relax (x)} \]

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)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 11, normalized size = 1.00 \[ \frac {1}{\tan \relax (x)} - \frac {1}{2} \, \cos \left (2 \, x\right ) \]

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)

________________________________________________________________________________________

maple [A]  time = 0.03, size = 10, normalized size = 0.91 \[ -\frac {\cos \left (2 x \right )}{2}+\cot \relax (x ) \]

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.33, size = 11, normalized size = 1.00 \[ \frac {1}{\tan \relax (x)} - \frac {1}{2} \, \cos \left (2 \, x\right ) \]

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)

________________________________________________________________________________________

mupad [B]  time = 2.92, size = 14, normalized size = 1.27 \[ \frac {\cos \relax (x)}{\sin \relax (x)}-{\cos \relax (x)}^2 \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.06, size = 12, normalized size = 1.09 \[ - \frac {\cos {\left (2 x \right )}}{2} + \frac {\cos {\relax (x )}}{\sin {\relax (x )}} \]

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)

________________________________________________________________________________________