3.839 \(\int (-\cos ^2(x)+\sin ^2(x)) \, dx\)

Optimal. Leaf size=6 \[ \sin (x) (-\cos (x)) \]

[Out]

-(Cos[x]*Sin[x])

________________________________________________________________________________________

Rubi [A]  time = 0.0110818, antiderivative size = 6, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {2635, 8} \[ \sin (x) (-\cos (x)) \]

Antiderivative was successfully verified.

[In]

Int[-Cos[x]^2 + Sin[x]^2,x]

[Out]

-(Cos[x]*Sin[x])

Rule 2635

Int[((b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> -Simp[(b*Cos[c + d*x]*(b*Sin[c + d*x])^(n - 1))/(d*n),
x] + Dist[(b^2*(n - 1))/n, Int[(b*Sin[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1] && Integer
Q[2*n]

Rule 8

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

Rubi steps

\begin{align*} \int \left (-\cos ^2(x)+\sin ^2(x)\right ) \, dx &=-\int \cos ^2(x) \, dx+\int \sin ^2(x) \, dx\\ &=-\cos (x) \sin (x)\\ \end{align*}

Mathematica [A]  time = 0.0023956, size = 8, normalized size = 1.33 \[ -\frac{1}{2} \sin (2 x) \]

Antiderivative was successfully verified.

[In]

Integrate[-Cos[x]^2 + Sin[x]^2,x]

[Out]

-Sin[2*x]/2

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 7, normalized size = 1.2 \begin{align*} -\cos \left ( x \right ) \sin \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(-cos(x)^2+sin(x)^2,x)

[Out]

-cos(x)*sin(x)

________________________________________________________________________________________

Maxima [A]  time = 0.952364, size = 8, normalized size = 1.33 \begin{align*} -\frac{1}{2} \, \sin \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*sin(2*x)

________________________________________________________________________________________

Fricas [A]  time = 2.09111, size = 22, normalized size = 3.67 \begin{align*} -\cos \left (x\right ) \sin \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cos(x)*sin(x)

________________________________________________________________________________________

Sympy [A]  time = 0.058978, size = 7, normalized size = 1.17 \begin{align*} - \sin{\left (x \right )} \cos{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-sin(x)*cos(x)

________________________________________________________________________________________

Giac [A]  time = 1.05358, size = 8, normalized size = 1.33 \begin{align*} -\frac{1}{2} \, \sin \left (2 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*sin(2*x)