Optimal. Leaf size=30 \[ -\frac {\tan ^3(x)}{9}-\tan (x)+\frac {1}{3} \tan ^3(x) \log (\tan (x))+\tan (x) \log (\tan (x)) \]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 30, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {3767, 2554, 12} \[ -\frac {\tan ^3(x)}{9}-\tan (x)+\frac {1}{3} \tan ^3(x) \log (\tan (x))+\tan (x) \log (\tan (x)) \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2554
Rule 3767
Rubi steps
\begin {align*} \int \log (\tan (x)) \sec ^4(x) \, dx &=\log (\tan (x)) \tan (x)+\frac {1}{3} \log (\tan (x)) \tan ^3(x)-\int \frac {1}{3} (2+\cos (2 x)) \sec ^4(x) \, dx\\ &=\log (\tan (x)) \tan (x)+\frac {1}{3} \log (\tan (x)) \tan ^3(x)-\frac {1}{3} \int (2+\cos (2 x)) \sec ^4(x) \, dx\\ &=\log (\tan (x)) \tan (x)+\frac {1}{3} \log (\tan (x)) \tan ^3(x)-\frac {1}{3} \operatorname {Subst}\left (\int \left (3+x^2\right ) \, dx,x,\tan (x)\right )\\ &=-\tan (x)+\log (\tan (x)) \tan (x)-\frac {\tan ^3(x)}{9}+\frac {1}{3} \log (\tan (x)) \tan ^3(x)\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.09, size = 29, normalized size = 0.97 \[ \frac {1}{9} \tan (x) \left (\sec ^2(x) (6 \log (\tan (x))+3 \cos (2 x) \log (\tan (x))-1)-8\right ) \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \log (\tan (x)) \sec ^4(x) \, dx \]
Verification is Not applicable to the result.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 1.28, size = 39, normalized size = 1.30 \[ \frac {3 \, {\left (2 \, \cos \relax (x)^{2} + 1\right )} \log \left (\frac {\sin \relax (x)}{\cos \relax (x)}\right ) \sin \relax (x) - {\left (8 \, \cos \relax (x)^{2} + 1\right )} \sin \relax (x)}{9 \, \cos \relax (x)^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.95, size = 26, normalized size = 0.87 \[ \frac {1}{3} \, \log \left (\tan \relax (x)\right ) \tan \relax (x)^{3} - \frac {1}{9} \, \tan \relax (x)^{3} + \log \left (\tan \relax (x)\right ) \tan \relax (x) - \tan \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.52, size = 55, normalized size = 1.83
method | result | size |
default | \(\frac {\left (6 \left (\cos ^{2}\relax (x )\right ) \ln \relax (2)+6 \left (\cos ^{2}\relax (x )\right ) \ln \left (\frac {\sin \relax (x )}{2 \cos \relax (x )}\right )-8 \left (\cos ^{2}\relax (x )\right )+3 \ln \relax (2)+3 \ln \left (\frac {\sin \relax (x )}{2 \cos \relax (x )}\right )-1\right ) \sin \relax (x )}{9 \cos \relax (x )^{3}}\) | \(55\) |
risch | \(-\frac {4 i \left (3 \,{\mathrm e}^{2 i x}+1\right ) \ln \left (1+{\mathrm e}^{2 i x}\right )}{3 \left (1+{\mathrm e}^{2 i x}\right )^{3}}+\frac {\frac {2 \pi }{3}+\frac {2 \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{3}}{3}-\frac {2 \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} \pi }{3}+2 \pi \,{\mathrm e}^{2 i x}+\frac {2 \pi \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{3}}{3}-\frac {2 \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} \mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \pi }{3}-2 \pi \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}-\frac {2 \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \pi }{3}+\frac {2 \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )}{3}+\frac {2 i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{6 i x}}{3}+2 i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{4 i x}-\frac {2 i {\mathrm e}^{6 i x} \ln \left ({\mathrm e}^{2 i x}-1\right )}{3}-2 i {\mathrm e}^{4 i x} \ln \left ({\mathrm e}^{2 i x}-1\right )+2 i {\mathrm e}^{2 i x} \ln \left ({\mathrm e}^{2 i x}-1\right )-\frac {2 \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \pi }{3}+2 \pi \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{3} {\mathrm e}^{2 i x}+2 \pi \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{3} {\mathrm e}^{2 i x}-\frac {16 i}{9}-4 i {\mathrm e}^{2 i x}+\frac {2 i \ln \left (1+{\mathrm e}^{2 i x}\right )}{3}-\frac {4 i {\mathrm e}^{4 i x}}{3}+2 i \ln \left (1+{\mathrm e}^{2 i x}\right ) {\mathrm e}^{2 i x}+\frac {2 i \ln \left ({\mathrm e}^{2 i x}-1\right )}{3}-2 \pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}-2 \pi \,\mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}-2 \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right )^{2} {\mathrm e}^{2 i x}+\frac {2 \pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right )}{3}+2 \pi \,\mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {{\mathrm e}^{2 i x}-1}{1+{\mathrm e}^{2 i x}}\right ) {\mathrm e}^{2 i x}+2 \pi \,\mathrm {csgn}\left (i \left ({\mathrm e}^{2 i x}-1\right )\right ) \mathrm {csgn}\left (\frac {i}{1+{\mathrm e}^{2 i x}}\right ) \mathrm {csgn}\left (\frac {i \left ({\mathrm e}^{2 i x}-1\right )}{1+{\mathrm e}^{2 i x}}\right ) {\mathrm e}^{2 i x}}{\left (1+{\mathrm e}^{2 i x}\right )^{3}}\) | \(782\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [A] time = 0.43, size = 25, normalized size = 0.83 \[ -\frac {1}{9} \, \tan \relax (x)^{3} + \frac {1}{3} \, {\left (\tan \relax (x)^{3} + 3 \, \tan \relax (x)\right )} \log \left (\tan \relax (x)\right ) - \tan \relax (x) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.80, size = 148, normalized size = 4.93 \[ \frac {\ln \left (-\frac {8\,{\mathrm {e}}^{x\,2{}\mathrm {i}}}{3}-\frac {8}{3}\right )\,2{}\mathrm {i}}{3}-\frac {\ln \left (\frac {8}{3}-\frac {8\,{\mathrm {e}}^{x\,2{}\mathrm {i}}}{3}\right )\,2{}\mathrm {i}}{3}+\frac {8{}\mathrm {i}}{9\,\left (3\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{x\,4{}\mathrm {i}}+{\mathrm {e}}^{x\,6{}\mathrm {i}}+1\right )}-\frac {4{}\mathrm {i}}{3\,\left (2\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+{\mathrm {e}}^{x\,4{}\mathrm {i}}+1\right )}-\frac {4{}\mathrm {i}}{3\,\left ({\mathrm {e}}^{x\,2{}\mathrm {i}}+1\right )}+\frac {\ln \left (-\frac {{\mathrm {e}}^{x\,2{}\mathrm {i}}\,1{}\mathrm {i}-\mathrm {i}}{{\mathrm {e}}^{x\,2{}\mathrm {i}}+1}\right )\,\left ({\mathrm {e}}^{x\,2{}\mathrm {i}}\,4{}\mathrm {i}+\frac {4}{3}{}\mathrm {i}\right )}{3\,{\mathrm {e}}^{x\,2{}\mathrm {i}}+3\,{\mathrm {e}}^{x\,4{}\mathrm {i}}+{\mathrm {e}}^{x\,6{}\mathrm {i}}+1} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [A] time = 20.46, size = 46, normalized size = 1.53 \[ \frac {\log {\left (\tan {\relax (x )} \right )} \tan ^{3}{\relax (x )}}{3} + \log {\left (\tan {\relax (x )} \right )} \tan {\relax (x )} - \frac {\sin ^{3}{\relax (x )}}{9 \cos ^{3}{\relax (x )}} + \frac {\sin {\relax (x )}}{3 \cos {\relax (x )}} - \frac {4 \tan {\relax (x )}}{3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________