3.405 \(\int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx\)

Optimal. Leaf size=47 \[ \frac {1}{2} \sin (x) \sqrt {\sin (2 x)}+\frac {1}{2} \sqrt {\sin (2 x)} \cos (x)-\frac {1}{2} \log \left (\sin (x)+\sqrt {\sin (2 x)}+\cos (x)\right ) \]

________________________________________________________________________________________

Rubi [A]  time = 0.10, antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 16, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.312, Rules used = {4401, 4301, 4306, 4302, 4305} \[ \frac {1}{2} \sin (x) \sqrt {\sin (2 x)}+\frac {1}{2} \sqrt {\sin (2 x)} \cos (x)-\frac {1}{2} \log \left (\sin (x)+\sqrt {\sin (2 x)}+\cos (x)\right ) \]

Antiderivative was successfully verified.

[In]

Int[(Cos[x] - Sin[x])*Sqrt[Sin[2*x]],x]

[Out]

-Log[Cos[x] + Sin[x] + Sqrt[Sin[2*x]]]/2 + (Cos[x]*Sqrt[Sin[2*x]])/2 + (Sin[x]*Sqrt[Sin[2*x]])/2

Rule 4301

Int[cos[(a_.) + (b_.)*(x_)]*((g_.)*sin[(c_.) + (d_.)*(x_)])^(p_), x_Symbol] :> Simp[(2*Sin[a + b*x]*(g*Sin[c +
 d*x])^p)/(d*(2*p + 1)), x] + Dist[(2*p*g)/(2*p + 1), Int[Sin[a + b*x]*(g*Sin[c + d*x])^(p - 1), x], x] /; Fre
eQ[{a, b, c, d, g}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2] &&  !IntegerQ[p] && GtQ[p, 0] && IntegerQ[2*p]

Rule 4302

Int[sin[(a_.) + (b_.)*(x_)]*((g_.)*sin[(c_.) + (d_.)*(x_)])^(p_), x_Symbol] :> Simp[(-2*Cos[a + b*x]*(g*Sin[c
+ d*x])^p)/(d*(2*p + 1)), x] + Dist[(2*p*g)/(2*p + 1), Int[Cos[a + b*x]*(g*Sin[c + d*x])^(p - 1), x], x] /; Fr
eeQ[{a, b, c, d, g}, x] && EqQ[b*c - a*d, 0] && EqQ[d/b, 2] &&  !IntegerQ[p] && GtQ[p, 0] && IntegerQ[2*p]

Rule 4305

Int[cos[(a_.) + (b_.)*(x_)]/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> -Simp[ArcSin[Cos[a + b*x] - Sin[a + b*
x]]/d, x] + Simp[Log[Cos[a + b*x] + Sin[a + b*x] + Sqrt[Sin[c + d*x]]]/d, x] /; FreeQ[{a, b, c, d}, x] && EqQ[
b*c - a*d, 0] && EqQ[d/b, 2]

Rule 4306

Int[sin[(a_.) + (b_.)*(x_)]/Sqrt[sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> -Simp[ArcSin[Cos[a + b*x] - Sin[a + b*
x]]/d, x] - Simp[Log[Cos[a + b*x] + Sin[a + b*x] + Sqrt[Sin[c + d*x]]]/d, x] /; FreeQ[{a, b, c, d}, x] && EqQ[
b*c - a*d, 0] && EqQ[d/b, 2]

Rule 4401

Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /;  !InertTrigFreeQ[u]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.06, size = 43, normalized size = 0.91 \[ \frac {1}{2} \left (\sin (x) \sqrt {\sin (2 x)}+\sqrt {\sin (2 x)} \cos (x)-\log \left (\sin (x)+\sqrt {\sin (2 x)}+\cos (x)\right )\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[x] - Sin[x])*Sqrt[Sin[2*x]],x]

[Out]

(-Log[Cos[x] + Sin[x] + Sqrt[Sin[2*x]]] + Cos[x]*Sqrt[Sin[2*x]] + Sin[x]*Sqrt[Sin[2*x]])/2

________________________________________________________________________________________

IntegrateAlgebraic [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx \]

Verification is Not applicable to the result.

[In]

IntegrateAlgebraic[(Cos[x] - Sin[x])*Sqrt[Sin[2*x]],x]

[Out]

Could not integrate

________________________________________________________________________________________

fricas [B]  time = 0.66, size = 76, normalized size = 1.62 \[ \frac {1}{2} \, \sqrt {2} \sqrt {\cos \relax (x) \sin \relax (x)} {\left (\cos \relax (x) + \sin \relax (x)\right )} + \frac {1}{8} \, \log \left (-32 \, \cos \relax (x)^{4} + 4 \, \sqrt {2} {\left (4 \, \cos \relax (x)^{3} - {\left (4 \, \cos \relax (x)^{2} + 1\right )} \sin \relax (x) - 5 \, \cos \relax (x)\right )} \sqrt {\cos \relax (x) \sin \relax (x)} + 32 \, \cos \relax (x)^{2} + 16 \, \cos \relax (x) \sin \relax (x) + 1\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-sin(x))*sin(2*x)^(1/2),x, algorithm="fricas")

[Out]

1/2*sqrt(2)*sqrt(cos(x)*sin(x))*(cos(x) + sin(x)) + 1/8*log(-32*cos(x)^4 + 4*sqrt(2)*(4*cos(x)^3 - (4*cos(x)^2
 + 1)*sin(x) - 5*cos(x))*sqrt(cos(x)*sin(x)) + 32*cos(x)^2 + 16*cos(x)*sin(x) + 1)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (\cos \relax (x) - \sin \relax (x)\right )} \sqrt {\sin \left (2 \, x\right )}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-sin(x))*sin(2*x)^(1/2),x, algorithm="giac")

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.31, size = 442, normalized size = 9.40




method result size



default \(\frac {\sqrt {-\frac {\tan \left (\frac {x}{2}\right )}{\tan ^{2}\left (\frac {x}{2}\right )-1}}\, \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right ) \left (-3 \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \EllipticF \left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, \frac {\sqrt {2}}{2}\right ) \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}\, \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+4 \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}\, \EllipticE \left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, \frac {\sqrt {2}}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+4 \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \left (\tan ^{4}\left (\frac {x}{2}\right )\right )-3 \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \EllipticF \left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, \frac {\sqrt {2}}{2}\right ) \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}+4 \sqrt {\tan \left (\frac {x}{2}\right )+1}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}\, \EllipticE \left (\sqrt {\tan \left (\frac {x}{2}\right )+1}, \frac {\sqrt {2}}{2}\right )-2 \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}\, \left (\tan ^{3}\left (\frac {x}{2}\right )\right )+4 \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+2 \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}\, \tan \left (\frac {x}{2}\right )\right )}{\sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )}\, \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right ) \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \left (\tan \left (\frac {x}{2}\right )+1\right )}}\) \(442\)



Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(x)-sin(x))*sin(2*x)^(1/2),x,method=_RETURNVERBOSE)

[Out]

(-tan(1/2*x)/(tan(1/2*x)^2-1))^(1/2)*(tan(1/2*x)^2-1)*(-3*(tan(1/2*x)+1)^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*(-tan(1
/2*x))^(1/2)*EllipticF((tan(1/2*x)+1)^(1/2),1/2*2^(1/2))*(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/2*x)+1))^(1/2)*tan(
1/2*x)^2+4*(tan(1/2*x)+1)^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*(-tan(1/2*x))^(1/2)*(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/
2*x)+1))^(1/2)*EllipticE((tan(1/2*x)+1)^(1/2),1/2*2^(1/2))*tan(1/2*x)^2+4*(tan(1/2*x)^3-tan(1/2*x))^(1/2)*tan(
1/2*x)^4-3*(tan(1/2*x)+1)^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*(-tan(1/2*x))^(1/2)*EllipticF((tan(1/2*x)+1)^(1/2),1/2
*2^(1/2))*(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/2*x)+1))^(1/2)+4*(tan(1/2*x)+1)^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*(-ta
n(1/2*x))^(1/2)*(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/2*x)+1))^(1/2)*EllipticE((tan(1/2*x)+1)^(1/2),1/2*2^(1/2))-2
*(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/2*x)+1))^(1/2)*tan(1/2*x)^3+4*(tan(1/2*x)^3-tan(1/2*x))^(1/2)*tan(1/2*x)^2+
2*(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/2*x)+1))^(1/2)*tan(1/2*x))/(tan(1/2*x)*(tan(1/2*x)^2-1))^(1/2)/(1+tan(1/2*
x)^2)/(tan(1/2*x)^3-tan(1/2*x))^(1/2)/(tan(1/2*x)*(tan(1/2*x)-1)*(tan(1/2*x)+1))^(1/2)

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (\cos \relax (x) - \sin \relax (x)\right )} \sqrt {\sin \left (2 \, x\right )}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-sin(x))*sin(2*x)^(1/2),x, algorithm="maxima")

[Out]

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

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.02 \[ \int \sqrt {\sin \left (2\,x\right )}\,\left (\cos \relax (x)-\sin \relax (x)\right ) \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [F(-1)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)-sin(x))*sin(2*x)**(1/2),x)

[Out]

Timed out

________________________________________________________________________________________