Optimal. Leaf size=100 \[ \frac{2 \tan ^3(x)}{3 (\tan (x) \tan (2 x))^{3/2}}+\frac{3 \tan (x)}{4 \sqrt{\tan (x) \tan (2 x)}}+\frac{\tan (x)}{2 (\tan (x) \tan (2 x))^{3/2}}+2 \tanh ^{-1}\left (\frac{\tan (x)}{\sqrt{\tan (x) \tan (2 x)}}\right )-\frac{11 \tanh ^{-1}\left (\frac{\sqrt{2} \tan (x)}{\sqrt{\tan (x) \tan (2 x)}}\right )}{4 \sqrt{2}} \]
[Out]
________________________________________________________________________________________
Rubi [B] time = 1.22598, antiderivative size = 208, normalized size of antiderivative = 2.08, number of steps used = 21, number of rules used = 10, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.345, Rules used = {4397, 12, 6719, 6725, 266, 47, 50, 63, 203, 444} \[ \frac{\left (1-\tan ^2(x)\right ) \tan (x)}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{11 \tan ^{-1}\left (\sqrt{\tan ^2(x)-1}\right ) \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{\tan ^2(x)-1}}+\frac{2 \tan ^{-1}\left (\frac{\sqrt{\tan ^2(x)-1}}{\sqrt{2}}\right ) \tan (x)}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{\tan ^2(x)-1}}+\frac{\left (1-\tan ^2(x)\right ) \cot (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4397
Rule 12
Rule 6719
Rule 6725
Rule 266
Rule 47
Rule 50
Rule 63
Rule 203
Rule 444
Rubi steps
\begin{align*} \int \frac{\sec ^2(x) \left (-\cos (2 x)+2 \tan ^2(x)\right )}{(\tan (x) \tan (2 x))^{3/2}} \, dx &=\int \frac{\sec ^2(x) \left (-\cos (2 x)+2 \tan ^2(x)\right )}{(-1+\sec (2 x))^{3/2}} \, dx\\ &=\operatorname{Subst}\left (\int \frac{\left (1-x^2\right ) \left (-1+3 x^2+2 x^4\right )}{2 \sqrt{2} x^2 \sqrt{\frac{x^2}{1-x^2}} \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right ) \left (-1+3 x^2+2 x^4\right )}{x^2 \sqrt{\frac{x^2}{1-x^2}} \left (1+x^2\right )} \, dx,x,\tan (x)\right )}{2 \sqrt{2}}\\ &=\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{3/2} \left (-1+3 x^2+2 x^4\right )}{x^3 \left (1+x^2\right )} \, dx,x,\tan (x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{\tan (x) \operatorname{Subst}\left (\int \left (-\frac{\left (1-x^2\right )^{3/2}}{x^3}+\frac{4 \left (1-x^2\right )^{3/2}}{x}-\frac{2 x \left (1-x^2\right )^{3/2}}{1+x^2}\right ) \, dx,x,\tan (x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{3/2}}{x^3} \, dx,x,\tan (x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{x \left (1-x^2\right )^{3/2}}{1+x^2} \, dx,x,\tan (x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\left (\sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{3/2}}{x} \, dx,x,\tan (x)\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{(1-x)^{3/2}}{x^2} \, dx,x,\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{(1-x)^{3/2}}{1+x} \, dx,x,\tan ^2(x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\tan (x) \operatorname{Subst}\left (\int \frac{(1-x)^{3/2}}{x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{(3 \tan (x)) \operatorname{Subst}\left (\int \frac{\sqrt{1-x}}{x} \, dx,x,\tan ^2(x)\right )}{8 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\sqrt{1-x}}{x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\sqrt{1-x}}{1+x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{(3 \tan (x)) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-x} x} \, dx,x,\tan ^2(x)\right )}{8 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\tan (x) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-x} x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\left (\sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-x} (1+x)} \, dx,x,\tan ^2(x)\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{(3 \tan (x)) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sqrt{1-\tan ^2(x)}\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\left (\sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sqrt{1-\tan ^2(x)}\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\left (2 \sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{1}{2-x^2} \, dx,x,\sqrt{1-\tan ^2(x)}\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{3 \tanh ^{-1}\left (\sqrt{1-\tan ^2(x)}\right ) \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\sqrt{2} \tanh ^{-1}\left (\sqrt{1-\tan ^2(x)}\right ) \tan (x)}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{2 \tanh ^{-1}\left (\frac{\sqrt{1-\tan ^2(x)}}{\sqrt{2}}\right ) \tan (x)}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}\\ \end{align*}
Mathematica [A] time = 4.59417, size = 168, normalized size = 1.68 \[ \frac{\tan ^2(2 x) \left (2 \tan ^2(x)-\cos (2 x)\right ) \left (-3 \sin (x) \cos (x) \tan ^{-1}\left (\sqrt{\tan ^2(x)-1}\right ) \sqrt{\tan ^2(x)-1}+\frac{4 \sqrt{2} \cos (2 x) \tan (x) \left (\sqrt{2} \tanh ^{-1}\left (\sqrt{1-\tan ^2(x)}\right )-2 \tanh ^{-1}\left (\frac{1}{2} \sqrt{2-2 \tan ^2(x)}\right )\right )}{\sqrt{1-\tan ^2(x)}}+\frac{1}{3} \left (-3 \cot (x)-4 \sin (x) \cos (x)+(9 \cos (2 x)+5) \tan ^3(x)\right )\right )}{2 (6 \cos (2 x)+\cos (4 x)-3) (\tan (x) \tan (2 x))^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.482, size = 559, normalized size = 5.6 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{2 \, \tan \left (x\right )^{2} - \cos \left (2 \, x\right )}{\left (\tan \left (2 \, x\right ) \tan \left (x\right )\right )^{\frac{3}{2}} \cos \left (x\right )^{2}}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 3.30021, size = 784, normalized size = 7.84 \begin{align*} -\frac{24 \,{\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \log \left (-\frac{4 \, \sqrt{2}{\left (8 \, \cos \left (x\right )^{5} - 6 \, \cos \left (x\right )^{3} + \cos \left (x\right )\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} -{\left (32 \, \cos \left (x\right )^{4} - 16 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )}{\sin \left (x\right )}\right ) \sin \left (x\right ) - 33 \,{\left (\sqrt{2} \cos \left (x\right )^{5} - \sqrt{2} \cos \left (x\right )^{3}\right )} \log \left (\frac{4 \,{\left (\sqrt{2}{\left (2 \,{\left (3 \, \sqrt{2} - 4\right )} \cos \left (x\right )^{3} -{\left (3 \, \sqrt{2} - 4\right )} \cos \left (x\right )\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} +{\left (3 \,{\left (2 \, \sqrt{2} - 3\right )} \cos \left (x\right )^{2} - 2 \, \sqrt{2} + 3\right )} \sin \left (x\right )\right )}}{{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right )}\right ) \sin \left (x\right ) - 2 \, \sqrt{2}{\left (22 \, \cos \left (x\right )^{6} - 47 \, \cos \left (x\right )^{4} + 26 \, \cos \left (x\right )^{2} - 4\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} - 44 \,{\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \sin \left (x\right )}{48 \,{\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \sin \left (x\right )} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.34416, size = 265, normalized size = 2.65 \begin{align*} \frac{11 \, \sqrt{2} \log \left (\sqrt{-\tan \left (x\right )^{2} + 1} + 1\right )}{16 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} - \frac{11 \, \sqrt{2} \log \left (-\sqrt{-\tan \left (x\right )^{2} + 1} + 1\right )}{16 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} - \frac{2 \, \sqrt{2}{\left (-\tan \left (x\right )^{2} + 1\right )}^{\frac{3}{2}} + 3 \, \sqrt{2} \sqrt{-\tan \left (x\right )^{2} + 1}}{12 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} + \frac{\log \left (\frac{\sqrt{2} - \sqrt{-\tan \left (x\right )^{2} + 1}}{\sqrt{2} + \sqrt{-\tan \left (x\right )^{2} + 1}}\right )}{\mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} - \frac{\sqrt{2} \sqrt{-\tan \left (x\right )^{2} + 1}}{8 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right ) \tan \left (x\right )^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]