Optimal. Leaf size=100 \[ 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}}+\frac {\tan (x)}{2 (\tan (x) \tan (2 x))^{3/2}}+\frac {2 \tan ^3(x)}{3 (\tan (x) \tan (2 x))^{3/2}}+\frac {3 \tan (x)}{4 \sqrt {\tan (x) \tan (2 x)}} \]
[Out]
________________________________________________________________________________________
Rubi [B] Leaf count is larger than twice the leaf count of optimal. \(208\) vs. \(2(100)=200\).
time = 0.72, antiderivative size = 208, normalized size of antiderivative = 2.08, number of steps
used = 22, number of rules used = 11, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.379, Rules used = {4482, 12,
1986, 15, 6857, 272, 43, 52, 65, 209, 455} \begin {gather*} -\frac {11 \tan (x) \text {ArcTan}\left (\sqrt {\tan ^2(x)-1}\right )}{4 \sqrt {2} \sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}} \sqrt {\tan ^2(x)-1}}+\frac {2 \tan (x) \text {ArcTan}\left (\frac {\sqrt {\tan ^2(x)-1}}{\sqrt {2}}\right )}{\sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}} \sqrt {\tan ^2(x)-1}}+\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 {\left (1-\tan ^2(x)\right ) \cot (x)}{4 \sqrt {2} \sqrt {\frac {\tan ^2(x)}{1-\tan ^2(x)}}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 15
Rule 43
Rule 52
Rule 65
Rule 209
Rule 272
Rule 455
Rule 1986
Rule 4482
Rule 6857
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\\ &=\text {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 {\text {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) \text {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) \text {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) \text {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) \text {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 ) \text {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) \text {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) \text {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) \text {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)) \text {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) \text {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) \text {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)) \text {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) \text {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 ) \text {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)) \text {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 ) \text {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 ) \text {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 = 3.38, size = 169, normalized size = 1.69 \begin {gather*} \frac {\left (-\cos (2 x)+2 \tan ^2(x)\right ) \left (\frac {4 \sqrt {2} \left (-2 \tanh ^{-1}\left (\sqrt {\frac {\cos (2 x)}{1+\cos (2 x)}}\right )+\sqrt {2} \tanh ^{-1}\left (\sqrt {1-\tan ^2(x)}\right )\right ) \cos (2 x) \tan (x)}{\sqrt {1-\tan ^2(x)}}-3 \tan ^{-1}\left (\sqrt {-1+\tan ^2(x)}\right ) \cos (x) \sin (x) \sqrt {-1+\tan ^2(x)}+\frac {1}{3} \left (-3 \cot (x)-4 \cos (x) \sin (x)+(5+9 \cos (2 x)) \tan ^3(x)\right )\right ) \tan ^2(2 x)}{2 (-3+6 \cos (2 x)+\cos (4 x)) (\tan (x) \tan (2 x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(558\) vs.
\(2(78)=156\).
time = 0.64, size = 559, normalized size = 5.59
method | result | size |
default | \(\text {Expression too large to display}\) | \(559\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 271 vs.
\(2 (78) = 156\).
time = 1.01, size = 271, normalized size = 2.71 \begin {gather*} -\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 193 vs.
\(2 (78) = 156\).
time = 0.86, size = 193, normalized size = 1.93 \begin {gather*} -\frac {\sqrt {2} {\left (2 \, {\left (-\tan \left (x\right )^{2} + 1\right )}^{\frac {3}{2}} + 3 \, \sqrt {-\tan \left (x\right )^{2} + 1}\right )}}{12 \, \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 {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 {\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 {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} -\int \frac {\cos \left (2\,x\right )-2\,{\mathrm {tan}\left (x\right )}^2}{{\cos \left (x\right )}^2\,{\left (\mathrm {tan}\left (2\,x\right )\,\mathrm {tan}\left (x\right )\right )}^{3/2}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________