Integrand size = 18, antiderivative size = 57 \[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=-\sqrt {2} \arctan \left (1-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )+\sqrt {2} \arctan \left (1+\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right ) \]
[Out]
Leaf count is larger than twice the leaf count of optimal. \(243\) vs. \(2(57)=114\).
Time = 0.23 (sec) , antiderivative size = 243, normalized size of antiderivative = 4.26, number of steps used = 22, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3186, 2655, 303, 1176, 631, 210, 1179, 642, 2654} \[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=\frac {\arctan \left (1-\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{\sqrt {2}}-\frac {\arctan \left (\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}+1\right )}{\sqrt {2}}-\frac {\arctan \left (1-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{\sqrt {2}}+\frac {\arctan \left (\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+1\right )}{\sqrt {2}}+\frac {\log \left (\tan (x)-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+1\right )}{2 \sqrt {2}}-\frac {\log \left (\tan (x)+\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+1\right )}{2 \sqrt {2}}-\frac {\log \left (\cot (x)-\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}+1\right )}{2 \sqrt {2}}+\frac {\log \left (\cot (x)+\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}+1\right )}{2 \sqrt {2}} \]
[In]
[Out]
Rule 210
Rule 303
Rule 631
Rule 642
Rule 1176
Rule 1179
Rule 2654
Rule 2655
Rule 3186
Rubi steps \begin{align*} \text {integral}& = \int \left (\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}+\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right ) \, dx \\ & = \int \frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}} \, dx+\int \frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}} \, dx \\ & = -\left (2 \text {Subst}\left (\int \frac {x^2}{1+x^4} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )\right )+2 \text {Subst}\left (\int \frac {x^2}{1+x^4} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right ) \\ & = \text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )-\text {Subst}\left (\int \frac {1-x^2}{1+x^4} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )-\text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )+\text {Subst}\left (\int \frac {1+x^2}{1+x^4} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right ) \\ & = -\left (\frac {1}{2} \text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1-\sqrt {2} x+x^2} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )-\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )+\frac {1}{2} \text {Subst}\left (\int \frac {1}{1+\sqrt {2} x+x^2} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )-\frac {\text {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{2 \sqrt {2}}+\frac {\text {Subst}\left (\int \frac {\sqrt {2}+2 x}{-1-\sqrt {2} x-x^2} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{2 \sqrt {2}}-\frac {\text {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\frac {\sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{2 \sqrt {2}}+\frac {\text {Subst}\left (\int \frac {\sqrt {2}-2 x}{-1+\sqrt {2} x-x^2} \, dx,x,\frac {\sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{2 \sqrt {2}} \\ & = -\frac {\log \left (1+\cot (x)-\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{2 \sqrt {2}}+\frac {\log \left (1+\cot (x)+\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{2 \sqrt {2}}+\frac {\log \left (1-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+\tan (x)\right )}{2 \sqrt {2}}-\frac {\log \left (1+\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+\tan (x)\right )}{2 \sqrt {2}}-\frac {\text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{\sqrt {2}}+\frac {\text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{\sqrt {2}}+\frac {\text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{\sqrt {2}}-\frac {\text {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,1+\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{\sqrt {2}} \\ & = \frac {\arctan \left (1-\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{\sqrt {2}}-\frac {\arctan \left (1+\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{\sqrt {2}}-\frac {\arctan \left (1-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{\sqrt {2}}+\frac {\arctan \left (1+\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}\right )}{\sqrt {2}}-\frac {\log \left (1+\cot (x)-\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{2 \sqrt {2}}+\frac {\log \left (1+\cot (x)+\frac {\sqrt {2} \sqrt {\cos (x)}}{\sqrt {\sin (x)}}\right )}{2 \sqrt {2}}+\frac {\log \left (1-\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+\tan (x)\right )}{2 \sqrt {2}}-\frac {\log \left (1+\frac {\sqrt {2} \sqrt {\sin (x)}}{\sqrt {\cos (x)}}+\tan (x)\right )}{2 \sqrt {2}} \\ \end{align*}
Result contains higher order function than in optimal. Order 5 vs. order 3 in optimal.
Time = 0.05 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.19 \[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=\frac {2 \sqrt [4]{\cos ^2(x)} \sqrt {\sin (x)} \left (3 \cos (x) \operatorname {Hypergeometric2F1}\left (\frac {1}{4},\frac {1}{4},\frac {5}{4},\sin ^2(x)\right )+\sqrt {\cos ^2(x)} \operatorname {Hypergeometric2F1}\left (\frac {3}{4},\frac {3}{4},\frac {7}{4},\sin ^2(x)\right ) \sin (x)\right )}{3 \cos ^{\frac {3}{2}}(x)} \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. \(95\) vs. \(2(41)=82\).
Time = 24.51 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.68
method | result | size |
default | \(-\frac {\sqrt {2}\, \left (\arctan \left (\frac {\sqrt {2}\, \sin \left (x \right ) \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+\cos \left (x \right )-1}{\cos \left (x \right )-1}\right )+\arctan \left (\frac {\sqrt {2}\, \sin \left (x \right ) \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}-\cos \left (x \right )+1}{\cos \left (x \right )-1}\right )\right ) \left (\cos \left (x \right )-1\right ) \sqrt {\cos \left (x \right )}}{\sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}\, \sin \left (x \right )^{\frac {3}{2}}}\) | \(96\) |
parts | \(-\frac {\sqrt {\cos \left (x \right )}\, \left (\cos \left (x \right )-1\right ) \left (\ln \left (-2 \cot \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}-2 \csc \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+2 \cot \left (x \right )+2\right )+2 \arctan \left (\frac {\sqrt {2}\, \sin \left (x \right ) \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+\cos \left (x \right )-1}{\cos \left (x \right )-1}\right )-\ln \left (2 \cot \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+2 \csc \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+2 \cot \left (x \right )+2\right )+2 \arctan \left (\frac {\sqrt {2}\, \sin \left (x \right ) \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}-\cos \left (x \right )+1}{\cos \left (x \right )-1}\right )\right ) \sqrt {2}}{4 \sin \left (x \right )^{\frac {3}{2}} \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}}+\frac {\left (\cos \left (x \right )-1\right ) \sqrt {\cos \left (x \right )}\, \left (\ln \left (-2 \cot \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}-2 \csc \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+2 \cot \left (x \right )+2\right )-2 \arctan \left (\frac {\sqrt {2}\, \sin \left (x \right ) \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+\cos \left (x \right )-1}{\cos \left (x \right )-1}\right )-\ln \left (2 \cot \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+2 \csc \left (x \right ) \sqrt {2}\, \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}+2 \cot \left (x \right )+2\right )-2 \arctan \left (\frac {\sqrt {2}\, \sin \left (x \right ) \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}-\cos \left (x \right )+1}{\cos \left (x \right )-1}\right )\right ) \sqrt {2}}{4 \sin \left (x \right )^{\frac {3}{2}} \sqrt {\frac {\cos \left (x \right ) \sin \left (x \right )}{\left (\cos \left (x \right )+1\right )^{2}}}}\) | \(392\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 85 vs. \(2 (41) = 82\).
Time = 0.26 (sec) , antiderivative size = 85, normalized size of antiderivative = 1.49 \[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=-\frac {1}{4} \, \sqrt {2} \arctan \left (-\frac {{\left (32 \, \sqrt {2} \cos \left (x\right )^{4} - 32 \, \sqrt {2} \cos \left (x\right )^{2} + 16 \, \sqrt {2} \cos \left (x\right ) \sin \left (x\right ) - \sqrt {2}\right )} \sqrt {\cos \left (x\right )} \sqrt {\sin \left (x\right )}}{8 \, {\left (4 \, \cos \left (x\right )^{5} - 3 \, \cos \left (x\right )^{3} - {\left (4 \, \cos \left (x\right )^{4} - 5 \, \cos \left (x\right )^{2}\right )} \sin \left (x\right ) - \cos \left (x\right )\right )}}\right ) \]
[In]
[Out]
\[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=\int \frac {\sin {\left (x \right )} + \cos {\left (x \right )}}{\sqrt {\sin {\left (x \right )}} \sqrt {\cos {\left (x \right )}}}\, dx \]
[In]
[Out]
\[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=\int { \frac {\cos \left (x\right ) + \sin \left (x\right )}{\sqrt {\cos \left (x\right )} \sqrt {\sin \left (x\right )}} \,d x } \]
[In]
[Out]
\[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=\int { \frac {\cos \left (x\right ) + \sin \left (x\right )}{\sqrt {\cos \left (x\right )} \sqrt {\sin \left (x\right )}} \,d x } \]
[In]
[Out]
Time = 28.44 (sec) , antiderivative size = 51, normalized size of antiderivative = 0.89 \[ \int \frac {\cos (x)+\sin (x)}{\sqrt {\cos (x)} \sqrt {\sin (x)}} \, dx=-\frac {2\,\sqrt {\cos \left (x\right )}\,{\sin \left (x\right )}^{3/2}\,{{}}_2{\mathrm {F}}_1\left (\frac {1}{4},\frac {1}{4};\ \frac {5}{4};\ {\cos \left (x\right )}^2\right )}{{\left ({\sin \left (x\right )}^2\right )}^{3/4}}-\frac {2\,{\cos \left (x\right )}^{3/2}\,\sqrt {\sin \left (x\right )}\,{{}}_2{\mathrm {F}}_1\left (\frac {3}{4},\frac {3}{4};\ \frac {7}{4};\ {\cos \left (x\right )}^2\right )}{3\,{\left ({\sin \left (x\right )}^2\right )}^{1/4}} \]
[In]
[Out]