Integrand size = 16, antiderivative size = 47 \[ \int (\cos (x)-\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)} \]
Time = 0.10 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.91 \[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx=\frac {1}{2} \left (-\log \left (\cos (x)+\sin (x)+\sqrt {\sin (2 x)}\right )+\cos (x) \sqrt {\sin (2 x)}+\sin (x) \sqrt {\sin (2 x)}\right ) \]
Time = 0.26 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.188, Rules used = {3042, 4901, 2009}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \sqrt {\sin (2 x)} (\cos (x)-\sin (x)) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \sqrt {\sin (2 x)} (\cos (x)-\sin (x))dx\) |
\(\Big \downarrow \) 4901 |
\(\displaystyle \int \left (\sqrt {\sin (2 x)} \cos (x)-\sin (x) \sqrt {\sin (2 x)}\right )dx\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \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 )\) |
-1/2*Log[Cos[x] + Sin[x] + Sqrt[Sin[2*x]]] + (Cos[x]*Sqrt[Sin[2*x]])/2 + ( Sin[x]*Sqrt[Sin[2*x]])/2
3.5.5.3.1 Defintions of rubi rules used
Int[u_, x_Symbol] :> With[{v = ExpandTrig[u, x]}, Int[v, x] /; SumQ[v]] /; !InertTrigFreeQ[u]
Result contains higher order function than in optimal. Order 4 vs. order 3.
Time = 5.27 (sec) , antiderivative size = 396, normalized size of antiderivative = 8.43
method | result | size |
parts | \(\frac {2 \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 (2 \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}\, \sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, E\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right )-\sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, F\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right ) \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}+2 \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \left (\tan ^{2}\left (\frac {x}{2}\right )\right )\right )}{\sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )}\, \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}}-\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 (\sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, F\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+\sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, F\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right )+2 \left (\tan ^{3}\left (\frac {x}{2}\right )\right )-2 \tan \left (\frac {x}{2}\right )\right )}{\sqrt {\tan \left (\frac {x}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )-1\right )}\, \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )}\) | \(396\) |
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 (4 \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}\, \sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, E\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )-3 \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}\, \sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, F\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right ) \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+4 \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}\, \sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, E\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right )-3 \sqrt {1+\tan \left (\frac {x}{2}\right )}\, \sqrt {-2 \tan \left (\frac {x}{2}\right )+2}\, \sqrt {-\tan \left (\frac {x}{2}\right )}\, F\left (\sqrt {1+\tan \left (\frac {x}{2}\right )}, \frac {\sqrt {2}}{2}\right ) \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\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 )-2 \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\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 {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\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 )}\, \sqrt {\left (1+\tan \left (\frac {x}{2}\right )\right ) \left (\tan \left (\frac {x}{2}\right )-1\right ) \tan \left (\frac {x}{2}\right )}\, \sqrt {\tan ^{3}\left (\frac {x}{2}\right )-\tan \left (\frac {x}{2}\right )}\, \left (1+\tan ^{2}\left (\frac {x}{2}\right )\right )}\) | \(442\) |
2*(-tan(1/2*x)/(tan(1/2*x)^2-1))^(1/2)*(tan(1/2*x)^2-1)*(2*((1+tan(1/2*x)) *(tan(1/2*x)-1)*tan(1/2*x))^(1/2)*(1+tan(1/2*x))^(1/2)*(-2*tan(1/2*x)+2)^( 1/2)*(-tan(1/2*x))^(1/2)*EllipticE((1+tan(1/2*x))^(1/2),1/2*2^(1/2))-(1+ta n(1/2*x))^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*(-tan(1/2*x))^(1/2)*EllipticF((1+t an(1/2*x))^(1/2),1/2*2^(1/2))*((1+tan(1/2*x))*(tan(1/2*x)-1)*tan(1/2*x))^( 1/2)+2*(tan(1/2*x)^3-tan(1/2*x))^(1/2)*tan(1/2*x)^2)/(tan(1/2*x)*(tan(1/2* x)^2-1))^(1/2)/(tan(1/2*x)^3-tan(1/2*x))^(1/2)/((1+tan(1/2*x))*(tan(1/2*x) -1)*tan(1/2*x))^(1/2)-(-tan(1/2*x)/(tan(1/2*x)^2-1))^(1/2)*(tan(1/2*x)^2-1 )*((1+tan(1/2*x))^(1/2)*(-2*tan(1/2*x)+2)^(1/2)*(-tan(1/2*x))^(1/2)*Ellipt icF((1+tan(1/2*x))^(1/2),1/2*2^(1/2))*tan(1/2*x)^2+(1+tan(1/2*x))^(1/2)*(- 2*tan(1/2*x)+2)^(1/2)*(-tan(1/2*x))^(1/2)*EllipticF((1+tan(1/2*x))^(1/2),1 /2*2^(1/2))+2*tan(1/2*x)^3-2*tan(1/2*x))/(tan(1/2*x)*(tan(1/2*x)^2-1))^(1/ 2)/(tan(1/2*x)^3-tan(1/2*x))^(1/2)/(1+tan(1/2*x)^2)
Leaf count of result is larger than twice the leaf count of optimal. 76 vs. \(2 (35) = 70\).
Time = 0.28 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.62 \[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx=\frac {1}{2} \, \sqrt {2} \sqrt {\cos \left (x\right ) \sin \left (x\right )} {\left (\cos \left (x\right ) + \sin \left (x\right )\right )} + \frac {1}{8} \, \log \left (-32 \, \cos \left (x\right )^{4} + 4 \, \sqrt {2} {\left (4 \, \cos \left (x\right )^{3} - {\left (4 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right ) - 5 \, \cos \left (x\right )\right )} \sqrt {\cos \left (x\right ) \sin \left (x\right )} + 32 \, \cos \left (x\right )^{2} + 16 \, \cos \left (x\right ) \sin \left (x\right ) + 1\right ) \]
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)*s in(x)) + 32*cos(x)^2 + 16*cos(x)*sin(x) + 1)
Timed out. \[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx=\text {Timed out} \]
\[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx=\int { {\left (\cos \left (x\right ) - \sin \left (x\right )\right )} \sqrt {\sin \left (2 \, x\right )} \,d x } \]
\[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx=\int { {\left (\cos \left (x\right ) - \sin \left (x\right )\right )} \sqrt {\sin \left (2 \, x\right )} \,d x } \]
Timed out. \[ \int (\cos (x)-\sin (x)) \sqrt {\sin (2 x)} \, dx=\int \sqrt {\sin \left (2\,x\right )}\,\left (\cos \left (x\right )-\sin \left (x\right )\right ) \,d x \]